if (!video)
return -ENOMEM;
+ video->device = device;
+ device->driver_data = video;
+
/*
* A hack to fix the duplicate name "VID" problem on T61 and the
* duplicate name "VGA" problem on Pa 3553.
auxiliary_set_drvdata(aux_dev, video);
- video->device = device;
- device->driver_data = video;
-
acpi_video_bus_find_cap(video);
error = acpi_video_bus_check(video);
if (error)
acpi_device_bid(device), str_yes_no(video->flags.multihead),
str_yes_no(video->flags.rom), str_yes_no(video->flags.post));
- mutex_lock(&video_list_lock);
- list_add_tail(&video->entry, &video_bus_head);
- mutex_unlock(&video_list_lock);
-
/*
* If backlight-type auto-detection is used then a native backlight may
* show up later and this may change the result from video to native.
!auto_detect)
acpi_video_bus_register_backlight(video);
+ mutex_lock(&video_list_lock);
+ list_add_tail(&video->entry, &video_bus_head);
+ mutex_unlock(&video_list_lock);
+
error = acpi_video_bus_add_notify_handler(video, dev);
if (error)
goto err_del;
acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
acpi_video_bus_notify);
+ acpi_video_bus_remove_notify_handler(video);
+
mutex_lock(&video_list_lock);
list_del(&video->entry);
mutex_unlock(&video_list_lock);
-
- acpi_video_bus_remove_notify_handler(video);
acpi_video_bus_unregister_backlight(video);
acpi_video_bus_put_devices(video);
-
kfree(video->attached_array);
+
kfree(video);
device->driver_data = NULL;
}