Commit 470508f6 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

ACPI: bus: Add context argument to acpi_dev_install_notify_handler()



Add void *context arrgument to the list of arguments of
acpi_dev_install_notify_handler() and modify it to pass that argument
as context to acpi_install_notify_handler() instead of its first
argument which is problematic in general (for example, if platform
drivers used it, they would rather get struct platform_device pointers
or pointers to their private data from the context arguments of their
notify handlers).

Make all of the current callers of acpi_dev_install_notify_handler()
take this change into account so as to avoid altering the general
functionality.

Co-developed-by: default avatarMichal Wilczynski <michal.wilczynski@intel.com>
Signed-off-by: default avatarMichal Wilczynski <michal.wilczynski@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 5f3c10ac
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -257,7 +257,7 @@ static int acpi_ac_add(struct acpi_device *device)
	register_acpi_notifier(&ac->battery_nb);

	result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
						 acpi_ac_notify);
						 acpi_ac_notify, device);
	if (result)
		goto err_unregister;

+1 −1
Original line number Diff line number Diff line
@@ -2062,7 +2062,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
		goto err_del;

	error = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
						acpi_video_bus_notify);
						acpi_video_bus_notify, device);
	if (error)
		goto err_remove;

+1 −1
Original line number Diff line number Diff line
@@ -1214,7 +1214,7 @@ static int acpi_battery_add(struct acpi_device *device)
	device_init_wakeup(&device->dev, 1);

	result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
						 acpi_battery_notify);
						 acpi_battery_notify, device);
	if (result)
		goto fail_pm;

+2 −2
Original line number Diff line number Diff line
@@ -556,12 +556,12 @@ static void acpi_device_remove_notify_handler(struct acpi_device *device,

int acpi_dev_install_notify_handler(struct acpi_device *adev,
				    u32 handler_type,
				    acpi_notify_handler handler)
				    acpi_notify_handler handler, void *context)
{
	acpi_status status;

	status = acpi_install_notify_handler(adev->handle, handler_type,
					     handler, adev);
					     handler, context);
	if (ACPI_FAILURE(status))
		return -ENODEV;

+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ static int acpi_hed_add(struct acpi_device *device)
	hed_handle = device->handle;

	err = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
					      acpi_hed_notify);
					      acpi_hed_notify, device);
	if (err)
		hed_handle = NULL;

Loading