]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
usb: dwc3: rtk: Clean up error code in __get_dwc3_maximum_speed()
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 12 Sep 2024 08:54:09 +0000 (11:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Sep 2024 05:41:12 +0000 (07:41 +0200)
commite8afd5ace118fe3a508cd6f2aa21e2da150bed48
tree65f6d8885966d549ad8386a515b9eaf097513afd
parent9027afa89bfe9e50e46714b72179761c67ebf4ad
usb: dwc3: rtk: Clean up error code in __get_dwc3_maximum_speed()

The __get_dwc3_maximum_speed() function returns an enum type which, in
this context here, is basically unsigned int.  On error cases, it's
supposed to return USB_SPEED_UNKNOWN, but it was accidentally changed to
return negative error codes in commit f93e96c544ca ("usb: dwc3: rtk: use
scoped device node handling to simplify error paths").

There is only one caller and because of the way that the types work out,
returning negative error codes is not a problem.  They will be treated
as greater than USB_SPEED_HIGH and ignored as invalid.  So this patch
does not affect run time behavior, it's just a clean up.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/865e56dc-37cc-47b1-8d35-9047ecb1984a@stanley.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-rtk.c