From: Len Brown Date: Wed, 16 Dec 2009 08:33:28 +0000 (-0500) Subject: Merge branch 'dock' into release X-Git-Tag: v5.15~31110^2~4 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=f02f465b1cdcdf7485f89ec019e6cceaf80cadd5;p=mirror_ubuntu-kernels.git Merge branch 'dock' into release Conflicts: drivers/acpi/dock.c Signed-off-by: Len Brown --- f02f465b1cdcdf7485f89ec019e6cceaf80cadd5 diff --cc drivers/acpi/dock.c index 30be3c148f7e,d4c3d82bef3f..bbc2c1315c47 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@@ -986,62 -962,18 +962,19 @@@ static int dock_add(acpi_handle handle if (is_battery(handle)) dock_station->flags |= DOCK_IS_BAT; - ret = device_create_file(&dock_device->dev, &dev_attr_docked); - if (ret) { - printk(KERN_ERR "Error %d adding sysfs file\n", ret); - platform_device_unregister(dock_device); - kfree(dock_station); - dock_station = NULL; - return ret; - } - ret = device_create_file(&dock_device->dev, &dev_attr_undock); - if (ret) { - printk(KERN_ERR "Error %d adding sysfs file\n", ret); - device_remove_file(&dock_device->dev, &dev_attr_docked); - platform_device_unregister(dock_device); - kfree(dock_station); - dock_station = NULL; - return ret; - } - ret = device_create_file(&dock_device->dev, &dev_attr_uid); - if (ret) { - printk(KERN_ERR "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); - dock_station = NULL; - return ret; - } - ret = device_create_file(&dock_device->dev, &dev_attr_flags); - if (ret) { - printk(KERN_ERR "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); - device_remove_file(&dock_device->dev, &dev_attr_uid); - platform_device_unregister(dock_device); - kfree(dock_station); - dock_station = NULL; - return ret; - } - ret = device_create_file(&dock_device->dev, &dev_attr_type); + ret = sysfs_create_group(&dd->dev.kobj, &dock_attribute_group); if (ret) - printk(KERN_ERR"Error %d adding sysfs file\n", ret); + goto err_unregister; /* Find dependent devices */ - acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - find_dock_devices, dock_station, NULL); + acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, find_dock_devices, NULL, + dock_station, NULL); /* add the dock station as a device dependent on itself */ - dd = alloc_dock_dependent_device(handle); - if (!dd) { - kfree(dock_station); - dock_station = NULL; - ret = -ENOMEM; - goto dock_add_err_unregister; - } - add_dock_dependent_device(dock_station, dd); + ret = add_dock_dependent_device(dock_station, handle); + if (ret) + goto err_rmgroup; dock_station_count++; list_add(&dock_station->sibling, &dock_stations);