Patch "can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready" has been added to the 4.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     can-rcar_canfd-rcar_canfd_channel_probe-register-the.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2797afc90fc4856447c2afabf17f8cdd58992869
Author: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
Date:   Mon Feb 21 22:59:35 2022 +0000

    can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready
    
    [ Upstream commit c5048a7b2c23ab589f3476a783bd586b663eda5b ]
    
    Register the CAN device only when all the necessary initialization is
    completed. This patch makes sure all the data structures and locks are
    initialized before registering the CAN device.
    
    Link: https://lore.kernel.org/all/20220221225935.12300-1-prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx
    Reported-by: Pavel Machek <pavel@xxxxxxx>
    Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
    Reviewed-by: Pavel Machek <pavel@xxxxxxx>
    Reviewed-by: Ulrich Hecht <uli+renesas@xxxxxxxx>
    Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
index 43cdd5544b0c..a127c853a4e9 100644
--- a/drivers/net/can/rcar/rcar_canfd.c
+++ b/drivers/net/can/rcar/rcar_canfd.c
@@ -1601,15 +1601,15 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
 
 	netif_napi_add(ndev, &priv->napi, rcar_canfd_rx_poll,
 		       RCANFD_NAPI_WEIGHT);
+	spin_lock_init(&priv->tx_lock);
+	devm_can_led_init(ndev);
+	gpriv->ch[priv->channel] = priv;
 	err = register_candev(ndev);
 	if (err) {
 		dev_err(&pdev->dev,
 			"register_candev() failed, error %d\n", err);
 		goto fail_candev;
 	}
-	spin_lock_init(&priv->tx_lock);
-	devm_can_led_init(ndev);
-	gpriv->ch[priv->channel] = priv;
 	dev_info(&pdev->dev, "device registered (channel %u)\n", priv->channel);
 	return 0;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux