From: Venkatesh Yadav Abbarapu <[email protected]>
When can 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 <[email protected]>
Signed-off-by: Srinivas Neeli <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
---
drivers/net/can/xilinx_can.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 4a96e2dd7d77..c5f05b994435 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -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;
}
--
2.7.4
On 11/20/19 1:11 PM, Srinivas Neeli wrote:
> From: Venkatesh Yadav Abbarapu <[email protected]>
>
> When can clock is provided from the clock wizard, clock wizard driver
^^^
The code looks like the "bus" clock is probed here, not the "can" clock.
> 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 <[email protected]>
> Signed-off-by: Srinivas Neeli <[email protected]>
> Signed-off-by: Michal Simek <[email protected]>
> ---
> drivers/net/can/xilinx_can.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
> index 4a96e2dd7d77..c5f05b994435 100644
> --- a/drivers/net/can/xilinx_can.c
> +++ b/drivers/net/can/xilinx_can.c
> @@ -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;
> }
>
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Hi,
> -----Original Message-----
> From: Srinivas Neeli <[email protected]>
> Sent: Wednesday, November 20, 2019 5:41 PM
> To: [email protected]; [email protected]; [email protected];
> Michal Simek <[email protected]>; Appana Durga Kedareswara Rao
> <[email protected]>
> Cc: [email protected]; [email protected]; linux-arm-
> [email protected]; [email protected]; git
> <[email protected]>; Naga Sureshkumar Relli <[email protected]>;
> Venkatesh Yadav Abbarapu <[email protected]>; Srinivas Neeli
> <[email protected]>
> Subject: [PATCH 1/2] can: xilinx_can: skip error message on deferred probe
>
> From: Venkatesh Yadav Abbarapu <[email protected]>
>
> When can 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 <[email protected]>
> Signed-off-by: Srinivas Neeli <[email protected]>
> Signed-off-by: Michal Simek <[email protected]>
@Srinivas Neeli: Please send v2 with improved commit message as Marc suggested, feel free to add
Reviewed-by: Appana Durga Kedareswara Rao <[email protected]> in v2.
Regards,
Kedar.
> ---
> drivers/net/can/xilinx_can.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c index
> 4a96e2dd7d77..c5f05b994435 100644
> --- a/drivers/net/can/xilinx_can.c
> +++ b/drivers/net/can/xilinx_can.c
> @@ -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;
> }
> --
> 2.7.4