]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
can: c_can: Drop useless final probe failure message
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Wed, 12 Feb 2025 20:23:12 +0000 (21:23 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 19 Feb 2025 09:44:20 +0000 (10:44 +0100)
Generic probe failure message is useless: does not give information what
failed and it duplicates messages provided by the core, e.g. from memory
allocation or platform_get_irq().  It also floods dmesg in case of
deferred probe, e.g. resulting from devm_clk_get().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://patch.msgid.link/20250212-syscon-phandle-args-can-v2-1-ac9a1253396b@linaro.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/c_can/c_can_platform.c

index 399844809bbeaad42e19b4003b85fc487b01d336..8968b6288ac7adc54894f09efbd869c950cce4bf 100644 (file)
@@ -269,30 +269,22 @@ static int c_can_plat_probe(struct platform_device *pdev)
 
        /* get the appropriate clk */
        clk = devm_clk_get(&pdev->dev, NULL);
-       if (IS_ERR(clk)) {
-               ret = PTR_ERR(clk);
-               goto exit;
-       }
+       if (IS_ERR(clk))
+               return PTR_ERR(clk);
 
        /* get the platform data */
        irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               ret = irq;
-               goto exit;
-       }
+       if (irq < 0)
+               return irq;
 
        addr = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
-       if (IS_ERR(addr)) {
-               ret =  PTR_ERR(addr);
-               goto exit;
-       }
+       if (IS_ERR(addr))
+               return PTR_ERR(addr);
 
        /* allocate the c_can device */
        dev = alloc_c_can_dev(drvdata->msg_obj_num);
-       if (!dev) {
-               ret = -ENOMEM;
-               goto exit;
-       }
+       if (!dev)
+               return -ENOMEM;
 
        priv = netdev_priv(dev);
        switch (drvdata->id) {
@@ -396,8 +388,6 @@ exit_pm_runtime:
        pm_runtime_disable(priv->device);
 exit_free_device:
        free_c_can_dev(dev);
-exit:
-       dev_err(&pdev->dev, "probe failed\n");
 
        return ret;
 }