Commit 593b5e2f authored by Marc Kleine-Budde's avatar Marc Kleine-Budde

can: gs_usb: gs_usb_get_timestamp(): fix endpoint parameter for usb_control_msg_recv()

The 2nd argument of usb_control_msg_recv() is the "endpoint",
usb_control_msg_recv() will internally convert the endpoint into a
pipe with usb_rcvctrlpipe().

In gs_usb_get_timestamp() not the endpoint "0" is passed, but the
pipe. This worked by accident as endpoint is a __u8 and the lowest 8
bits of the pipe are 0. Fix this copy/paste error by using the correct
endpoint of "0".

Fixes: 45dfa45f ("can: gs_usb: add RX and TX hardware timestamp support")
Link: https://lore.kernel.org/all/20220920100416.959226-2-mkl@pengutronix.de
Cc: John Whittington <git@jbrengineering.co.uk>
Tested-by: default avatarJohn Whittington <git@jbrengineering.co.uk>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 86c223ff
...@@ -386,8 +386,7 @@ static inline int gs_usb_get_timestamp(const struct gs_can *dev, ...@@ -386,8 +386,7 @@ static inline int gs_usb_get_timestamp(const struct gs_can *dev,
__le32 timestamp; __le32 timestamp;
int rc; int rc;
rc = usb_control_msg_recv(interface_to_usbdev(dev->iface), rc = usb_control_msg_recv(interface_to_usbdev(dev->iface), 0,
usb_sndctrlpipe(interface_to_usbdev(dev->iface), 0),
GS_USB_BREQ_TIMESTAMP, GS_USB_BREQ_TIMESTAMP,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
dev->channel, 0, dev->channel, 0,
......
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