| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Link physical devices with ACPI devices support |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2005 David Shaohua Li <shaohua.li@intel.com> |
|---|
| 5 | 6 | * Copyright (c) 2005 Intel Corp. |
|---|
| 6 | | - * |
|---|
| 7 | | - * This file is released under the GPLv2. |
|---|
| 8 | 7 | */ |
|---|
| 9 | 8 | |
|---|
| 10 | 9 | #include <linux/acpi_iort.h> |
|---|
| .. | .. |
|---|
| 296 | 295 | } |
|---|
| 297 | 296 | EXPORT_SYMBOL_GPL(acpi_unbind_one); |
|---|
| 298 | 297 | |
|---|
| 299 | | -static int acpi_platform_notify(struct device *dev) |
|---|
| 298 | +static int acpi_device_notify(struct device *dev) |
|---|
| 300 | 299 | { |
|---|
| 301 | 300 | struct acpi_bus_type *type = acpi_get_bus_type(dev); |
|---|
| 302 | 301 | struct acpi_device *adev; |
|---|
| .. | .. |
|---|
| 320 | 319 | if (!adev) |
|---|
| 321 | 320 | goto out; |
|---|
| 322 | 321 | |
|---|
| 323 | | - if (dev->bus == &platform_bus_type) |
|---|
| 322 | + if (dev_is_platform(dev)) |
|---|
| 324 | 323 | acpi_configure_pmsi_domain(dev); |
|---|
| 325 | 324 | |
|---|
| 326 | 325 | if (type && type->setup) |
|---|
| .. | .. |
|---|
| 343 | 342 | return ret; |
|---|
| 344 | 343 | } |
|---|
| 345 | 344 | |
|---|
| 346 | | -static int acpi_platform_notify_remove(struct device *dev) |
|---|
| 345 | +static int acpi_device_notify_remove(struct device *dev) |
|---|
| 347 | 346 | { |
|---|
| 348 | 347 | struct acpi_device *adev = ACPI_COMPANION(dev); |
|---|
| 349 | 348 | struct acpi_bus_type *type; |
|---|
| .. | .. |
|---|
| 361 | 360 | return 0; |
|---|
| 362 | 361 | } |
|---|
| 363 | 362 | |
|---|
| 364 | | -void __init init_acpi_device_notify(void) |
|---|
| 363 | +int acpi_platform_notify(struct device *dev, enum kobject_action action) |
|---|
| 365 | 364 | { |
|---|
| 366 | | - if (platform_notify || platform_notify_remove) { |
|---|
| 367 | | - printk(KERN_ERR PREFIX "Can't use platform_notify\n"); |
|---|
| 368 | | - return; |
|---|
| 365 | + switch (action) { |
|---|
| 366 | + case KOBJ_ADD: |
|---|
| 367 | + acpi_device_notify(dev); |
|---|
| 368 | + break; |
|---|
| 369 | + case KOBJ_REMOVE: |
|---|
| 370 | + acpi_device_notify_remove(dev); |
|---|
| 371 | + break; |
|---|
| 372 | + default: |
|---|
| 373 | + break; |
|---|
| 369 | 374 | } |
|---|
| 370 | | - platform_notify = acpi_platform_notify; |
|---|
| 371 | | - platform_notify_remove = acpi_platform_notify_remove; |
|---|
| 375 | + return 0; |
|---|
| 372 | 376 | } |
|---|