diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-05 05:45:22 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-05 05:45:22 -0500 |
commit | a140feab42d1cfd811930ab76104559c19dfc4b0 (patch) | |
tree | 41fd871990e888dd5616a6bf1891a1ff307221df /drivers/acpi/dock.c | |
parent | 1075414b06109a99b0e87601e84c74a95bd45681 (diff) | |
parent | fec6c6fec3e20637bee5d276fb61dd8b49a3f9cc (diff) |
Merge commit 'v2.6.29-rc7' into core/locking
Diffstat (limited to 'drivers/acpi/dock.c')
-rw-r--r-- | drivers/acpi/dock.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 5b30b8d91d71..35094f230b1e 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -855,10 +855,14 @@ fdd_out: | |||
855 | static ssize_t show_docked(struct device *dev, | 855 | static ssize_t show_docked(struct device *dev, |
856 | struct device_attribute *attr, char *buf) | 856 | struct device_attribute *attr, char *buf) |
857 | { | 857 | { |
858 | struct acpi_device *tmp; | ||
859 | |||
858 | struct dock_station *dock_station = *((struct dock_station **) | 860 | struct dock_station *dock_station = *((struct dock_station **) |
859 | dev->platform_data); | 861 | dev->platform_data); |
860 | return snprintf(buf, PAGE_SIZE, "%d\n", dock_present(dock_station)); | ||
861 | 862 | ||
863 | if (ACPI_SUCCESS(acpi_bus_get_device(dock_station->handle, &tmp))) | ||
864 | return snprintf(buf, PAGE_SIZE, "1\n"); | ||
865 | return snprintf(buf, PAGE_SIZE, "0\n"); | ||
862 | } | 866 | } |
863 | static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL); | 867 | static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL); |
864 | 868 | ||
@@ -984,7 +988,7 @@ static int dock_add(acpi_handle handle) | |||
984 | 988 | ||
985 | ret = device_create_file(&dock_device->dev, &dev_attr_docked); | 989 | ret = device_create_file(&dock_device->dev, &dev_attr_docked); |
986 | if (ret) { | 990 | if (ret) { |
987 | printk("Error %d adding sysfs file\n", ret); | 991 | printk(KERN_ERR "Error %d adding sysfs file\n", ret); |
988 | platform_device_unregister(dock_device); | 992 | platform_device_unregister(dock_device); |
989 | kfree(dock_station); | 993 | kfree(dock_station); |
990 | dock_station = NULL; | 994 | dock_station = NULL; |
@@ -992,7 +996,7 @@ static int dock_add(acpi_handle handle) | |||
992 | } | 996 | } |
993 | ret = device_create_file(&dock_device->dev, &dev_attr_undock); | 997 | ret = device_create_file(&dock_device->dev, &dev_attr_undock); |
994 | if (ret) { | 998 | if (ret) { |
995 | printk("Error %d adding sysfs file\n", ret); | 999 | printk(KERN_ERR "Error %d adding sysfs file\n", ret); |
996 | device_remove_file(&dock_device->dev, &dev_attr_docked); | 1000 | device_remove_file(&dock_device->dev, &dev_attr_docked); |
997 | platform_device_unregister(dock_device); | 1001 | platform_device_unregister(dock_device); |
998 | kfree(dock_station); | 1002 | kfree(dock_station); |
@@ -1001,7 +1005,7 @@ static int dock_add(acpi_handle handle) | |||
1001 | } | 1005 | } |
1002 | ret = device_create_file(&dock_device->dev, &dev_attr_uid); | 1006 | ret = device_create_file(&dock_device->dev, &dev_attr_uid); |
1003 | if (ret) { | 1007 | if (ret) { |
1004 | printk("Error %d adding sysfs file\n", ret); | 1008 | printk(KERN_ERR "Error %d adding sysfs file\n", ret); |
1005 | device_remove_file(&dock_device->dev, &dev_attr_docked); | 1009 | device_remove_file(&dock_device->dev, &dev_attr_docked); |
1006 | device_remove_file(&dock_device->dev, &dev_attr_undock); | 1010 | device_remove_file(&dock_device->dev, &dev_attr_undock); |
1007 | platform_device_unregister(dock_device); | 1011 | platform_device_unregister(dock_device); |
@@ -1011,7 +1015,7 @@ static int dock_add(acpi_handle handle) | |||
1011 | } | 1015 | } |
1012 | ret = device_create_file(&dock_device->dev, &dev_attr_flags); | 1016 | ret = device_create_file(&dock_device->dev, &dev_attr_flags); |
1013 | if (ret) { | 1017 | if (ret) { |
1014 | printk("Error %d adding sysfs file\n", ret); | 1018 | printk(KERN_ERR "Error %d adding sysfs file\n", ret); |
1015 | device_remove_file(&dock_device->dev, &dev_attr_docked); | 1019 | device_remove_file(&dock_device->dev, &dev_attr_docked); |
1016 | device_remove_file(&dock_device->dev, &dev_attr_undock); | 1020 | device_remove_file(&dock_device->dev, &dev_attr_undock); |
1017 | device_remove_file(&dock_device->dev, &dev_attr_uid); | 1021 | device_remove_file(&dock_device->dev, &dev_attr_uid); |