diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-03-03 16:35:20 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-03-04 08:23:40 -0500 |
commit | 53540098b23c3884b4a0b4f220b9d977bc496af3 (patch) | |
tree | fe86061c4772efaa92fbe68920f803ae4280b2d0 /drivers/usb/core | |
parent | 9b27516fcd7ab7dc416edf418446c24c61729938 (diff) |
ACPI / glue: Add .match() callback to struct acpi_bus_type
USB uses the .find_bridge() callback from struct acpi_bus_type
incorrectly, because as a result of the way it is used by USB every
device in the system that doesn't have a bus type or parent is
passed to usb_acpi_find_device() for inspection.
What USB actually needs, though, is to call usb_acpi_find_device()
for USB ports that don't have a bus type defined, but have
usb_port_device_type as their device type, as well as for USB
devices.
To fix that replace the struct bus_type pointer in struct
acpi_bus_type used for matching devices to specific subsystems
with a .match() callback to be used for this purpose and update
the users of struct acpi_bus_type, including USB, accordingly.
Define the .match() callback routine for USB, usb_acpi_bus_match(),
in such a way that it will cover both USB devices and USB ports
and remove the now redundant .find_bridge() callback pointer from
usb_acpi_bus.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/usb-acpi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c index cef4252bb31a..b6f4bad3f756 100644 --- a/drivers/usb/core/usb-acpi.c +++ b/drivers/usb/core/usb-acpi.c | |||
@@ -210,9 +210,14 @@ static int usb_acpi_find_device(struct device *dev, acpi_handle *handle) | |||
210 | return 0; | 210 | return 0; |
211 | } | 211 | } |
212 | 212 | ||
213 | static bool usb_acpi_bus_match(struct device *dev) | ||
214 | { | ||
215 | return is_usb_device(dev) || is_usb_port(dev); | ||
216 | } | ||
217 | |||
213 | static struct acpi_bus_type usb_acpi_bus = { | 218 | static struct acpi_bus_type usb_acpi_bus = { |
214 | .bus = &usb_bus_type, | 219 | .name = "USB", |
215 | .find_bridge = usb_acpi_find_device, | 220 | .match = usb_acpi_bus_match, |
216 | .find_device = usb_acpi_find_device, | 221 | .find_device = usb_acpi_find_device, |
217 | }; | 222 | }; |
218 | 223 | ||