diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/hub.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 69e3a966a4b7..645686a14214 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -163,8 +163,10 @@ static inline char *portspeed(int portstatus) | |||
163 | } | 163 | } |
164 | 164 | ||
165 | /* Note that hdev or one of its children must be locked! */ | 165 | /* Note that hdev or one of its children must be locked! */ |
166 | static inline struct usb_hub *hdev_to_hub(struct usb_device *hdev) | 166 | static struct usb_hub *hdev_to_hub(struct usb_device *hdev) |
167 | { | 167 | { |
168 | if (!hdev || !hdev->actconfig) | ||
169 | return NULL; | ||
168 | return usb_get_intfdata(hdev->actconfig->interface[0]); | 170 | return usb_get_intfdata(hdev->actconfig->interface[0]); |
169 | } | 171 | } |
170 | 172 | ||
@@ -385,8 +387,10 @@ static void kick_khubd(struct usb_hub *hub) | |||
385 | 387 | ||
386 | void usb_kick_khubd(struct usb_device *hdev) | 388 | void usb_kick_khubd(struct usb_device *hdev) |
387 | { | 389 | { |
388 | /* FIXME: What if hdev isn't bound to the hub driver? */ | 390 | struct usb_hub *hub = hdev_to_hub(hdev); |
389 | kick_khubd(hdev_to_hub(hdev)); | 391 | |
392 | if (hub) | ||
393 | kick_khubd(hub); | ||
390 | } | 394 | } |
391 | 395 | ||
392 | 396 | ||