X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmisc%2Fintel_menlow.c;h=80a1363524087a1e66e575058360d071bbca352f;hb=e08c1694d9e2138204f2b79b73f0f159074ce2f5;hp=f70984ab1e1bdfd2c1aa25a32108f6b96117f83b;hpb=81e242d0efafb319938d511b115088a5c4523c91;p=linux-2.6 diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c index f70984ab1e..80a1363524 100644 --- a/drivers/misc/intel_menlow.c +++ b/drivers/misc/intel_menlow.c @@ -170,21 +170,22 @@ static int intel_menlow_memory_add(struct acpi_device *device) cdev = thermal_cooling_device_register("Memory controller", device, &memory_cooling_ops); + if (IS_ERR(cdev)) { + result = PTR_ERR(cdev); + goto end; + } + acpi_driver_data(device) = cdev; - if (!cdev) - result = -ENODEV; - else { - result = sysfs_create_link(&device->dev.kobj, - &cdev->device.kobj, "thermal_cooling"); - if (result) - goto unregister; - - result = sysfs_create_link(&cdev->device.kobj, - &device->dev.kobj, "device"); - if (result) { - sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); - goto unregister; - } + result = sysfs_create_link(&device->dev.kobj, + &cdev->device.kobj, "thermal_cooling"); + if (result) + goto unregister; + + result = sysfs_create_link(&cdev->device.kobj, + &device->dev.kobj, "device"); + if (result) { + sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); + goto unregister; } end: @@ -210,7 +211,7 @@ static int intel_menlow_memory_remove(struct acpi_device *device, int type) return 0; } -const static struct acpi_device_id intel_menlow_memory_ids[] = { +static const struct acpi_device_id intel_menlow_memory_ids[] = { {"INT0002", 0}, {"", 0}, };