aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/glue.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/glue.c')
-rw-r--r--drivers/acpi/glue.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 0c789224d40d..f774c65ecb8b 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -287,6 +287,7 @@ EXPORT_SYMBOL_GPL(acpi_unbind_one);
287static int acpi_platform_notify(struct device *dev) 287static int acpi_platform_notify(struct device *dev)
288{ 288{
289 struct acpi_bus_type *type = acpi_get_bus_type(dev); 289 struct acpi_bus_type *type = acpi_get_bus_type(dev);
290 struct acpi_device *adev;
290 int ret; 291 int ret;
291 292
292 ret = acpi_bind_one(dev, NULL); 293 ret = acpi_bind_one(dev, NULL);
@@ -303,9 +304,14 @@ static int acpi_platform_notify(struct device *dev)
303 if (ret) 304 if (ret)
304 goto out; 305 goto out;
305 } 306 }
307 adev = ACPI_COMPANION(dev);
308 if (!adev)
309 goto out;
306 310
307 if (type && type->setup) 311 if (type && type->setup)
308 type->setup(dev); 312 type->setup(dev);
313 else if (adev->handler && adev->handler->bind)
314 adev->handler->bind(dev);
309 315
310 out: 316 out:
311#if ACPI_GLUE_DEBUG 317#if ACPI_GLUE_DEBUG
@@ -324,11 +330,17 @@ static int acpi_platform_notify(struct device *dev)
324 330
325static int acpi_platform_notify_remove(struct device *dev) 331static int acpi_platform_notify_remove(struct device *dev)
326{ 332{
333 struct acpi_device *adev = ACPI_COMPANION(dev);
327 struct acpi_bus_type *type; 334 struct acpi_bus_type *type;
328 335
336 if (!adev)
337 return 0;
338
329 type = acpi_get_bus_type(dev); 339 type = acpi_get_bus_type(dev);
330 if (type && type->cleanup) 340 if (type && type->cleanup)
331 type->cleanup(dev); 341 type->cleanup(dev);
342 else if (adev->handler && adev->handler->unbind)
343 adev->handler->unbind(dev);
332 344
333 acpi_unbind_one(dev); 345 acpi_unbind_one(dev);
334 return 0; 346 return 0;