diff options
-rw-r--r-- | drivers/acpi/dock.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 54a697f9aa18..4546bf873aea 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/notifier.h> | 29 | #include <linux/notifier.h> |
30 | #include <linux/platform_device.h> | 30 | #include <linux/platform_device.h> |
31 | #include <linux/jiffies.h> | 31 | #include <linux/jiffies.h> |
32 | #include <linux/stddef.h> | ||
32 | #include <acpi/acpi_bus.h> | 33 | #include <acpi/acpi_bus.h> |
33 | #include <acpi/acpi_drivers.h> | 34 | #include <acpi/acpi_drivers.h> |
34 | 35 | ||
@@ -667,6 +668,23 @@ static ssize_t write_undock(struct device *dev, struct device_attribute *attr, | |||
667 | } | 668 | } |
668 | DEVICE_ATTR(undock, S_IWUSR, NULL, write_undock); | 669 | DEVICE_ATTR(undock, S_IWUSR, NULL, write_undock); |
669 | 670 | ||
671 | /* | ||
672 | * show_dock_uid - read method for "uid" file in sysfs | ||
673 | */ | ||
674 | static ssize_t show_dock_uid(struct device *dev, | ||
675 | struct device_attribute *attr, char *buf) | ||
676 | { | ||
677 | unsigned long lbuf; | ||
678 | acpi_status status = acpi_evaluate_integer(dock_station->handle, "_UID", NULL, &lbuf); | ||
679 | if(ACPI_FAILURE(status)) { | ||
680 | return 0; | ||
681 | } | ||
682 | return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf); | ||
683 | } | ||
684 | DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL); | ||
685 | |||
686 | |||
687 | |||
670 | /** | 688 | /** |
671 | * dock_add - add a new dock station | 689 | * dock_add - add a new dock station |
672 | * @handle: the dock station handle | 690 | * @handle: the dock station handle |
@@ -715,6 +733,13 @@ static int dock_add(acpi_handle handle) | |||
715 | kfree(dock_station); | 733 | kfree(dock_station); |
716 | return ret; | 734 | return ret; |
717 | } | 735 | } |
736 | ret = device_create_file(&dock_device.dev, &dev_attr_uid); | ||
737 | if (ret) { | ||
738 | printk("Error %d adding sysfs file\n", ret); | ||
739 | platform_device_unregister(&dock_device); | ||
740 | kfree(dock_station); | ||
741 | return ret; | ||
742 | } | ||
718 | 743 | ||
719 | /* Find dependent devices */ | 744 | /* Find dependent devices */ |
720 | acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, | 745 | acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, |