diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-03-03 16:35:44 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-03-04 08:23:40 -0500 |
| commit | 924144818cf0edc5d9d70d3a44e7cbbf4544796c (patch) | |
| tree | c58abdcb5a82d4498a856b4e53607857b35926a6 | |
| parent | 53540098b23c3884b4a0b4f220b9d977bc496af3 (diff) | |
ACPI / glue: Drop .find_bridge() callback from struct acpi_bus_type
After PCI and USB have stopped using the .find_bridge() callback in
struct acpi_bus_type, the only remaining user of it is SATA, but SATA
only pretends to be a user, because it points that callback to a stub
always returning -ENODEV.
For this reason, drop the SATA's dummy .find_bridge() callback and
remove .find_bridge(), which is not used any more, from struct
acpi_bus_type entirely.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
| -rw-r--r-- | drivers/acpi/glue.c | 26 | ||||
| -rw-r--r-- | drivers/ata/libata-acpi.c | 6 | ||||
| -rw-r--r-- | include/acpi/acpi_bus.h | 3 |
3 files changed, 1 insertions, 34 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index b94d14721af3..40a84cc6740c 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c | |||
| @@ -78,22 +78,6 @@ static struct acpi_bus_type *acpi_get_bus_type(struct device *dev) | |||
| 78 | return ret; | 78 | return ret; |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | static int acpi_find_bridge_device(struct device *dev, acpi_handle * handle) | ||
| 82 | { | ||
| 83 | struct acpi_bus_type *tmp; | ||
| 84 | int ret = -ENODEV; | ||
| 85 | |||
| 86 | down_read(&bus_type_sem); | ||
| 87 | list_for_each_entry(tmp, &bus_type_list, list) { | ||
| 88 | if (tmp->find_bridge && !tmp->find_bridge(dev, handle)) { | ||
| 89 | ret = 0; | ||
| 90 | break; | ||
| 91 | } | ||
| 92 | } | ||
| 93 | up_read(&bus_type_sem); | ||
| 94 | return ret; | ||
| 95 | } | ||
| 96 | |||
| 97 | static acpi_status do_acpi_find_child(acpi_handle handle, u32 lvl_not_used, | 81 | static acpi_status do_acpi_find_child(acpi_handle handle, u32 lvl_not_used, |
| 98 | void *addr_p, void **ret_p) | 82 | void *addr_p, void **ret_p) |
| 99 | { | 83 | { |
| @@ -262,15 +246,7 @@ static int acpi_platform_notify(struct device *dev) | |||
| 262 | int ret; | 246 | int ret; |
| 263 | 247 | ||
| 264 | ret = acpi_bind_one(dev, NULL); | 248 | ret = acpi_bind_one(dev, NULL); |
| 265 | if (ret) { | 249 | if (ret && type) { |
| 266 | if (!type) { | ||
| 267 | ret = acpi_find_bridge_device(dev, &handle); | ||
| 268 | if (!ret) | ||
| 269 | ret = acpi_bind_one(dev, handle); | ||
| 270 | |||
| 271 | goto out; | ||
| 272 | } | ||
| 273 | |||
| 274 | ret = type->find_device(dev, &handle); | 250 | ret = type->find_device(dev, &handle); |
| 275 | if (ret) { | 251 | if (ret) { |
| 276 | DBG("Unable to get handle for %s\n", dev_name(dev)); | 252 | DBG("Unable to get handle for %s\n", dev_name(dev)); |
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index c832a5ca09ad..beea3115577e 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c | |||
| @@ -1144,14 +1144,8 @@ static int ata_acpi_find_device(struct device *dev, acpi_handle *handle) | |||
| 1144 | return -ENODEV; | 1144 | return -ENODEV; |
| 1145 | } | 1145 | } |
| 1146 | 1146 | ||
| 1147 | static int ata_acpi_find_dummy(struct device *dev, acpi_handle *handle) | ||
| 1148 | { | ||
| 1149 | return -ENODEV; | ||
| 1150 | } | ||
| 1151 | |||
| 1152 | static struct acpi_bus_type ata_acpi_bus = { | 1147 | static struct acpi_bus_type ata_acpi_bus = { |
| 1153 | .name = "ATA", | 1148 | .name = "ATA", |
| 1154 | .find_bridge = ata_acpi_find_dummy, | ||
| 1155 | .find_device = ata_acpi_find_device, | 1149 | .find_device = ata_acpi_find_device, |
| 1156 | }; | 1150 | }; |
| 1157 | 1151 | ||
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index c751d7de3a5f..22ba56e834e2 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
| @@ -439,10 +439,7 @@ struct acpi_bus_type { | |||
| 439 | struct list_head list; | 439 | struct list_head list; |
| 440 | const char *name; | 440 | const char *name; |
| 441 | bool (*match)(struct device *dev); | 441 | bool (*match)(struct device *dev); |
| 442 | /* For general devices under the bus */ | ||
| 443 | int (*find_device) (struct device *, acpi_handle *); | 442 | int (*find_device) (struct device *, acpi_handle *); |
| 444 | /* For bridges, such as PCI root bridge, IDE controller */ | ||
| 445 | int (*find_bridge) (struct device *, acpi_handle *); | ||
| 446 | void (*setup)(struct device *); | 443 | void (*setup)(struct device *); |
| 447 | void (*cleanup)(struct device *); | 444 | void (*cleanup)(struct device *); |
| 448 | }; | 445 | }; |
