aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2010-11-29 02:14:10 -0500
committerMatthew Garrett <mjg@redhat.com>2011-01-07 17:03:43 -0500
commit2a3f0064f2a06d5a31cddb0e452681d9f884bd8c (patch)
tree267c9945eb7b45b61176585eb1367cd39bf6ff78 /drivers/platform
parent8c1b2d83e82e11b9447d7fb3715d6c9764f6f28d (diff)
eeepc-wmi: fix confusion between ctrl_param and retval
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/eeepc-wmi.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index 253070ab963c..78306bea01f7 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -164,7 +164,7 @@ static void eeepc_wmi_input_exit(struct eeepc_wmi *eeepc)
164 eeepc->inputdev = NULL; 164 eeepc->inputdev = NULL;
165} 165}
166 166
167static acpi_status eeepc_wmi_get_devstate(u32 dev_id, u32 *ctrl_param) 167static acpi_status eeepc_wmi_get_devstate(u32 dev_id, u32 *retval)
168{ 168{
169 struct acpi_buffer input = { (acpi_size)sizeof(u32), &dev_id }; 169 struct acpi_buffer input = { (acpi_size)sizeof(u32), &dev_id };
170 struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; 170 struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -184,8 +184,8 @@ static acpi_status eeepc_wmi_get_devstate(u32 dev_id, u32 *ctrl_param)
184 else 184 else
185 tmp = 0; 185 tmp = 0;
186 186
187 if (ctrl_param) 187 if (retval)
188 *ctrl_param = tmp; 188 *retval = tmp;
189 189
190 kfree(obj); 190 kfree(obj);
191 191
@@ -266,14 +266,14 @@ static void tpd_led_set(struct led_classdev *led_cdev,
266 266
267static int read_tpd_state(struct eeepc_wmi *eeepc) 267static int read_tpd_state(struct eeepc_wmi *eeepc)
268{ 268{
269 static u32 ctrl_param; 269 static u32 retval;
270 acpi_status status; 270 acpi_status status;
271 271
272 status = eeepc_wmi_get_devstate(EEEPC_WMI_DEVID_TPDLED, &ctrl_param); 272 status = eeepc_wmi_get_devstate(EEEPC_WMI_DEVID_TPDLED, &retval);
273 273
274 if (ACPI_FAILURE(status)) 274 if (ACPI_FAILURE(status))
275 return -1; 275 return -1;
276 else if (!ctrl_param || ctrl_param == 0x00060000) 276 else if (!retval || retval == 0x00060000)
277 /* 277 /*
278 * if touchpad led is present, DSTS will set some bits, 278 * if touchpad led is present, DSTS will set some bits,
279 * usually 0x00020000. 279 * usually 0x00020000.
@@ -282,7 +282,7 @@ static int read_tpd_state(struct eeepc_wmi *eeepc)
282 return -ENODEV; 282 return -ENODEV;
283 else 283 else
284 /* Status is stored in the first bit */ 284 /* Status is stored in the first bit */
285 return ctrl_param & 0x1; 285 return retval & 0x1;
286} 286}
287 287
288static enum led_brightness tpd_led_get(struct led_classdev *led_cdev) 288static enum led_brightness tpd_led_get(struct led_classdev *led_cdev)
@@ -343,15 +343,15 @@ static int eeepc_rfkill_set(void *data, bool blocked)
343static void eeepc_rfkill_query(struct rfkill *rfkill, void *data) 343static void eeepc_rfkill_query(struct rfkill *rfkill, void *data)
344{ 344{
345 int dev_id = (unsigned long)data; 345 int dev_id = (unsigned long)data;
346 u32 ctrl_param; 346 u32 retval;
347 acpi_status status; 347 acpi_status status;
348 348
349 status = eeepc_wmi_get_devstate(dev_id, &ctrl_param); 349 status = eeepc_wmi_get_devstate(dev_id, &retval);
350 350
351 if (ACPI_FAILURE(status)) 351 if (ACPI_FAILURE(status))
352 return ; 352 return ;
353 353
354 rfkill_set_sw_state(rfkill, !(ctrl_param & 0x1)); 354 rfkill_set_sw_state(rfkill, !(retval & 0x1));
355} 355}
356 356
357static const struct rfkill_ops eeepc_rfkill_ops = { 357static const struct rfkill_ops eeepc_rfkill_ops = {
@@ -365,10 +365,10 @@ static int eeepc_new_rfkill(struct eeepc_wmi *eeepc,
365 enum rfkill_type type, int dev_id) 365 enum rfkill_type type, int dev_id)
366{ 366{
367 int result; 367 int result;
368 u32 ctrl_param; 368 u32 retval;
369 acpi_status status; 369 acpi_status status;
370 370
371 status = eeepc_wmi_get_devstate(dev_id, &ctrl_param); 371 status = eeepc_wmi_get_devstate(dev_id, &retval);
372 372
373 if (ACPI_FAILURE(status)) 373 if (ACPI_FAILURE(status))
374 return -1; 374 return -1;
@@ -379,7 +379,7 @@ static int eeepc_new_rfkill(struct eeepc_wmi *eeepc,
379 * 0x00020000 - 0100000000000000000 - device supported 379 * 0x00020000 - 0100000000000000000 - device supported
380 * 0x00010000 - 0010000000000000000 - not supported / special mode ? 380 * 0x00010000 - 0010000000000000000 - not supported / special mode ?
381 */ 381 */
382 if (!ctrl_param || ctrl_param == 0x00060000) 382 if (!retval || retval == 0x00060000)
383 return -ENODEV; 383 return -ENODEV;
384 384
385 *rfkill = rfkill_alloc(name, &eeepc->platform_device->dev, type, 385 *rfkill = rfkill_alloc(name, &eeepc->platform_device->dev, type,
@@ -388,7 +388,7 @@ static int eeepc_new_rfkill(struct eeepc_wmi *eeepc,
388 if (!*rfkill) 388 if (!*rfkill)
389 return -EINVAL; 389 return -EINVAL;
390 390
391 rfkill_init_sw_state(*rfkill, !(ctrl_param & 0x1)); 391 rfkill_init_sw_state(*rfkill, !(retval & 0x1));
392 result = rfkill_register(*rfkill); 392 result = rfkill_register(*rfkill);
393 if (result) { 393 if (result) {
394 rfkill_destroy(*rfkill); 394 rfkill_destroy(*rfkill);
@@ -457,15 +457,15 @@ exit:
457 */ 457 */
458static int read_brightness(struct backlight_device *bd) 458static int read_brightness(struct backlight_device *bd)
459{ 459{
460 static u32 ctrl_param; 460 static u32 retval;
461 acpi_status status; 461 acpi_status status;
462 462
463 status = eeepc_wmi_get_devstate(EEEPC_WMI_DEVID_BACKLIGHT, &ctrl_param); 463 status = eeepc_wmi_get_devstate(EEEPC_WMI_DEVID_BACKLIGHT, &retval);
464 464
465 if (ACPI_FAILURE(status)) 465 if (ACPI_FAILURE(status))
466 return -1; 466 return -1;
467 else 467 else
468 return ctrl_param & 0xFF; 468 return retval & 0xFF;
469} 469}
470 470
471static int update_bl_status(struct backlight_device *bd) 471static int update_bl_status(struct backlight_device *bd)