mbox series

[v1,0/1] gpio: aspeed: Add gpio base address reading

Message ID 20210113223808.31626-1-hongweiz@ami.com
Headers show
Series gpio: aspeed: Add gpio base address reading | expand

Message

Hongwei Zhang Jan. 13, 2021, 10:38 p.m. UTC
Dear Reviewer,

Add gpio base address reading in the driver; in old code, it just
returns -1 to gpio->chip.base. In this patch, the code first try to
read base address from of_property_read_u32(), if it fails, then
return -1.

Hongwei Zhang (1):
  gpio: aspeed: Add gpio base address reading

 drivers/gpio/gpio-aspeed.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Hongwei Zhang Feb. 5, 2021, 4:34 p.m. UTC | #1
> Hello,
> 
> On Thu, 14 Jan 2021, at 09:08, Hongwei Zhang wrote:
> > Add gpio base address reading in the driver; in old code, it just 
> > returns -1 to gpio->chip.base.
> 
> Why do you want to do this? It feels hacky. The base address only affects the legacy sysfs number-space, 
> and even then if you're using the sysfs interface you can discover the base address for a specific gpiochip 
> via the associated attribute. For example:
> 
> # cat /sys/bus/platform/devices/1e780000.gpio/gpio/gpiochip*/base
> 816
> 
> I feel that you should instead be changing your userspace not to assume a fixed value.
> 
> Finally, the base value is a linux-specific thing and doesn't belong in the devicetree, and if it did, you 
> would also need to update the devicetree binding in Documentation/.
> 
> Cheers,
> 
> Andrew

Hi Andrew,

Thanks for your review and advice.

--Hongwei