Commit 523b724a authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by Kalle Valo

rsi: use macro for allocating USB buffer

4 bytes is fixed size for reading or writing USB register. We
will use a macro instead of hardcoding this.

Fixes: b97e9b94 ("rsi: Add new host interface operations")
Signed-off-by: default avatarAmitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent d7203a83
...@@ -162,7 +162,7 @@ static int rsi_usb_reg_read(struct usb_device *usbdev, ...@@ -162,7 +162,7 @@ static int rsi_usb_reg_read(struct usb_device *usbdev,
u8 *buf; u8 *buf;
int status = -ENOMEM; int status = -ENOMEM;
buf = kmalloc(0x04, GFP_KERNEL); buf = kmalloc(RSI_USB_CTRL_BUF_SIZE, GFP_KERNEL);
if (!buf) if (!buf)
return status; return status;
...@@ -204,7 +204,7 @@ static int rsi_usb_reg_write(struct usb_device *usbdev, ...@@ -204,7 +204,7 @@ static int rsi_usb_reg_write(struct usb_device *usbdev,
u8 *usb_reg_buf; u8 *usb_reg_buf;
int status = -ENOMEM; int status = -ENOMEM;
usb_reg_buf = kmalloc(0x04, GFP_KERNEL); usb_reg_buf = kmalloc(RSI_USB_CTRL_BUF_SIZE, GFP_KERNEL);
if (!usb_reg_buf) if (!usb_reg_buf)
return status; return status;
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#define BT_EP 2 #define BT_EP 2
#define RSI_USB_BUF_SIZE 4096 #define RSI_USB_BUF_SIZE 4096
#define RSI_USB_CTRL_BUF_SIZE 0x04
struct rsi_91x_usbdev { struct rsi_91x_usbdev {
struct rsi_thread rx_thread; struct rsi_thread rx_thread;
......
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