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