From 6b5e7665c9fa1def8e69596221d6851e713105c6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 30 Jul 2021 11:24:17 +0200 Subject: [PATCH] remove rtw_usb_control_msg() macro It is a wrapper around usb_control_msg() that does nothing, so remove the macro and just call the correct USB function instead in the one place it is used. Link: https://lore.kernel.org/r/20210730092417.1014392-12-gregkh@linuxfoundation.org --- include/usb_ops_linux.h | 10 ---------- os_dep/linux/usb_ops_linux.c | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/include/usb_ops_linux.h b/include/usb_ops_linux.h index 137031b..3ec6ac4 100644 --- a/include/usb_ops_linux.h +++ b/include/usb_ops_linux.h @@ -44,16 +44,6 @@ #define usb_read_interrupt_complete(purb, regs) usb_read_interrupt_complete(purb) #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)) -#define rtw_usb_control_msg(dev, pipe, request, requesttype, value, index, data, size, timeout_ms) \ - usb_control_msg((dev), (pipe), (request), (requesttype), (value), (index), (data), (size), (timeout_ms)) -#else -#define rtw_usb_control_msg(dev, pipe, request, requesttype, value, index, data, size, timeout_ms) \ - usb_control_msg((dev), (pipe), (request), (requesttype), (value), (index), (data), (size), \ - ((timeout_ms) == 0) || ((timeout_ms) * HZ / 1000 > 0) ? ((timeout_ms) * HZ / 1000) : 1) -#endif - - #ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ int usb_async_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val); int usb_async_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val); diff --git a/os_dep/linux/usb_ops_linux.c b/os_dep/linux/usb_ops_linux.c index a05446e..709023a 100644 --- a/os_dep/linux/usb_ops_linux.c +++ b/os_dep/linux/usb_ops_linux.c @@ -106,7 +106,7 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde _rtw_memcpy(pIo_buf, pdata, len); } - status = rtw_usb_control_msg(udev, pipe, request, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT); + status = usb_control_msg(udev, pipe, request, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT); if (status == len) { /* Success this control transfer. */ rtw_reset_continual_io_error(pdvobjpriv); @@ -173,7 +173,7 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde t_reg = 0x4e0; - status = rtw_usb_control_msg(udev, t_pipe, t_req, t_reqtype, t_reg, t_index, pIo_buf, t_len, RTW_USB_CONTROL_MSG_TIMEOUT); + status = usb_control_msg(udev, t_pipe, t_req, t_reqtype, t_reg, t_index, pIo_buf, t_len, RTW_USB_CONTROL_MSG_TIMEOUT); if (status == t_len) rtw_reset_continual_io_error(pdvobjpriv);