aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/dock.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 4546bf873aea..9ddc3f189bb7 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -675,16 +675,15 @@ static ssize_t show_dock_uid(struct device *dev,
675 struct device_attribute *attr, char *buf) 675 struct device_attribute *attr, char *buf)
676{ 676{
677 unsigned long lbuf; 677 unsigned long lbuf;
678 acpi_status status = acpi_evaluate_integer(dock_station->handle, "_UID", NULL, &lbuf); 678 acpi_status status = acpi_evaluate_integer(dock_station->handle,
679 if(ACPI_FAILURE(status)) { 679 "_UID", NULL, &lbuf);
680 if (ACPI_FAILURE(status))
680 return 0; 681 return 0;
681 } 682
682 return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf); 683 return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf);
683} 684}
684DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL); 685DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
685 686
686
687
688/** 687/**
689 * dock_add - add a new dock station 688 * dock_add - add a new dock station
690 * @handle: the dock station handle 689 * @handle: the dock station handle
@@ -736,6 +735,8 @@ static int dock_add(acpi_handle handle)
736 ret = device_create_file(&dock_device.dev, &dev_attr_uid); 735 ret = device_create_file(&dock_device.dev, &dev_attr_uid);
737 if (ret) { 736 if (ret) {
738 printk("Error %d adding sysfs file\n", ret); 737 printk("Error %d adding sysfs file\n", ret);
738 device_remove_file(&dock_device.dev, &dev_attr_docked);
739 device_remove_file(&dock_device.dev, &dev_attr_undock);
739 platform_device_unregister(&dock_device); 740 platform_device_unregister(&dock_device);
740 kfree(dock_station); 741 kfree(dock_station);
741 return ret; 742 return ret;
@@ -775,6 +776,7 @@ dock_add_err:
775dock_add_err_unregister: 776dock_add_err_unregister:
776 device_remove_file(&dock_device.dev, &dev_attr_docked); 777 device_remove_file(&dock_device.dev, &dev_attr_docked);
777 device_remove_file(&dock_device.dev, &dev_attr_undock); 778 device_remove_file(&dock_device.dev, &dev_attr_undock);
779 device_remove_file(&dock_device.dev, &dev_attr_uid);
778 platform_device_unregister(&dock_device); 780 platform_device_unregister(&dock_device);
779 kfree(dock_station); 781 kfree(dock_station);
780 return ret; 782 return ret;
@@ -806,6 +808,7 @@ static int dock_remove(void)
806 /* cleanup sysfs */ 808 /* cleanup sysfs */
807 device_remove_file(&dock_device.dev, &dev_attr_docked); 809 device_remove_file(&dock_device.dev, &dev_attr_docked);
808 device_remove_file(&dock_device.dev, &dev_attr_undock); 810 device_remove_file(&dock_device.dev, &dev_attr_undock);
811 device_remove_file(&dock_device.dev, &dev_attr_uid);
809 platform_device_unregister(&dock_device); 812 platform_device_unregister(&dock_device);
810 813
811 /* free dock station memory */ 814 /* free dock station memory */