firmware: tegra: set drvdata earlier
authorTimo Alho <talho@nvidia.com>
Thu, 17 Aug 2017 09:49:11 +0000 (12:49 +0300)
committerThierry Reding <treding@nvidia.com>
Thu, 17 Aug 2017 11:08:08 +0000 (13:08 +0200)
Subdevices of bpmp, such as bpmp-i2c, require the bpmp device's
drvdata to be set during their probe. Currently this is not always the
case. Fix this by calling platform_set_drvdata() earlier during bpmp's
probe.

Signed-off-by: Timo Alho <talho@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/firmware/tegra/bpmp.c

index b251795..73ca55b 100644 (file)
@@ -806,6 +806,8 @@ static int tegra_bpmp_probe(struct platform_device *pdev)
 
        dev_info(&pdev->dev, "firmware: %s\n", tag);
 
+       platform_set_drvdata(pdev, bpmp);
+
        err = of_platform_default_populate(pdev->dev.of_node, NULL, &pdev->dev);
        if (err < 0)
                goto free_mrq;
@@ -822,8 +824,6 @@ static int tegra_bpmp_probe(struct platform_device *pdev)
        if (err < 0)
                goto free_mrq;
 
-       platform_set_drvdata(pdev, bpmp);
-
        return 0;
 
 free_mrq: