Commit a199a7244899f6385035459cbc62409bd9bbcc23
Committed by
Marek Vasut
1 parent
dfa96e0676
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
usb: hub: Remove hub_port_reset()
At present hub_port_reset() is defined in DM USB, but it is never called hence remove it (removing another ifdefs). While we are here, change legacy_hub_port_reset() name to usb_hub_port_reset() to better match other function names in the same hub module. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Showing 2 changed files with 13 additions and 30 deletions Side-by-side Diff
common/usb_hub.c
... | ... | @@ -207,8 +207,18 @@ |
207 | 207 | return speed_str; |
208 | 208 | } |
209 | 209 | |
210 | -int legacy_hub_port_reset(struct usb_device *dev, int port, | |
211 | - unsigned short *portstat) | |
210 | +/** | |
211 | + * usb_hub_port_reset() - reset a port given its usb_device pointer | |
212 | + * | |
213 | + * Reset a hub port and see if a device is present on that port, providing | |
214 | + * sufficient time for it to show itself. The port status is returned. | |
215 | + * | |
216 | + * @dev: USB device to reset | |
217 | + * @port: Port number to reset (note ports are numbered from 0 here) | |
218 | + * @portstat: Returns port status | |
219 | + */ | |
220 | +static int usb_hub_port_reset(struct usb_device *dev, int port, | |
221 | + unsigned short *portstat) | |
212 | 222 | { |
213 | 223 | int err, tries; |
214 | 224 | ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1); |
... | ... | @@ -281,15 +291,6 @@ |
281 | 291 | return 0; |
282 | 292 | } |
283 | 293 | |
284 | -#ifdef CONFIG_DM_USB | |
285 | -int hub_port_reset(struct udevice *dev, int port, unsigned short *portstat) | |
286 | -{ | |
287 | - struct usb_device *udev = dev_get_parent_priv(dev); | |
288 | - | |
289 | - return legacy_hub_port_reset(udev, port, portstat); | |
290 | -} | |
291 | -#endif | |
292 | - | |
293 | 294 | int usb_hub_port_connect_change(struct usb_device *dev, int port) |
294 | 295 | { |
295 | 296 | ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1); |
... | ... | @@ -323,7 +324,7 @@ |
323 | 324 | } |
324 | 325 | |
325 | 326 | /* Reset the port */ |
326 | - ret = legacy_hub_port_reset(dev, port, &portstatus); | |
327 | + ret = usb_hub_port_reset(dev, port, &portstatus); | |
327 | 328 | if (ret < 0) { |
328 | 329 | if (ret != -ENXIO) |
329 | 330 | printf("cannot reset port %i!?\n", port + 1); |
include/usb.h
... | ... | @@ -871,24 +871,6 @@ |
871 | 871 | int usb_hub_probe(struct usb_device *dev, int ifnum); |
872 | 872 | void usb_hub_reset(void); |
873 | 873 | |
874 | -/** | |
875 | - * legacy_hub_port_reset() - reset a port given its usb_device pointer | |
876 | - * | |
877 | - * Reset a hub port and see if a device is present on that port, providing | |
878 | - * sufficient time for it to show itself. The port status is returned. | |
879 | - * | |
880 | - * With driver model this moves to hub_port_reset() and is passed a struct | |
881 | - * udevice. | |
882 | - * | |
883 | - * @dev: USB device to reset | |
884 | - * @port: Port number to reset (note ports are numbered from 0 here) | |
885 | - * @portstat: Returns port status | |
886 | - */ | |
887 | -int legacy_hub_port_reset(struct usb_device *dev, int port, | |
888 | - unsigned short *portstat); | |
889 | - | |
890 | -int hub_port_reset(struct udevice *dev, int port, unsigned short *portstat); | |
891 | - | |
892 | 874 | /* |
893 | 875 | * usb_find_usb2_hub_address_port() - Get hub address and port for TT setting |
894 | 876 | * |