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