gpio: tegra186: fix resource handling in ACPI probe path
Subsystems (3)
PATCH v2 1/1 gpio: tegra186: fix resource handling in ACPI probe path
When the Tegra186 GPIO controller is probed through ACPI matching, the driver emits two error messages during probing:
"tegra186-gpio NVDA0508:00: invalid resource (null)" "tegra186-gpio NVDA0508:00: invalid resource (null)"
Fix this by getting resource first and then do the ioremap.
---
Changes from v1 to v2:
- Add "Fixes" to commit body.
drivers/gpio/gpio-tegra186.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-)
drivers/gpio/gpio-tegra186.c +14 -13
@@ -823,6 +823,7 @@ static int tegra186_gpio_probe(struct platform_device *pdev)struct gpio_irq_chip *irq;struct tegra_gpio *gpio;struct device_node *np; +struct resource *res;char **names;int err;
@@ -842,19 +843,19 @@ static int tegra186_gpio_probe(struct platform_device *pdev) gpio->num_banks++;/* get register apertures */ - gpio->secure =devm_platform_ioremap_resource_byname (pdev,"security" ); -if (IS_ERR (gpio->secure)) { - gpio->secure =devm_platform_ioremap_resource (pdev,0 ); -if (IS_ERR (gpio->secure)) -return PTR_ERR (gpio->secure); - } - - gpio->base =devm_platform_ioremap_resource_byname (pdev,"gpio" ); -if (IS_ERR (gpio->base)) { - gpio->base =devm_platform_ioremap_resource (pdev,1 ); -if (IS_ERR (gpio->base)) -return PTR_ERR (gpio->base); - } + res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"security" ); +if (!res) + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); + gpio->secure =devm_ioremap_resource (&pdev->dev, res); +if (IS_ERR (gpio->secure)) +return PTR_ERR (gpio->secure); + + res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"gpio" ); +if (!res) + res =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); + gpio->base =devm_ioremap_resource (&pdev->dev, res); +if (IS_ERR (gpio->base)) +return PTR_ERR (gpio->base); err =platform_irq_count (pdev);if (err <0 )
Signature · 1 line
2.43.0
Please igore this one, sorry for the troble.
Best Regards,
Guixin Liu
Quoted 61 lines · Guixin Liu
When the Tegra186 GPIO controller is probed through ACPI matching, the driver emits two error messages during probing:
"tegra186-gpio NVDA0508:00: invalid resource (null)" "tegra186-gpio NVDA0508:00: invalid resource (null)"Fix this by getting resource first and then do the ioremap.
Fixes 2606e7c9f5fc ("gpio: tegra186: Add ACPI support")Signed-off-by Guixin Liu <[email protected]>---
Changes from v1 to v2:
- Add "Fixes" to commit body.drivers/gpio/gpio-tegra186.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-)drivers/gpio/gpio-tegra186.c +14
-13@@ -823,6 +823,7 @@ static int tegra186_gpio_probe(struct platform_device *pdev)struct gpio_irq_chip *irq;struct tegra_gpio *gpio;struct device_node *np; +struct resource *res;char **names;int err;@@ -842,19 +843,19 @@ static int tegra186_gpio_probe(struct platform_device *pdev) gpio->num_banks++;/* get register apertures */ - gpio->secure =devm_platform_ioremap_resource_byname (pdev,"security" ); -if (IS_ERR (gpio->secure)) { - gpio->secure =devm_platform_ioremap_resource (pdev,0 ); -if (IS_ERR (gpio->secure)) -return PTR_ERR (gpio->secure); - } - - gpio->base =devm_platform_ioremap_resource_byname (pdev,"gpio" ); -if (IS_ERR (gpio->base)) { - gpio->base =devm_platform_ioremap_resource (pdev,1 ); -if (IS_ERR (gpio->base)) -return PTR_ERR (gpio->base); - } + res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"security" ); +if (!res) + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); + gpio->secure =devm_ioremap_resource (&pdev->dev, res); +if (IS_ERR (gpio->secure)) +return PTR_ERR (gpio->secure); + + res =platform_get_resource_byname (pdev,IORESOURCE_MEM ,"gpio" ); +if (!res) + res =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); + gpio->base =devm_ioremap_resource (&pdev->dev, res); +if (IS_ERR (gpio->base)) +return PTR_ERR (gpio->base); err =platform_irq_count (pdev);if (err <0 )
kernel test robot
build botFYI: kernel test robot notices the stable kernel rule is not satisfied.
Hi,
Thanks for your patch.
FYI: kernel test robot notices the stable kernel rule is not satisfied.
The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1
Rule: add the tag "Cc: [email protected]" in the sign-off area to have the patch automatically included in the stable tree.
Subject: [PATCH v2] gpio: tegra186: fix resource handling in ACPI probe path
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki