Skip to content

Commit 1dd196f

Browse files
jhovoldvinodkoul
authored andcommitted
phy: qcom: qmp-combo: move driver data initialisation earlier
Commit 44aff8e ("phy: qcom-qmp-combo: clean up probe initialisation") removed most users of the platform device driver data, but mistakenly also removed the initialisation despite the data still being used in the runtime PM callbacks. The initialisation was soon after restored by commit 83a0bbe ("phy: qcom-qmp-combo: add support for updated sc8280xp binding") but now happens slightly later during probe. This should not cause any trouble currently as runtime PM needs to be enabled manually through sysfs and the platform device would not be suspended before the PHY has been registered anyway. Move the driver data initialisation to avoid a NULL-pointer dereference on runtime suspend if runtime PM is ever enabled by default in this driver. Fixes: 44aff8e ("phy: qcom-qmp-combo: clean up probe initialisation") Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20240911115253.10920-5-johan+linaro@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 34c21f9 commit 1dd196f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/phy/qualcomm/phy-qcom-qmp-combo.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3673,6 +3673,7 @@ static int qmp_combo_probe(struct platform_device *pdev)
36733673
return -ENOMEM;
36743674

36753675
qmp->dev = dev;
3676+
dev_set_drvdata(dev, qmp);
36763677

36773678
qmp->orientation = TYPEC_ORIENTATION_NORMAL;
36783679

@@ -3749,8 +3750,6 @@ static int qmp_combo_probe(struct platform_device *pdev)
37493750

37503751
phy_set_drvdata(qmp->dp_phy, qmp);
37513752

3752-
dev_set_drvdata(dev, qmp);
3753-
37543753
if (usb_np == dev->of_node)
37553754
phy_provider = devm_of_phy_provider_register(dev, qmp_combo_phy_xlate);
37563755
else

0 commit comments

Comments
 (0)