* [PATCH] gpio: realtek-otto: use unsigned long
@ 2025-12-17 20:23 Rosen Penev
2025-12-17 22:52 ` David Laight
2025-12-18 15:30 ` Bartosz Golaszewski
0 siblings, 2 replies; 5+ messages in thread
From: Rosen Penev @ 2025-12-17 20:23 UTC (permalink / raw)
To: linux-gpio; +Cc: Linus Walleij, Bartosz Golaszewski, open list
Fixes compilation on 64-bit platforms as pointers need a larger type.
Change device_get_match_data to of variant. The data is obtained through
OF anyway.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/gpio/gpio-realtek-otto.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-realtek-otto.c b/drivers/gpio/gpio-realtek-otto.c
index e6694d5d1696..e9c89b191989 100644
--- a/drivers/gpio/gpio-realtek-otto.c
+++ b/drivers/gpio/gpio-realtek-otto.c
@@ -360,7 +360,7 @@ static int realtek_gpio_probe(struct platform_device *pdev)
struct gpio_generic_chip_config config;
struct device *dev = &pdev->dev;
unsigned long gen_gc_flags;
- unsigned int dev_flags;
+ unsigned long dev_flags;
struct gpio_irq_chip *girq;
struct realtek_gpio_ctrl *ctrl;
struct resource *res;
@@ -372,7 +372,7 @@ static int realtek_gpio_probe(struct platform_device *pdev)
if (!ctrl)
return -ENOMEM;
- dev_flags = (unsigned int) device_get_match_data(dev);
+ dev_flags = (unsigned long) of_device_get_match_data(dev);
ngpios = REALTEK_GPIO_MAX;
of_property_read_u32(dev->of_node, "ngpios", &ngpios);
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] gpio: realtek-otto: use unsigned long
2025-12-17 20:23 [PATCH] gpio: realtek-otto: use unsigned long Rosen Penev
@ 2025-12-17 22:52 ` David Laight
2025-12-17 22:55 ` Rosen Penev
2025-12-18 15:30 ` Bartosz Golaszewski
1 sibling, 1 reply; 5+ messages in thread
From: David Laight @ 2025-12-17 22:52 UTC (permalink / raw)
To: Rosen Penev; +Cc: linux-gpio, Linus Walleij, Bartosz Golaszewski, open list
On Wed, 17 Dec 2025 12:23:31 -0800
Rosen Penev <rosenp@gmail.com> wrote:
> Fixes compilation on 64-bit platforms as pointers need a larger type.
Not a good description...
>
> Change device_get_match_data to of variant. The data is obtained through
> OF anyway.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> drivers/gpio/gpio-realtek-otto.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-realtek-otto.c b/drivers/gpio/gpio-realtek-otto.c
> index e6694d5d1696..e9c89b191989 100644
> --- a/drivers/gpio/gpio-realtek-otto.c
> +++ b/drivers/gpio/gpio-realtek-otto.c
> @@ -360,7 +360,7 @@ static int realtek_gpio_probe(struct platform_device *pdev)
> struct gpio_generic_chip_config config;
> struct device *dev = &pdev->dev;
> unsigned long gen_gc_flags;
> - unsigned int dev_flags;
> + unsigned long dev_flags;
You don't need to change the type of the variable, just the cast.
David
> struct gpio_irq_chip *girq;
> struct realtek_gpio_ctrl *ctrl;
> struct resource *res;
> @@ -372,7 +372,7 @@ static int realtek_gpio_probe(struct platform_device *pdev)
> if (!ctrl)
> return -ENOMEM;
>
> - dev_flags = (unsigned int) device_get_match_data(dev);
> + dev_flags = (unsigned long) of_device_get_match_data(dev);
>
> ngpios = REALTEK_GPIO_MAX;
> of_property_read_u32(dev->of_node, "ngpios", &ngpios);
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gpio: realtek-otto: use unsigned long
2025-12-17 22:52 ` David Laight
@ 2025-12-17 22:55 ` Rosen Penev
2025-12-18 15:10 ` Bartosz Golaszewski
0 siblings, 1 reply; 5+ messages in thread
From: Rosen Penev @ 2025-12-17 22:55 UTC (permalink / raw)
To: David Laight; +Cc: linux-gpio, Linus Walleij, Bartosz Golaszewski, open list
On Wed, Dec 17, 2025 at 2:52 PM David Laight
<david.laight.linux@gmail.com> wrote:
>
> On Wed, 17 Dec 2025 12:23:31 -0800
> Rosen Penev <rosenp@gmail.com> wrote:
>
> > Fixes compilation on 64-bit platforms as pointers need a larger type.
>
> Not a good description...
>
> >
> > Change device_get_match_data to of variant. The data is obtained through
> > OF anyway.
> >
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
> > ---
> > drivers/gpio/gpio-realtek-otto.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpio/gpio-realtek-otto.c b/drivers/gpio/gpio-realtek-otto.c
> > index e6694d5d1696..e9c89b191989 100644
> > --- a/drivers/gpio/gpio-realtek-otto.c
> > +++ b/drivers/gpio/gpio-realtek-otto.c
> > @@ -360,7 +360,7 @@ static int realtek_gpio_probe(struct platform_device *pdev)
> > struct gpio_generic_chip_config config;
> > struct device *dev = &pdev->dev;
> > unsigned long gen_gc_flags;
> > - unsigned int dev_flags;
> > + unsigned long dev_flags;
>
> You don't need to change the type of the variable, just the cast.
Previous review was:
Just make dev_flags an unsigned long and cast
device_get_match_data(dev) to uintptr_t.
Bart
>
> David
>
> > struct gpio_irq_chip *girq;
> > struct realtek_gpio_ctrl *ctrl;
> > struct resource *res;
> > @@ -372,7 +372,7 @@ static int realtek_gpio_probe(struct platform_device *pdev)
> > if (!ctrl)
> > return -ENOMEM;
> >
> > - dev_flags = (unsigned int) device_get_match_data(dev);
> > + dev_flags = (unsigned long) of_device_get_match_data(dev);
> >
> > ngpios = REALTEK_GPIO_MAX;
> > of_property_read_u32(dev->of_node, "ngpios", &ngpios);
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gpio: realtek-otto: use unsigned long
2025-12-17 22:55 ` Rosen Penev
@ 2025-12-18 15:10 ` Bartosz Golaszewski
0 siblings, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2025-12-18 15:10 UTC (permalink / raw)
To: Rosen Penev; +Cc: David Laight, linux-gpio, Linus Walleij, open list
On Wed, Dec 17, 2025 at 11:55 PM Rosen Penev <rosenp@gmail.com> wrote:
>
> On Wed, Dec 17, 2025 at 2:52 PM David Laight
> <david.laight.linux@gmail.com> wrote:
> >
> > On Wed, 17 Dec 2025 12:23:31 -0800
> > Rosen Penev <rosenp@gmail.com> wrote:
> >
> > > Fixes compilation on 64-bit platforms as pointers need a larger type.
> >
> > Not a good description...
> >
> > >
> > > Change device_get_match_data to of variant. The data is obtained through
> > > OF anyway.
> > >
> > > Signed-off-by: Rosen Penev <rosenp@gmail.com>
> > > ---
> > > drivers/gpio/gpio-realtek-otto.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpio/gpio-realtek-otto.c b/drivers/gpio/gpio-realtek-otto.c
> > > index e6694d5d1696..e9c89b191989 100644
> > > --- a/drivers/gpio/gpio-realtek-otto.c
> > > +++ b/drivers/gpio/gpio-realtek-otto.c
> > > @@ -360,7 +360,7 @@ static int realtek_gpio_probe(struct platform_device *pdev)
> > > struct gpio_generic_chip_config config;
> > > struct device *dev = &pdev->dev;
> > > unsigned long gen_gc_flags;
> > > - unsigned int dev_flags;
> > > + unsigned long dev_flags;
> >
> > You don't need to change the type of the variable, just the cast.
> Previous review was:
>
> Just make dev_flags an unsigned long and cast
> device_get_match_data(dev) to uintptr_t.
>
And you still cast it to unsigned long instead. Nevermind, my tree is
broken now due to the warning from picking up the COMPILE_TEST=y patch
so I need to fix it. I'm queuing this as well with some changes to the
commit message and the cast.
Bart
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gpio: realtek-otto: use unsigned long
2025-12-17 20:23 [PATCH] gpio: realtek-otto: use unsigned long Rosen Penev
2025-12-17 22:52 ` David Laight
@ 2025-12-18 15:30 ` Bartosz Golaszewski
1 sibling, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2025-12-18 15:30 UTC (permalink / raw)
To: linux-gpio, Rosen Penev
Cc: Bartosz Golaszewski, Linus Walleij, Bartosz Golaszewski,
linux-kernel
On Wed, 17 Dec 2025 12:23:31 -0800, Rosen Penev wrote:
> Fixes compilation on 64-bit platforms as pointers need a larger type.
>
> Change device_get_match_data to of variant. The data is obtained through
> OF anyway.
>
>
Applied, thanks!
[1/1] gpio: realtek-otto: use unsigned long
commit: 47d8cb678081d12704d52ed42b625e96f38470e0
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-12-18 15:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-17 20:23 [PATCH] gpio: realtek-otto: use unsigned long Rosen Penev
2025-12-17 22:52 ` David Laight
2025-12-17 22:55 ` Rosen Penev
2025-12-18 15:10 ` Bartosz Golaszewski
2025-12-18 15:30 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).