From: Prathamesh Shete Date: Wed, 7 Jun 2023 11:31:04 +0000 (+0530) Subject: gpio: tegra186: Check PMC driver status before any request X-Git-Tag: v6.6.17~4504^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5cc9525bfc8e32029d1339349d65873c42193b00;p=platform%2Fkernel%2Flinux-rpi.git 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. Signed-off-by: Manish Bhardwaj Signed-off-by: Prathamesh Shete Reviewed-by: Jon Hunter Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20230607113104.11761-1-pshete@nvidia.com Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c index b904de0..ea13a90 100644 --- a/drivers/gpio/gpio-tegra186.c +++ b/drivers/gpio/gpio-tegra186.c @@ -894,11 +894,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,