phy: bcm-ns-usb2: improve printing ref clk errors
authorRafał Miłecki <rafal@milecki.pl>
Tue, 23 Nov 2021 22:15:21 +0000 (23:15 +0100)
committerVinod Koul <vkoul@kernel.org>
Thu, 25 Nov 2021 05:15:04 +0000 (10:45 +0530)
Improve message & use dev_err_probe() helper which prints actual error
(helpful for debugging) and deals with -EPROBE_DEFER.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20211123221521.25323-1-zajec5@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/broadcom/phy-bcm-ns-usb2.c

index 98d32729a45df453b3f98976e56aaf3540974d29..6a36e187d100d9b1c52730ed54ededa9dccd6cbd 100644 (file)
@@ -132,7 +132,7 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
 
        usb2->ref_clk = devm_clk_get(dev, "phy-ref-clk");
        if (IS_ERR(usb2->ref_clk)) {
-               dev_err(dev, "Clock not defined\n");
+               dev_err_probe(dev, PTR_ERR(usb2->ref_clk), "failed to get ref clk\n");
                return PTR_ERR(usb2->ref_clk);
        }