Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: mxc: remove dead code after switch to DT-only

struct platform_device::id was only set by board code, but since i.MX
became a devicetree-only platform, this will always be -1
(PLATFORM_DEVID_NONE).

Note: of_alias_get_id() returns a negative number on error and base
treats all negative errors the same, so we need not add any additional
error handling.

Fixes: 0f2c7af45d7e ("gpio: mxc: Convert the driver to DT-only")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20250113-b4-imx-gpio-base-warning-v1-3-0a28731a5cf6@pengutronix.de
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Ahmad Fatoum and committed by
Bartosz Golaszewski
b049e7ab 4abae5b6

+1 -2
+1 -2
drivers/gpio/gpio-mxc.c
··· 490 490 port->gc.request = mxc_gpio_request; 491 491 port->gc.free = mxc_gpio_free; 492 492 port->gc.to_irq = mxc_gpio_to_irq; 493 - port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 : 494 - pdev->id * 32; 493 + port->gc.base = of_alias_get_id(np, "gpio") * 32; 495 494 496 495 err = devm_gpiochip_add_data(&pdev->dev, &port->gc, port); 497 496 if (err)