gpio: tegra186: Check PMC driver status before any request
Subsystems (2)
PATCH 1/1 gpio: tegra186: Check PMC driver status before any request
This patch fixes the issue where even if PMC driver status is disabled still we are trying to look up for the IRQ domain that PMC driver would've registered if it had been enabled.
--- drivers/gpio/gpio-tegra186.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/gpio/gpio-tegra186.c +9 -5
@@ -964,11 +964,15 @@ static int tegra186_gpio_probe(struct platform_device *pdev) np =of_find_matching_node (NULL , tegra186_pmc_of_match);if (np) { - irq->parent_domain =irq_find_host (np); -of_node_put (np); - -if (!irq->parent_domain) -return -EPROBE_DEFER ; +if (of_device_is_available (np)) { + irq->parent_domain =irq_find_host (np); +of_node_put (np); + +if (!irq->parent_domain) +return -EPROBE_DEFER ; + }else { +of_node_put (np); + } } irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,
Signature · 1 line
2.17.1
Quoted 3 lines · Prathamesh Shete
This patch fixes the issue where even if PMC driver status is disabled still we are trying to look up for the IRQ domain that PMC driver would've registered if it had been enabled.
It might be clearer to say ...
When the PMC device is disabled, probing of the Tegra186 GPIO driver fails because the IRQ domain that is registered by the PMC driver is not found. Fix this by checking to see if the PMC device is enabled before attempting to lookup the IRQ domain registered by the PMC.
Otherwise ...
Quoted 31 lines
Signed-off-by Manish Bhardwaj <[email protected]>Signed-off-by Prathamesh Shete <[email protected]>--- drivers/gpio/gpio-tegra186.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)drivers/gpio/gpio-tegra186.c +9
-5@@ -964,11 +964,15 @@ static int tegra186_gpio_probe(struct platform_device *pdev) np =of_find_matching_node (NULL , tegra186_pmc_of_match);if (np) { - irq->parent_domain =irq_find_host (np); -of_node_put (np); - -if (!irq->parent_domain) -return -EPROBE_DEFER ; +if (of_device_is_available (np)) { + irq->parent_domain =irq_find_host (np); +of_node_put (np); + +if (!irq->parent_domain) +return -EPROBE_DEFER ; + }else { +of_node_put (np); + } } irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,
Signature · 1 line
nvpublic
Jon Hunter
maintainerQuoted 9 lines · Jon Hunter
Quoted 3 lines · Prathamesh Shete
This patch fixes the issue where even if PMC driver status is disabled still we are trying to look up for the IRQ domain that PMC driver would've registered if it had been enabled.
It might be clearer to say ...
When the PMC device is disabled, probing of the Tegra186 GPIO driver fails because the IRQ domain that is registered by the PMC driver is not found. Fix this by checking to see if the PMC device is enabled before attempting to lookup the IRQ domain registered by the PMC.
It could also be worth noting that it is OK to skip the PMC IRQ domain in this case because this only impacts wake-ups and not GPIO functionality in general.
Jon
Signature · 1 line
nvpublic
PATCH v2 1/1 gpio: tegra186: Check PMC driver status before any request
When the PMC device is disabled, probing of the Tegra186 GPIO driver fails because the IRQ domain that is registered by the PMC driver is not found. The PMC IRQ domain is only used for wake-up and does not impact GPIO functionality in general. Therefore, if the PMC device is disabled, skip looking up the PMC IRQ domain to allow the GPIO driver to be probed.
--- drivers/gpio/gpio-tegra186.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/gpio/gpio-tegra186.c +9 -5
@@ -964,11 +964,15 @@ static int tegra186_gpio_probe(struct platform_device *pdev) np =of_find_matching_node (NULL , tegra186_pmc_of_match);if (np) { - irq->parent_domain =irq_find_host (np); -of_node_put (np); - -if (!irq->parent_domain) -return -EPROBE_DEFER ; +if (of_device_is_available (np)) { + irq->parent_domain =irq_find_host (np); +of_node_put (np); + +if (!irq->parent_domain) +return -EPROBE_DEFER ; + }else { +of_node_put (np); + } } irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,
Signature · 1 line
2.17.1
Quoted 28 lines · Prathamesh Shete
When the PMC device is disabled, probing of the Tegra186 GPIO driver fails because the IRQ domain that is registered by the PMC driver is not found. The PMC IRQ domain is only used for wake-up and does not impact GPIO functionality in general. Therefore, if the PMC device is disabled, skip looking up the PMC IRQ domain to allow the GPIO driver to be probed.
Signed-off-by Manish Bhardwaj <[email protected]>Signed-off-by Prathamesh Shete <[email protected]>--- drivers/gpio/gpio-tegra186.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)drivers/gpio/gpio-tegra186.c +2
-5@@ -964,11 +964,15 @@ static int tegra186_gpio_probe(struct platform_device *pdev) np =of_find_matching_node (NULL , tegra186_pmc_of_match);if (np) { - irq->parent_domain =irq_find_host (np); -of_node_put (np); - -if (!irq->parent_domain) -return -EPROBE_DEFER ; +if (of_device_is_available (np)) { + irq->parent_domain =irq_find_host (np);
drivers/gpio/gpio-tegra186.c static int tegra186_gpio_probe(struct platform_device *pdev) · line 978
Quoted 10 lines
drivers/gpio/gpio-tegra186.c +7
-0+of_node_put (np); + +if (!irq->parent_domain) +return -EPROBE_DEFER ; + }else { +of_node_put (np); + } } irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,
Thanks!
Jon
Signature · 1 line
nvpublic
Quoted 7 lines · Prathamesh Shete
When the PMC device is disabled, probing of the Tegra186 GPIO driver fails because the IRQ domain that is registered by the PMC driver is not found. The PMC IRQ domain is only used for wake-up and does not impact GPIO functionality in general. Therefore, if the PMC device is disabled, skip looking up the PMC IRQ domain to allow the GPIO driver to be probed.
Quoted 5 lines
Signed-off-by Manish Bhardwaj <[email protected]>Signed-off-by Prathamesh Shete <[email protected]>--- drivers/gpio/gpio-tegra186.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
Tue, Jun 06, 2023 at 12:47:17PM +0530, Prathamesh Shete kirjoitti:
Quoted 3 lines
This patch fixes the issue where even if PMC driver status is disabled still we are trying to look up for the IRQ domain that PMC driver would've registered if it had been enabled.
-ENOPARSE.
Also mind grammar punctuation.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 6 lines · Prathamesh Shete
This patch fixes the issue where even if PMC driver status is disabled still we are trying to look up for the IRQ domain that PMC driver would've registered if it had been enabled.
Signed-off-by Manish Bhardwaj <[email protected]>Signed-off-by Prathamesh Shete <[email protected]>
Patch applied!
Yours,
Linus Walleij