]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: realtek-otto: use larger type for dev_flags
authorRosen Penev <rosenp@gmail.com>
Wed, 17 Dec 2025 20:23:31 +0000 (12:23 -0800)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Thu, 18 Dec 2025 15:24:32 +0000 (16:24 +0100)
Fix a build failure on 64-bit systems uncovered by enabling
COMPILE_TEST:

drivers/gpio/gpio-realtek-otto.c: In function ‘realtek_gpio_probe’:
drivers/gpio/gpio-realtek-otto.c:375:21: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
  375 |         dev_flags = (unsigned int) device_get_match_data(dev);
      |                     ^

Fixes: 3203d8f573af ("gpio: realtek-otto: add COMPILE_TEST")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512180532.2ykNwYAm-lkp@intel.com/
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://lore.kernel.org/r/20251217202331.9449-1-rosenp@gmail.com
[Bartosz: tweaked commit message, changed the cast, added tags]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-realtek-otto.c

index de527f4fc6c2ad770015685b8b5c822afd5493f0..4cf91528f547e4d750d4763d85c2c99ab8d2c0be 100644 (file)
@@ -359,8 +359,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 gen_gc_flags, dev_flags;
        struct gpio_irq_chip *girq;
        struct realtek_gpio_ctrl *ctrl;
        struct resource *res;
@@ -372,7 +371,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 = (uintptr_t)device_get_match_data(dev);
 
        ngpios = REALTEK_GPIO_MAX;
        device_property_read_u32(dev, "ngpios", &ngpios);