net: can: mttcan: Fix build for Linux v5.19

When compiling the MTTCAN driver for Linux v5.19 the build fails because
the can_led_xxx() functions are not found. The can_led_xxx() functions
were removed for Linux v5.19 and not Linux 6.0 and so update the driver
accordingly to fix this.

Bug 3820317

Change-Id: I340cc9cbb44b5cb892c50cc0b5d06444ef894fe9
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2792549
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2022-10-15 14:43:59 +01:00
committed by mobile promotions
parent 7125981c99
commit 1cb49e59a3

View File

@@ -617,7 +617,7 @@ static void mttcan_tx_complete(struct net_device *dev)
while (completed_tx) { while (completed_tx) {
msg_no = ffs(completed_tx) - 1; msg_no = ffs(completed_tx) - 1;
can_get_echo_skb(dev, msg_no, NULL); can_get_echo_skb(dev, msg_no, NULL);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,0,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0)
can_led_event(dev, CAN_LED_EVENT_TX); can_led_event(dev, CAN_LED_EVENT_TX);
#endif #endif
clear_bit(msg_no, &ttcan->tx_object); clear_bit(msg_no, &ttcan->tx_object);
@@ -1309,7 +1309,7 @@ static int mttcan_open(struct net_device *dev)
} }
napi_enable(&priv->napi); napi_enable(&priv->napi);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,0,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0)
can_led_event(dev, CAN_LED_EVENT_OPEN); can_led_event(dev, CAN_LED_EVENT_OPEN);
#endif #endif
@@ -1338,7 +1338,7 @@ static int mttcan_close(struct net_device *dev)
mttcan_power_down(dev); mttcan_power_down(dev);
mttcan_pm_runtime_put_sync(priv); mttcan_pm_runtime_put_sync(priv);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,0,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0)
can_led_event(dev, CAN_LED_EVENT_STOP); can_led_event(dev, CAN_LED_EVENT_STOP);
#endif #endif
return 0; return 0;
@@ -1539,7 +1539,7 @@ static int register_mttcan_dev(struct net_device *dev)
dev->netdev_ops = &mttcan_netdev_ops; dev->netdev_ops = &mttcan_netdev_ops;
err = register_candev(dev); err = register_candev(dev);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,0,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0)
if (!err) if (!err)
devm_can_led_init(dev); devm_can_led_init(dev);
#endif #endif