diff options
-rw-r--r-- | drivers/acpi/dock.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 0a1221854a25..3bd89823402a 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -948,11 +948,18 @@ static int dock_add(acpi_handle handle) | |||
948 | struct dock_station *dock_station; | 948 | struct dock_station *dock_station; |
949 | struct platform_device *dock_device; | 949 | struct platform_device *dock_device; |
950 | 950 | ||
951 | dock_device = | ||
952 | platform_device_register_simple("dock", | ||
953 | dock_station_count, NULL, 0); | ||
954 | if (IS_ERR(dock_device)) | ||
955 | return PTR_ERR(dock_device); | ||
956 | |||
951 | /* allocate & initialize the dock_station private data */ | 957 | /* allocate & initialize the dock_station private data */ |
952 | dock_station = kzalloc(sizeof(*dock_station), GFP_KERNEL); | 958 | dock_station = kzalloc(sizeof(*dock_station), GFP_KERNEL); |
953 | if (!dock_station) | 959 | if (!dock_station) |
954 | return -ENOMEM; | 960 | return -ENOMEM; |
955 | dock_station->handle = handle; | 961 | dock_station->handle = handle; |
962 | dock_station->dock_device = dock_device; | ||
956 | dock_station->last_dock_time = jiffies - HZ; | 963 | dock_station->last_dock_time = jiffies - HZ; |
957 | INIT_LIST_HEAD(&dock_station->dependent_devices); | 964 | INIT_LIST_HEAD(&dock_station->dependent_devices); |
958 | INIT_LIST_HEAD(&dock_station->hotplug_devices); | 965 | INIT_LIST_HEAD(&dock_station->hotplug_devices); |
@@ -961,15 +968,6 @@ static int dock_add(acpi_handle handle) | |||
961 | mutex_init(&dock_station->hp_lock); | 968 | mutex_init(&dock_station->hp_lock); |
962 | ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); | 969 | ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); |
963 | 970 | ||
964 | /* initialize platform device stuff */ | ||
965 | dock_station->dock_device = | ||
966 | platform_device_register_simple("dock", | ||
967 | dock_station_count, NULL, 0); | ||
968 | dock_device = dock_station->dock_device; | ||
969 | if (IS_ERR(dock_device)) { | ||
970 | ret = PTR_ERR(dock_device); | ||
971 | goto out; | ||
972 | } | ||
973 | platform_device_add_data(dock_device, &dock_station, | 971 | platform_device_add_data(dock_device, &dock_station, |
974 | sizeof(struct dock_station *)); | 972 | sizeof(struct dock_station *)); |
975 | 973 | ||