Commit 8802f56349eef1eedaf12238f84810d0691aaf34

Authored by Hans de Goede
Committed by Simon Glass
1 parent 682c9f8dfc

usb: Add an usb_device parameter to usb_reset_root_port

Add an usb_device parameter to usb_reset_root_port so that it knows which
root-port it is resetting. This is necessary for proper device-model support
for usb_reset_root_port.

Also remove a duplicate declaration of usb_reset_root_port() from usb.h .

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>

Showing 4 changed files with 6 additions and 10 deletions Side-by-side Diff

... ... @@ -924,7 +924,7 @@
924 924 return err;
925 925 }
926 926 } else {
927   - usb_reset_root_port();
  927 + usb_reset_root_port(dev);
928 928 }
929 929  
930 930 return 0;
drivers/usb/host/usb-uclass.c
... ... @@ -265,7 +265,7 @@
265 265 return usb_started ? 0 : -1;
266 266 }
267 267  
268   -int usb_reset_root_port(void)
  268 +int usb_reset_root_port(struct usb_device *udev)
269 269 {
270 270 return -ENOSYS;
271 271 }
drivers/usb/musb-new/musb_uboot.c
... ... @@ -180,7 +180,7 @@
180 180 return NULL; /* URB still pending */
181 181 }
182 182  
183   -int usb_reset_root_port(void)
  183 +int usb_reset_root_port(struct usb_device *dev)
184 184 {
185 185 void *mbase = host->mregs;
186 186 u8 power;
... ... @@ -232,7 +232,7 @@
232 232 if (get_timer(0) >= timeout)
233 233 return -ENODEV;
234 234  
235   - usb_reset_root_port();
  235 + usb_reset_root_port(NULL);
236 236 host->is_active = 1;
237 237 hcd.hcd_priv = host;
238 238  
... ... @@ -175,9 +175,9 @@
175 175 int usb_lowlevel_stop(int index);
176 176  
177 177 #if defined(CONFIG_MUSB_HOST) || defined(CONFIG_DM_USB)
178   -int usb_reset_root_port(void);
  178 +int usb_reset_root_port(struct usb_device *dev);
179 179 #else
180   -#define usb_reset_root_port()
  180 +#define usb_reset_root_port(dev)
181 181 #endif
182 182  
183 183 int submit_bulk_msg(struct usb_device *dev, unsigned long pipe,
... ... @@ -709,10 +709,6 @@
709 709  
710 710 #define usb_get_ops(dev) ((struct dm_usb_ops *)(dev)->driver->ops)
711 711 #define usb_get_emul_ops(dev) ((struct dm_usb_ops *)(dev)->driver->ops)
712   -
713   -#ifdef CONFIG_MUSB_HOST
714   -int usb_reset_root_port(void);
715   -#endif
716 712  
717 713 /**
718 714 * usb_get_dev_index() - look up a device index number