Commit e909b43b authored by Marc Kleine-Budde's avatar Marc Kleine-Budde

Merge branch 'can-etas_es58x-cleanups-on-struct-es58x_device'

Vincent Mailhol says:

====================
This series contains two clean up patches toward struct es58x_device
of the CAN etas_es58x driver. The first one removes the field
rx_max_packet_size which value can actually be retrieved from the
helper function usb_maxpacket(). The second one fixes the signedness
of the TX and RX pipes.

No functional changes.
====================

Link: https://lore.kernel.org/all/20220611162037.1507-1-mailhol.vincent@wanadoo.frSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parents a9cf02c6 e0e0cc54
...@@ -1707,7 +1707,7 @@ static int es58x_alloc_rx_urbs(struct es58x_device *es58x_dev) ...@@ -1707,7 +1707,7 @@ static int es58x_alloc_rx_urbs(struct es58x_device *es58x_dev)
{ {
const struct device *dev = es58x_dev->dev; const struct device *dev = es58x_dev->dev;
const struct es58x_parameters *param = es58x_dev->param; const struct es58x_parameters *param = es58x_dev->param;
size_t rx_buf_len = es58x_dev->rx_max_packet_size; u16 rx_buf_len = usb_maxpacket(es58x_dev->udev, es58x_dev->rx_pipe);
struct urb *urb; struct urb *urb;
u8 *buf; u8 *buf;
int i; int i;
...@@ -1739,7 +1739,7 @@ static int es58x_alloc_rx_urbs(struct es58x_device *es58x_dev) ...@@ -1739,7 +1739,7 @@ static int es58x_alloc_rx_urbs(struct es58x_device *es58x_dev)
dev_err(dev, "%s: Could not setup any rx URBs\n", __func__); dev_err(dev, "%s: Could not setup any rx URBs\n", __func__);
return ret; return ret;
} }
dev_dbg(dev, "%s: Allocated %d rx URBs each of size %zu\n", dev_dbg(dev, "%s: Allocated %d rx URBs each of size %u\n",
__func__, i, rx_buf_len); __func__, i, rx_buf_len);
return ret; return ret;
...@@ -2223,7 +2223,6 @@ static struct es58x_device *es58x_init_es58x_dev(struct usb_interface *intf, ...@@ -2223,7 +2223,6 @@ static struct es58x_device *es58x_init_es58x_dev(struct usb_interface *intf,
ep_in->bEndpointAddress); ep_in->bEndpointAddress);
es58x_dev->tx_pipe = usb_sndbulkpipe(es58x_dev->udev, es58x_dev->tx_pipe = usb_sndbulkpipe(es58x_dev->udev,
ep_out->bEndpointAddress); ep_out->bEndpointAddress);
es58x_dev->rx_max_packet_size = le16_to_cpu(ep_in->wMaxPacketSize);
return es58x_dev; return es58x_dev;
} }
......
...@@ -380,7 +380,6 @@ struct es58x_operators { ...@@ -380,7 +380,6 @@ struct es58x_operators {
* @timestamps: a temporary buffer to store the time stamps before * @timestamps: a temporary buffer to store the time stamps before
* feeding them to es58x_can_get_echo_skb(). Can only be used * feeding them to es58x_can_get_echo_skb(). Can only be used
* in RX branches. * in RX branches.
* @rx_max_packet_size: Maximum length of bulk-in URB.
* @num_can_ch: Number of CAN channel (i.e. number of elements of @netdev). * @num_can_ch: Number of CAN channel (i.e. number of elements of @netdev).
* @opened_channel_cnt: number of channels opened. Free of race * @opened_channel_cnt: number of channels opened. Free of race
* conditions because its two users (net_device_ops:ndo_open() * conditions because its two users (net_device_ops:ndo_open()
...@@ -401,8 +400,8 @@ struct es58x_device { ...@@ -401,8 +400,8 @@ struct es58x_device {
const struct es58x_parameters *param; const struct es58x_parameters *param;
const struct es58x_operators *ops; const struct es58x_operators *ops;
int rx_pipe; unsigned int rx_pipe;
int tx_pipe; unsigned int tx_pipe;
struct usb_anchor rx_urbs; struct usb_anchor rx_urbs;
struct usb_anchor tx_urbs_busy; struct usb_anchor tx_urbs_busy;
...@@ -414,7 +413,6 @@ struct es58x_device { ...@@ -414,7 +413,6 @@ struct es58x_device {
u64 timestamps[ES58X_ECHO_BULK_MAX]; u64 timestamps[ES58X_ECHO_BULK_MAX];
u16 rx_max_packet_size;
u8 num_can_ch; u8 num_can_ch;
u8 opened_channel_cnt; u8 opened_channel_cnt;
......
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