struct device_attribute *attr, char *buf)
{
unsigned long lbuf;
- acpi_status status = acpi_evaluate_integer(dock_station->handle, "_UID", NULL, &lbuf);
- if(ACPI_FAILURE(status)) {
+ acpi_status status = acpi_evaluate_integer(dock_station->handle,
+ "_UID", NULL, &lbuf);
+ if (ACPI_FAILURE(status))
return 0;
- }
+
return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf);
}
DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
-
-
/**
* dock_add - add a new dock station
* @handle: the dock station handle
ret = device_create_file(&dock_device.dev, &dev_attr_uid);
if (ret) {
printk("Error %d adding sysfs file\n", ret);
+ device_remove_file(&dock_device.dev, &dev_attr_docked);
+ device_remove_file(&dock_device.dev, &dev_attr_undock);
platform_device_unregister(&dock_device);
kfree(dock_station);
return ret;
dock_add_err_unregister:
device_remove_file(&dock_device.dev, &dev_attr_docked);
device_remove_file(&dock_device.dev, &dev_attr_undock);
+ device_remove_file(&dock_device.dev, &dev_attr_uid);
platform_device_unregister(&dock_device);
kfree(dock_station);
return ret;
/* cleanup sysfs */
device_remove_file(&dock_device.dev, &dev_attr_docked);
device_remove_file(&dock_device.dev, &dev_attr_undock);
+ device_remove_file(&dock_device.dev, &dev_attr_uid);
platform_device_unregister(&dock_device);
/* free dock station memory */