Skip to contentSkip to conversation

usb: hcd: convert tasklets to use new tasklet_setup() API

PATCH In review Andy Shevchenko 3 participants 3 messages Aug 19, 2020 – Aug 28, 2020 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: hcd: convert tasklets to use new tasklet_setup() API

In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.

---
 drivers/usb/core/hcd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/core/hcd.c +3 -3
index a33b849e8beb..2c6b9578a7d3 100644
@@ -1657,9 +1657,9 @@ static void __usb_hcd_giveback_urb(struct urb *urb)
 	usb_put_urb(urb);
 }
 
-static void usb_giveback_urb_bh(unsigned long param)
+static void usb_giveback_urb_bh(struct tasklet_struct *t)
 {
-	struct giveback_urb_bh *bh = (struct giveback_urb_bh *)param;
+	struct giveback_urb_bh *bh = from_tasklet(bh, t, bh);
 	struct list_head local_list;
 
 	spin_lock_irq(&bh->lock);
@@ -2403,7 +2403,7 @@ static void init_giveback_urb_bh(struct giveback_urb_bh *bh)
 
 	spin_lock_init(&bh->lock);
 	INIT_LIST_HEAD(&bh->head);
-	tasklet_init(&bh->bh, usb_giveback_urb_bh, (unsigned long)bh);
+	tasklet_setup(&bh->bh, usb_giveback_urb_bh);
 }
 
 struct usb_hcd *__usb_create_hcd(const struct hc_driver *driver,
Signature · 1 line
2.28.0
#1 lore raw
Quoted 5 lines · Andy Shevchenko

In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.

Does not apply to my tree as I think someone already did all of these conversions.

thanks,

greg k-h

#2 lore raw
Quoted 10 lines · Greg Kroah-Hartman
Quoted 5 lines · Andy Shevchenko

In preparation for unconditionally passing the struct tasklet_struct pointer to all tasklet callbacks, switch to using the new tasklet_setup() and from_tasklet() to pass the tasklet pointer explicitly.

Does not apply to my tree as I think someone already did all of these conversions.

Yes, that is the case.

Signature · 2 lines
With Best Regards,
Andy Shevchenko