[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1203368213-30528-1-git-send-email-gcosta@redhat.com>
Date: Mon, 18 Feb 2008 17:56:50 -0300
From: Glauber Costa <gcosta@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: akpm@...ux-foundation.org, andrew.grover@...el.com,
paul.s.diefenbaugh@...el.com, linux@...do.de,
anil.s.keshavamurthy@...el.com, lenb@...nel.org,
linux-acpi@...r.kernel.org, Glauber Costa <gcosta@...hat.com>
Subject: [PATCH 1/4] make cdev attribuition the last step
This patch uses a temporary variable "cdev" instead of using
directly pr->cdev. Through it, we can tell later whether or not
this code was completed properly: by checking for pr->cdev != NULL
Signed-off-by: Glauber Costa <gcosta@...hat.com>
---
drivers/acpi/processor_core.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 75ccf5d..9480203 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -622,7 +622,7 @@ static int __cpuinit acpi_processor_star
int result = 0;
acpi_status status = AE_OK;
struct acpi_processor *pr;
-
+ struct thermal_cooling_device *cdev;
pr = acpi_driver_data(device);
@@ -668,24 +668,26 @@ #endif
acpi_processor_power_init(pr, device);
- pr->cdev = thermal_cooling_device_register("Processor", device,
+ cdev = thermal_cooling_device_register("Processor", device,
&processor_cooling_ops);
- if (pr->cdev)
+ if (cdev)
printk(KERN_INFO PREFIX
"%s is registered as cooling_device%d\n",
- device->dev.bus_id, pr->cdev->id);
+ device->dev.bus_id, cdev->id);
else
goto end;
- result = sysfs_create_link(&device->dev.kobj, &pr->cdev->device.kobj,
+ result = sysfs_create_link(&device->dev.kobj, &cdev->device.kobj,
"thermal_cooling");
if (result)
return result;
- result = sysfs_create_link(&pr->cdev->device.kobj, &device->dev.kobj,
+ result = sysfs_create_link(&cdev->device.kobj, &device->dev.kobj,
"device");
if (result)
return result;
+ pr->cdev = cdev;
+
if (pr->flags.throttling) {
printk(KERN_INFO PREFIX "%s [%s] (supports",
acpi_device_name(device), acpi_device_bid(device));
--
1.4.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists