Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1450736
| From | Mathieu OTHACEHE <m.othacehe@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2 10/22] usb: serial: ti_usb_3410_5052: Change ti_write_byte function arguments |
| Date | 2016-07-26 20:10 +0200 |
| Message-ID | <rZeXM-5o9-27@gated-at.bofh.it> (permalink) |
| References | <rZeXL-5o9-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Remove useless ti_device pointer, and change addr to u32.
Change size variable in function from int to size_t.
Also fix minor style issue.
Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com>
---
Changelog:
v2:
* Do not delete prototype and move function declaration
drivers/usb/serial/ti_usb_3410_5052.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index 5f0d010..7f53432 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -348,8 +348,8 @@ static void ti_handle_new_msr(struct ti_port *tport, u8 msr);
static void ti_stop_read(struct ti_port *tport, struct tty_struct *tty);
static int ti_restart_read(struct ti_port *tport, struct tty_struct *tty);
-static int ti_write_byte(struct usb_serial_port *port, struct ti_device *tdev,
- unsigned long addr, u8 mask, u8 byte);
+static int ti_write_byte(struct usb_serial_port *port, u32 addr,
+ u8 mask, u8 byte);
static int ti_download_firmware(struct ti_device *tdev);
@@ -1185,10 +1185,9 @@ static void ti_break(struct tty_struct *tty, int break_state)
dev_dbg(&port->dev, "%s - state = %d\n", __func__, break_state);
- status = ti_write_byte(port, tport->tp_tdev,
+ status = ti_write_byte(port,
tport->tp_uart_base_addr + TI_UART_OFFSET_LCR,
TI_LCR_BREAK, break_state == -1 ? TI_LCR_BREAK : 0);
-
if (status)
dev_dbg(&port->dev, "%s - error setting break, %d\n", __func__, status);
}
@@ -1447,7 +1446,7 @@ static int ti_set_mcr(struct ti_port *tport, unsigned int mcr)
unsigned long flags;
int status;
- status = ti_write_byte(tport->tp_port, tport->tp_tdev,
+ status = ti_write_byte(tport->tp_port,
tport->tp_uart_base_addr + TI_UART_OFFSET_MCR,
TI_MCR_RTS | TI_MCR_DTR | TI_MCR_LOOP, mcr);
@@ -1607,16 +1606,15 @@ static int ti_restart_read(struct ti_port *tport, struct tty_struct *tty)
return status;
}
-static int ti_write_byte(struct usb_serial_port *port,
- struct ti_device *tdev, unsigned long addr,
+static int ti_write_byte(struct usb_serial_port *port, u32 addr,
u8 mask, u8 byte)
{
int status;
- unsigned int size;
+ size_t size;
struct ti_write_data_bytes *data;
- dev_dbg(&port->dev, "%s - addr 0x%08lX, mask 0x%02X, byte 0x%02X\n", __func__,
- addr, mask, byte);
+ dev_dbg(&port->dev, "%s - addr 0x%08X, mask 0x%02X, byte 0x%02X\n",
+ __func__, addr, mask, byte);
size = sizeof(struct ti_write_data_bytes) + 2;
data = kmalloc(size, GFP_KERNEL);
@@ -1626,7 +1624,7 @@ static int ti_write_byte(struct usb_serial_port *port,
data->bAddrType = TI_RW_DATA_ADDR_XDATA;
data->bDataType = TI_RW_DATA_BYTE;
data->bDataCounter = 1;
- data->wBaseAddrHi = cpu_to_be16(addr>>16);
+ data->wBaseAddrHi = cpu_to_be16(addr >> 16);
data->wBaseAddrLo = cpu_to_be16(addr);
data->bData[0] = mask;
data->bData[1] = byte;
--
2.9.0
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH v2 10/22] usb: serial: ti_usb_3410_5052: Change ti_write_byte function arguments Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-26 20:10 +0200
Re: [PATCH v2 10/22] usb: serial: ti_usb_3410_5052: Change ti_write_byte function arguments Oliver Neukum <oneukum@suse.com> - 2016-07-27 10:20 +0200
Re: [PATCH v2 10/22] usb: serial: ti_usb_3410_5052: Change ti_write_byte function arguments Mathieu OTHACEHE <m.othacehe@gmail.com> - 2016-07-27 18:10 +0200
Re: [PATCH v2 10/22] usb: serial: ti_usb_3410_5052: Change ti_write_byte function arguments Oliver Neukum <oneukum@suse.com> - 2016-07-27 21:20 +0200
csiph-web