Skip to content

Commit d91a624

Browse files
committed
ACPI: video: Adjust event notification routine
Adjust acpi_video_bus_notify() to cast its "data" argument to a struct acpi_video_bus pointer instead of a struct acpi_device one, which allows the use of acpi_driver_data() to be limited and will facilitate subsequent changes. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Armin Wolf <W_Armin@gmx.de> Link: https://patch.msgid.link/2409089.ElGaqSPkdT@rafael.j.wysocki
1 parent 336aae5 commit d91a624

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

drivers/acpi/acpi_video.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,14 +1540,11 @@ static int acpi_video_bus_stop_devices(struct acpi_video_bus *video)
15401540

15411541
static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
15421542
{
1543-
struct acpi_device *device = data;
1544-
struct acpi_video_bus *video = acpi_driver_data(device);
1543+
struct acpi_video_bus *video = data;
1544+
struct acpi_device *device = video->device;
15451545
struct input_dev *input;
15461546
int keycode = 0;
15471547

1548-
if (!video || !video->input)
1549-
return;
1550-
15511548
input = video->input;
15521549

15531550
switch (event) {
@@ -2076,7 +2073,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
20762073
goto err_del;
20772074

20782075
error = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
2079-
acpi_video_bus_notify, device);
2076+
acpi_video_bus_notify, video);
20802077
if (error)
20812078
goto err_remove;
20822079

0 commit comments

Comments
 (0)