Skip to contentSkip to conversation

firmware: tegra: set drvdata earlier

PATCH Applied Timo Alho 2 participants 2 messages Aug 17, 2017 Tegra architecture support

lore
Share & tools
lore

Timo Alho

author
#0 lore raw

PATCH 1/1 firmware: tegra: set drvdata earlier

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.

---
 drivers/firmware/tegra/bpmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/tegra/bpmp.c +2 -2
index b251795..73ca55b 100644
@@ -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:
Signature · 1 line
2.7.4
#1 lore raw
Quoted 9 lines · Timo Alho

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.

---
 drivers/firmware/tegra/bpmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied to for-4.14/firmware, thanks.

Thierry