]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commitdiff
thermal: max77620: read irq from platform resource
authorJeetesh Burman <jburman@nvidia.com>
Thu, 16 Jun 2016 09:13:39 +0000 (14:43 +0530)
committerLaxman Dewangan <ldewangan@nvidia.com>
Fri, 17 Jun 2016 12:04:34 +0000 (05:04 -0700)
If device OF node is available then interrupt is read from DT node
but for thermal sub module, mfd device add interrupt as platform
resource. Therefore, initialize of_node pointer of thermal device
after reading interrupt from platform resource.

Bug 200204825

Change-Id: If0fa3337e6b8488134d72814ab10205a92f8b9e9
Signed-off-by: Jeetesh Burman <jburman@nvidia.com>
Reviewed-on: http://git-master/r/1165665
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/thermal/thermal-max77620.c

index 5fba00f6e19fcfd99e0df334cd95fb3932349940..ff45f8568203523274926b38b8dde0ad94567e44 100644 (file)
@@ -77,7 +77,6 @@ static int max77620_thermal_probe(struct platform_device *pdev)
        struct max77620_therm_info *mtherm;
        int ret;
 
-       pdev->dev.of_node = pdev->dev.parent->of_node;
 
        mtherm = devm_kzalloc(&pdev->dev, sizeof(*mtherm), GFP_KERNEL);
        if (!mtherm)
@@ -89,6 +88,7 @@ static int max77620_thermal_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "Alarm irq number not available\n");
                return -EINVAL;
        }
+       pdev->dev.of_node = pdev->dev.parent->of_node;
 
        mtherm->dev = &pdev->dev;
        mtherm->rmap = dev_get_regmap(pdev->dev.parent, NULL);