Commit 7c2bb7af authored by Binoy Jayan's avatar Binoy Jayan Committed by Greg Kroah-Hartman

rtl8712: intf_priv: Replace semaphore lock with completion

The semaphore 'lock' in 'intf_priv' is used as completion,
so convert it to a struct completion type.
Signed-off-by: default avatarBinoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Tested-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 204a8ac1
...@@ -36,7 +36,7 @@ struct intf_priv { ...@@ -36,7 +36,7 @@ struct intf_priv {
/* when in USB, IO is through interrupt in/out endpoints */ /* when in USB, IO is through interrupt in/out endpoints */
struct usb_device *udev; struct usb_device *udev;
struct urb *piorw_urb; struct urb *piorw_urb;
struct semaphore io_retevt; struct completion io_retevt_comp;
}; };
int r871x_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); int r871x_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
......
...@@ -50,7 +50,7 @@ uint r8712_usb_init_intf_priv(struct intf_priv *pintfpriv) ...@@ -50,7 +50,7 @@ uint r8712_usb_init_intf_priv(struct intf_priv *pintfpriv)
pintfpriv->piorw_urb = usb_alloc_urb(0, GFP_ATOMIC); pintfpriv->piorw_urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!pintfpriv->piorw_urb) if (!pintfpriv->piorw_urb)
return _FAIL; return _FAIL;
sema_init(&(pintfpriv->io_retevt), 0); init_completion(&pintfpriv->io_retevt_comp);
return _SUCCESS; return _SUCCESS;
} }
...@@ -163,7 +163,7 @@ static void usb_write_mem_complete(struct urb *purb) ...@@ -163,7 +163,7 @@ static void usb_write_mem_complete(struct urb *purb)
else else
padapter->bSurpriseRemoved = true; padapter->bSurpriseRemoved = true;
} }
up(&pintfpriv->io_retevt); complete(&pintfpriv->io_retevt_comp);
} }
void r8712_usb_write_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem) void r8712_usb_write_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
...@@ -187,7 +187,7 @@ void r8712_usb_write_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem) ...@@ -187,7 +187,7 @@ void r8712_usb_write_mem(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
wmem, cnt, usb_write_mem_complete, wmem, cnt, usb_write_mem_complete,
pio_queue); pio_queue);
usb_submit_urb(piorw_urb, GFP_ATOMIC); usb_submit_urb(piorw_urb, GFP_ATOMIC);
_down_sema(&pintfpriv->io_retevt); wait_for_completion_interruptible(&pintfpriv->io_retevt_comp);
} }
static void r8712_usb_read_port_complete(struct urb *purb) static void r8712_usb_read_port_complete(struct urb *purb)
......
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