]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ACPI / glue: Add .match() callback to struct acpi_bus_type
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 3 Mar 2013 21:35:20 +0000 (22:35 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 3 Mar 2013 21:35:20 +0000 (22:35 +0100)
commit989a799833e12fcc41637623409a5b486e037e07
tree9a3d2433ce1d64c98d59118c6e490c003c828848
parentd8202f959273b1e313af0af1fd007457d820056a
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>
drivers/acpi/glue.c
drivers/ata/libata-acpi.c
drivers/pci/pci-acpi.c
drivers/pnp/pnpacpi/core.c
drivers/scsi/scsi_lib.c
drivers/usb/core/usb-acpi.c
include/acpi/acpi_bus.h