783-v5.12-net-usb-r8152-use-new-tasklet-API.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From 90f1afc7f96c8f7cf19c82e5f4b39e61a63b053d Mon Sep 17 00:00:00 2001
  2. From: Emil Renner Berthing <[email protected]>
  3. Date: Sun, 31 Jan 2021 00:47:29 +0100
  4. Subject: [PATCH] net: usb: r8152: use new tasklet API
  5. commit f3163f1cb87141c7a41a15a5d4c98b353f807b04 upstream.
  6. This converts the driver to use the new tasklet API introduced in
  7. commit 12cc923f1ccc ("tasklet: Introduce new initialization API")
  8. Signed-off-by: Emil Renner Berthing <[email protected]>
  9. Signed-off-by: Jakub Kicinski <[email protected]>
  10. ---
  11. drivers/net/usb/r8152.c | 8 +++-----
  12. 1 file changed, 3 insertions(+), 5 deletions(-)
  13. --- a/drivers/net/usb/r8152.c
  14. +++ b/drivers/net/usb/r8152.c
  15. @@ -2395,11 +2395,9 @@ static void tx_bottom(struct r8152 *tp)
  16. } while (res == 0);
  17. }
  18. -static void bottom_half(unsigned long data)
  19. +static void bottom_half(struct tasklet_struct *t)
  20. {
  21. - struct r8152 *tp;
  22. -
  23. - tp = (struct r8152 *)data;
  24. + struct r8152 *tp = from_tasklet(tp, t, tx_tl);
  25. if (test_bit(RTL8152_UNPLUG, &tp->flags))
  26. return;
  27. @@ -6697,7 +6695,7 @@ static int rtl8152_probe(struct usb_inte
  28. mutex_init(&tp->control);
  29. INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t);
  30. INIT_DELAYED_WORK(&tp->hw_phy_work, rtl_hw_phy_work_func_t);
  31. - tasklet_init(&tp->tx_tl, bottom_half, (unsigned long)tp);
  32. + tasklet_setup(&tp->tx_tl, bottom_half);
  33. tasklet_disable(&tp->tx_tl);
  34. netdev->netdev_ops = &rtl8152_netdev_ops;