aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorAlex Chiang <achiang@hp.com>2009-05-14 10:31:37 -0400
committerLen Brown <len.brown@intel.com>2009-06-17 22:58:42 -0400
commit0c526d96a5bd86c70507b7d9372e6a26a1e3ea43 (patch)
treebfa8f280a34c5cbb5c9895bde5b7d5096032cd86 /drivers/acpi
parent8b12b922ed5b9b6bfc345d3d6c6de56b2982af7f (diff)
ACPI: clean up whitespace in drivers/acpi/scan.c
Align labels in column 0, adjust spacing in 'if' statements, eliminate trailing and superfluous whitespaces. Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/scan.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index b8f5c005fbb5..c40515e86187 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -198,12 +198,12 @@ acpi_device_path_show(struct device *dev, struct device_attribute *attr, char *b
198 int result; 198 int result;
199 199
200 result = acpi_get_name(acpi_dev->handle, ACPI_FULL_PATHNAME, &path); 200 result = acpi_get_name(acpi_dev->handle, ACPI_FULL_PATHNAME, &path);
201 if(result) 201 if (result)
202 goto end; 202 goto end;
203 203
204 result = sprintf(buf, "%s\n", (char*)path.pointer); 204 result = sprintf(buf, "%s\n", (char*)path.pointer);
205 kfree(path.pointer); 205 kfree(path.pointer);
206 end: 206end:
207 return result; 207 return result;
208} 208}
209static DEVICE_ATTR(path, 0444, acpi_device_path_show, NULL); 209static DEVICE_ATTR(path, 0444, acpi_device_path_show, NULL);
@@ -217,21 +217,21 @@ static int acpi_device_setup_files(struct acpi_device *dev)
217 /* 217 /*
218 * Devices gotten from FADT don't have a "path" attribute 218 * Devices gotten from FADT don't have a "path" attribute
219 */ 219 */
220 if(dev->handle) { 220 if (dev->handle) {
221 result = device_create_file(&dev->dev, &dev_attr_path); 221 result = device_create_file(&dev->dev, &dev_attr_path);
222 if(result) 222 if (result)
223 goto end; 223 goto end;
224 } 224 }
225 225
226 if(dev->flags.hardware_id) { 226 if (dev->flags.hardware_id) {
227 result = device_create_file(&dev->dev, &dev_attr_hid); 227 result = device_create_file(&dev->dev, &dev_attr_hid);
228 if(result) 228 if (result)
229 goto end; 229 goto end;
230 } 230 }
231 231
232 if (dev->flags.hardware_id || dev->flags.compatible_ids){ 232 if (dev->flags.hardware_id || dev->flags.compatible_ids) {
233 result = device_create_file(&dev->dev, &dev_attr_modalias); 233 result = device_create_file(&dev->dev, &dev_attr_modalias);
234 if(result) 234 if (result)
235 goto end; 235 goto end;
236 } 236 }
237 237
@@ -242,7 +242,7 @@ static int acpi_device_setup_files(struct acpi_device *dev)
242 status = acpi_get_handle(dev->handle, "_EJ0", &temp); 242 status = acpi_get_handle(dev->handle, "_EJ0", &temp);
243 if (ACPI_SUCCESS(status)) 243 if (ACPI_SUCCESS(status))
244 result = device_create_file(&dev->dev, &dev_attr_eject); 244 result = device_create_file(&dev->dev, &dev_attr_eject);
245 end: 245end:
246 return result; 246 return result;
247} 247}
248 248
@@ -262,9 +262,9 @@ static void acpi_device_remove_files(struct acpi_device *dev)
262 if (dev->flags.hardware_id || dev->flags.compatible_ids) 262 if (dev->flags.hardware_id || dev->flags.compatible_ids)
263 device_remove_file(&dev->dev, &dev_attr_modalias); 263 device_remove_file(&dev->dev, &dev_attr_modalias);
264 264
265 if(dev->flags.hardware_id) 265 if (dev->flags.hardware_id)
266 device_remove_file(&dev->dev, &dev_attr_hid); 266 device_remove_file(&dev->dev, &dev_attr_hid);
267 if(dev->handle) 267 if (dev->handle)
268 device_remove_file(&dev->dev, &dev_attr_path); 268 device_remove_file(&dev->dev, &dev_attr_path);
269} 269}
270/* -------------------------------------------------------------------------- 270/* --------------------------------------------------------------------------
@@ -512,7 +512,7 @@ static int acpi_device_register(struct acpi_device *device,
512 break; 512 break;
513 } 513 }
514 } 514 }
515 if(!found) { 515 if (!found) {
516 acpi_device_bus_id = new_bus_id; 516 acpi_device_bus_id = new_bus_id;
517 strcpy(acpi_device_bus_id->bus_id, device->flags.hardware_id ? device->pnp.hardware_id : "device"); 517 strcpy(acpi_device_bus_id->bus_id, device->flags.hardware_id ? device->pnp.hardware_id : "device");
518 acpi_device_bus_id->instance_no = 0; 518 acpi_device_bus_id->instance_no = 0;
@@ -532,19 +532,19 @@ static int acpi_device_register(struct acpi_device *device,
532 device->dev.bus = &acpi_bus_type; 532 device->dev.bus = &acpi_bus_type;
533 device->dev.release = &acpi_device_release; 533 device->dev.release = &acpi_device_release;
534 result = device_register(&device->dev); 534 result = device_register(&device->dev);
535 if(result) { 535 if (result) {
536 dev_err(&device->dev, "Error registering device\n"); 536 dev_err(&device->dev, "Error registering device\n");
537 goto end; 537 goto end;
538 } 538 }
539 539
540 result = acpi_device_setup_files(device); 540 result = acpi_device_setup_files(device);
541 if(result) 541 if (result)
542 printk(KERN_ERR PREFIX "Error creating sysfs interface for device %s\n", 542 printk(KERN_ERR PREFIX "Error creating sysfs interface for device %s\n",
543 dev_name(&device->dev)); 543 dev_name(&device->dev));
544 544
545 device->removal_type = ACPI_BUS_REMOVAL_NORMAL; 545 device->removal_type = ACPI_BUS_REMOVAL_NORMAL;
546 return 0; 546 return 0;
547 end: 547end:
548 mutex_lock(&acpi_device_lock); 548 mutex_lock(&acpi_device_lock);
549 if (device->parent) 549 if (device->parent)
550 list_del(&device->node); 550 list_del(&device->node);
@@ -576,7 +576,7 @@ static void acpi_device_unregister(struct acpi_device *device, int type)
576 * @device: the device to add and initialize 576 * @device: the device to add and initialize
577 * @driver: driver for the device 577 * @driver: driver for the device
578 * 578 *
579 * Used to initialize a device via its device driver. Called whenever a 579 * Used to initialize a device via its device driver. Called whenever a
580 * driver is bound to a device. Invokes the driver's add() ops. 580 * driver is bound to a device. Invokes the driver's add() ops.
581 */ 581 */
582static int 582static int
@@ -584,7 +584,6 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver)
584{ 584{
585 int result = 0; 585 int result = 0;
586 586
587
588 if (!device || !driver) 587 if (!device || !driver)
589 return -EINVAL; 588 return -EINVAL;
590 589
@@ -801,7 +800,7 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
801 if (!acpi_match_device_ids(device, button_device_ids)) 800 if (!acpi_match_device_ids(device, button_device_ids))
802 device->wakeup.flags.run_wake = 1; 801 device->wakeup.flags.run_wake = 1;
803 802
804 end: 803end:
805 if (ACPI_FAILURE(status)) 804 if (ACPI_FAILURE(status))
806 device->flags.wake_capable = 0; 805 device->flags.wake_capable = 0;
807 return 0; 806 return 0;
@@ -1069,7 +1068,7 @@ static void acpi_device_set_id(struct acpi_device *device,
1069 break; 1068 break;
1070 } 1069 }
1071 1070
1072 /* 1071 /*
1073 * \_SB 1072 * \_SB
1074 * ---- 1073 * ----
1075 * Fix for the system root bus device -- the only root-level device. 1074 * Fix for the system root bus device -- the only root-level device.
@@ -1319,7 +1318,7 @@ acpi_add_single_object(struct acpi_device **child,
1319 device->parent->ops.bind(device); 1318 device->parent->ops.bind(device);
1320 } 1319 }
1321 1320
1322 end: 1321end:
1323 if (!result) 1322 if (!result)
1324 *child = device; 1323 *child = device;
1325 else { 1324 else {
@@ -1463,7 +1462,6 @@ acpi_bus_add(struct acpi_device **child,
1463 1462
1464 return result; 1463 return result;
1465} 1464}
1466
1467EXPORT_SYMBOL(acpi_bus_add); 1465EXPORT_SYMBOL(acpi_bus_add);
1468 1466
1469int acpi_bus_start(struct acpi_device *device) 1467int acpi_bus_start(struct acpi_device *device)
@@ -1483,7 +1481,6 @@ int acpi_bus_start(struct acpi_device *device)
1483 } 1481 }
1484 return result; 1482 return result;
1485} 1483}
1486
1487EXPORT_SYMBOL(acpi_bus_start); 1484EXPORT_SYMBOL(acpi_bus_start);
1488 1485
1489int acpi_bus_trim(struct acpi_device *start, int rmdevice) 1486int acpi_bus_trim(struct acpi_device *start, int rmdevice)
@@ -1541,7 +1538,6 @@ int acpi_bus_trim(struct acpi_device *start, int rmdevice)
1541} 1538}
1542EXPORT_SYMBOL_GPL(acpi_bus_trim); 1539EXPORT_SYMBOL_GPL(acpi_bus_trim);
1543 1540
1544
1545static int acpi_bus_scan_fixed(struct acpi_device *root) 1541static int acpi_bus_scan_fixed(struct acpi_device *root)
1546{ 1542{
1547 int result = 0; 1543 int result = 0;
@@ -1609,6 +1605,6 @@ int __init acpi_scan_init(void)
1609 if (result) 1605 if (result)
1610 acpi_device_unregister(acpi_root, ACPI_BUS_REMOVAL_NORMAL); 1606 acpi_device_unregister(acpi_root, ACPI_BUS_REMOVAL_NORMAL);
1611 1607
1612 Done: 1608Done:
1613 return result; 1609 return result;
1614} 1610}