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>
{
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;
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);