]> git.baikalelectronics.ru Git - kernel.git/commit
USB: hub_for_each_child should skip unconnected ports
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 19 Oct 2012 15:03:02 +0000 (11:03 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Oct 2012 21:51:21 +0000 (14:51 -0700)
commit901d50ccf34bc8f81d352ae08559f52797c246d8
treee5322bb7b06e99461d96bf1091cf74230e811714
parenta8ca10facb326bd01df9639d631a5f7462b01c17
USB: hub_for_each_child should skip unconnected ports

This patch (as1619) improves the interface to the "hub_for_each_child"
macro.  The name clearly suggests that the macro iterates over child
devices; it does not suggest that the loop will also iterate over
unnconnected ports.

The patch changes the macro so that it will skip over unconnected
ports and iterate only the actual child devices.  The two existing
call sites are updated to avoid testing for a NULL child pointer,
which is now unnecessary.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/devices.c
drivers/usb/host/r8a66597-hcd.c
include/linux/usb.h