[bug report] phy: qcom: Introduce M31 USB PHY driver

Dan Carpenter dan.carpenter at linaro.org
Tue Feb 6 02:22:42 PST 2024


The patch 08e49af50701: "phy: qcom: Introduce M31 USB PHY driver"
from Aug 14, 2023 (linux-next), leads to the following Smatch static
checker warning:

	drivers/phy/qualcomm/phy-qcom-m31.c:302 m31usb_phy_probe()
	warn: passing zero to 'PTR_ERR'

drivers/phy/qualcomm/phy-qcom-m31.c
    294 
    295         qphy->phy = devm_phy_create(dev, NULL, &m31usb_phy_gen_ops);
    296         if (IS_ERR(qphy->phy))
    297                 return dev_err_probe(dev, PTR_ERR(qphy->phy),
    298                                      "failed to create phy\n");
    299 
    300         qphy->vreg = devm_regulator_get(dev, "vdda-phy");
    301         if (IS_ERR(qphy->vreg))
--> 302                 return dev_err_probe(dev, PTR_ERR(qphy->phy),
                                                                ^^^
This should have been "qphy->vreg".

    303                                      "failed to get vreg\n");
    304 

I can't work out what happened here.

This was fixed in commit 5f7cd740a6b6 ("phy: qcom: phy-qcom-m31: fix
wrong pointer pass to PTR_ERR()") but somehow it got changed back.  I've
looked at the git log and I don't see how that happened...

regards,
dan carpenter



More information about the linux-phy mailing list