Commit c05c932a authored by Allen Pais's avatar Allen Pais Committed by Greg Kroah-Hartman

usb: atm: 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.
Signed-off-by: default avatarRomain Perier <romain.perier@gmail.com>
Signed-off-by: default avatarAllen Pais <allen.lkml@gmail.com>
Link: https://lore.kernel.org/r/20200817090209.26351-2-allen.cryptic@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fbc29943
...@@ -511,9 +511,10 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance, ...@@ -511,9 +511,10 @@ static unsigned int usbatm_write_cells(struct usbatm_data *instance,
** receive ** ** receive **
**************/ **************/
static void usbatm_rx_process(unsigned long data) static void usbatm_rx_process(struct tasklet_struct *t)
{ {
struct usbatm_data *instance = (struct usbatm_data *)data; struct usbatm_data *instance = from_tasklet(instance, t,
rx_channel.tasklet);
struct urb *urb; struct urb *urb;
while ((urb = usbatm_pop_urb(&instance->rx_channel))) { while ((urb = usbatm_pop_urb(&instance->rx_channel))) {
...@@ -564,9 +565,10 @@ static void usbatm_rx_process(unsigned long data) ...@@ -564,9 +565,10 @@ static void usbatm_rx_process(unsigned long data)
** send ** ** send **
***********/ ***********/
static void usbatm_tx_process(unsigned long data) static void usbatm_tx_process(struct tasklet_struct *t)
{ {
struct usbatm_data *instance = (struct usbatm_data *)data; struct usbatm_data *instance = from_tasklet(instance, t,
tx_channel.tasklet);
struct sk_buff *skb = instance->current_skb; struct sk_buff *skb = instance->current_skb;
struct urb *urb = NULL; struct urb *urb = NULL;
const unsigned int buf_size = instance->tx_channel.buf_size; const unsigned int buf_size = instance->tx_channel.buf_size;
...@@ -1069,8 +1071,8 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id, ...@@ -1069,8 +1071,8 @@ int usbatm_usb_probe(struct usb_interface *intf, const struct usb_device_id *id,
usbatm_init_channel(&instance->rx_channel); usbatm_init_channel(&instance->rx_channel);
usbatm_init_channel(&instance->tx_channel); usbatm_init_channel(&instance->tx_channel);
tasklet_init(&instance->rx_channel.tasklet, usbatm_rx_process, (unsigned long)instance); tasklet_setup(&instance->rx_channel.tasklet, usbatm_rx_process);
tasklet_init(&instance->tx_channel.tasklet, usbatm_tx_process, (unsigned long)instance); tasklet_setup(&instance->tx_channel.tasklet, usbatm_tx_process);
instance->rx_channel.stride = ATM_CELL_SIZE + driver->rx_padding; instance->rx_channel.stride = ATM_CELL_SIZE + driver->rx_padding;
instance->tx_channel.stride = ATM_CELL_SIZE + driver->tx_padding; instance->tx_channel.stride = ATM_CELL_SIZE + driver->tx_padding;
instance->rx_channel.usbatm = instance->tx_channel.usbatm = instance; instance->rx_channel.usbatm = instance->tx_channel.usbatm = instance;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment