Skip to content

Commit e8afd5a

Browse files
Dan Carpentergregkh
authored andcommitted
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 f93e96c ("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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9027afa commit e8afd5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/dwc3/dwc3-rtk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static enum usb_device_speed __get_dwc3_maximum_speed(struct device_node *np)
184184

185185
ret = of_property_read_string(dwc3_np, "maximum-speed", &maximum_speed);
186186
if (ret < 0)
187-
return ret;
187+
return USB_SPEED_UNKNOWN;
188188

189189
ret = match_string(speed_names, ARRAY_SIZE(speed_names), maximum_speed);
190190

0 commit comments

Comments
 (0)