[PATCH v1 09/17] ACPI: PAD: Pass struct device pointer to acpi_pad_notify()

Rafael J. Wysocki posted 1 patch 3 days, 5 hours ago
drivers/acpi/acpi_pad.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
[PATCH v1 09/17] ACPI: PAD: Pass struct device pointer to acpi_pad_notify()
Posted by Rafael J. Wysocki 3 days, 5 hours ago
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

Use the struct device pointer to the dev member in the struct
platform_device object representing the platform device used for driver
binding as the last argument of acpi_dev_install_notify_handler() and
accordingly update acpi_pad_notify() to pass that pointer directly to
dev_name() when generating the netlink event.

Since the dev_name() value for an ACPI-enumerated platform device is the
same as the dev_name() value for the dev member of its ACPI companion
object, as per acpi_create_platform_device(), the above code modification
is not expected to cause functionality to change.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/acpi_pad.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index 91d32da76f8f..b0a6723fb854 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -407,15 +407,13 @@ static void acpi_pad_handle_notify(acpi_handle handle)
 
 static void acpi_pad_notify(acpi_handle handle, u32 event, void *data)
 {
-	struct acpi_device *adev = data;
-
 	if (event != ACPI_PROCESSOR_AGGREGATOR_NOTIFY) {
 		pr_warn("Unsupported event [0x%x]\n", event);
 		return;
 	}
 
 	acpi_pad_handle_notify(handle);
-	acpi_bus_generate_netlink_event("acpi_pad", dev_name(&adev->dev), event, 0);
+	acpi_bus_generate_netlink_event("acpi_pad", dev_name(data), event, 0);
 }
 
 static int acpi_pad_probe(struct platform_device *pdev)
@@ -427,7 +425,7 @@ static int acpi_pad_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	return acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
-					       acpi_pad_notify, adev);
+					       acpi_pad_notify, &pdev->dev);
 }
 
 static void acpi_pad_remove(struct platform_device *pdev)
-- 
2.51.0