OSDN Git Service

can: xilinx_can: skip error message on deferred probe
authorVenkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Mon, 2 Dec 2019 13:02:10 +0000 (18:32 +0530)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 3 Dec 2019 10:15:08 +0000 (11:15 +0100)
When the CAN bus clock is provided from the clock wizard, clock wizard
driver may not be available when can driver probes resulting to the
error message "bus clock not found error".

As this error message is not very useful to the end user, skip printing
in the case of deferred probe.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@xilinx.com>
Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Appana Durga Kedareswara Rao <appana.durga.rao@xilinx.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/xilinx_can.c

index 4a96e2d..c5f05b9 100644 (file)
@@ -1772,7 +1772,8 @@ static int xcan_probe(struct platform_device *pdev)
 
        priv->bus_clk = devm_clk_get(&pdev->dev, devtype->bus_clk_name);
        if (IS_ERR(priv->bus_clk)) {
-               dev_err(&pdev->dev, "bus clock not found\n");
+               if (PTR_ERR(priv->bus_clk) != -EPROBE_DEFER)
+                       dev_err(&pdev->dev, "bus clock not found\n");
                ret = PTR_ERR(priv->bus_clk);
                goto err_free;
        }