aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2009-02-03 11:55:19 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-03-24 15:56:48 -0400
commite1eff7a393d4a4e3ad1cf65fcba899146840bfd2 (patch)
tree88a040babea1853f40072ed199a78b60f4dcb387 /drivers/firewire
parentd01b01787680a1156ff6a554e40baa460bb88efb (diff)
firewire: normalize a variable name
Standardize on if (err) handle_error; and if (ret < 0) handle_error; Don't call a variable err if we store values in it which mean success. Also, offset some return statements by a blank line since this how we do it in drivers/firewire. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/fw-card.c9
-rw-r--r--drivers/firewire/fw-device.c6
-rw-r--r--drivers/firewire/fw-iso.c10
-rw-r--r--drivers/firewire/fw-ohci.c3
4 files changed, 16 insertions, 12 deletions
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 27a3aae58cfd..08a7e18526ee 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -404,7 +404,7 @@ int fw_card_add(struct fw_card *card,
404{ 404{
405 u32 *config_rom; 405 u32 *config_rom;
406 size_t length; 406 size_t length;
407 int err; 407 int ret;
408 408
409 card->max_receive = max_receive; 409 card->max_receive = max_receive;
410 card->link_speed = link_speed; 410 card->link_speed = link_speed;
@@ -415,13 +415,14 @@ int fw_card_add(struct fw_card *card,
415 list_add_tail(&card->link, &card_list); 415 list_add_tail(&card->link, &card_list);
416 mutex_unlock(&card_mutex); 416 mutex_unlock(&card_mutex);
417 417
418 err = card->driver->enable(card, config_rom, length); 418 ret = card->driver->enable(card, config_rom, length);
419 if (err < 0) { 419 if (ret < 0) {
420 mutex_lock(&card_mutex); 420 mutex_lock(&card_mutex);
421 list_del(&card->link); 421 list_del(&card->link);
422 mutex_unlock(&card_mutex); 422 mutex_unlock(&card_mutex);
423 } 423 }
424 return err; 424
425 return ret;
425} 426}
426EXPORT_SYMBOL(fw_card_add); 427EXPORT_SYMBOL(fw_card_add);
427 428
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index df789d321d1b..633e44de5d1a 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -761,7 +761,7 @@ static void fw_device_init(struct work_struct *work)
761 struct fw_device *device = 761 struct fw_device *device =
762 container_of(work, struct fw_device, work.work); 762 container_of(work, struct fw_device, work.work);
763 struct device *revived_dev; 763 struct device *revived_dev;
764 int minor, err; 764 int minor, ret;
765 765
766 /* 766 /*
767 * All failure paths here set node->data to NULL, so that we 767 * All failure paths here set node->data to NULL, so that we
@@ -797,12 +797,12 @@ static void fw_device_init(struct work_struct *work)
797 797
798 fw_device_get(device); 798 fw_device_get(device);
799 down_write(&fw_device_rwsem); 799 down_write(&fw_device_rwsem);
800 err = idr_pre_get(&fw_device_idr, GFP_KERNEL) ? 800 ret = idr_pre_get(&fw_device_idr, GFP_KERNEL) ?
801 idr_get_new(&fw_device_idr, device, &minor) : 801 idr_get_new(&fw_device_idr, device, &minor) :
802 -ENOMEM; 802 -ENOMEM;
803 up_write(&fw_device_rwsem); 803 up_write(&fw_device_rwsem);
804 804
805 if (err < 0) 805 if (ret < 0)
806 goto error; 806 goto error;
807 807
808 device->device.bus = &fw_bus_type; 808 device->device.bus = &fw_bus_type;
diff --git a/drivers/firewire/fw-iso.c b/drivers/firewire/fw-iso.c
index f511d16efaee..2baf1007253e 100644
--- a/drivers/firewire/fw-iso.c
+++ b/drivers/firewire/fw-iso.c
@@ -75,19 +75,21 @@ int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
75 kfree(buffer->pages); 75 kfree(buffer->pages);
76 out: 76 out:
77 buffer->pages = NULL; 77 buffer->pages = NULL;
78
78 return -ENOMEM; 79 return -ENOMEM;
79} 80}
80 81
81int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma) 82int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma)
82{ 83{
83 unsigned long uaddr; 84 unsigned long uaddr;
84 int i, ret; 85 int i, err;
85 86
86 uaddr = vma->vm_start; 87 uaddr = vma->vm_start;
87 for (i = 0; i < buffer->page_count; i++) { 88 for (i = 0; i < buffer->page_count; i++) {
88 ret = vm_insert_page(vma, uaddr, buffer->pages[i]); 89 err = vm_insert_page(vma, uaddr, buffer->pages[i]);
89 if (ret) 90 if (err)
90 return ret; 91 return err;
92
91 uaddr += PAGE_SIZE; 93 uaddr += PAGE_SIZE;
92 } 94 }
93 95
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 859af71b06a8..c92278374658 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -2459,11 +2459,12 @@ static int __devinit pci_probe(struct pci_dev *dev,
2459 reg_read(ohci, OHCI1394_GUIDLo); 2459 reg_read(ohci, OHCI1394_GUIDLo);
2460 2460
2461 err = fw_card_add(&ohci->card, max_receive, link_speed, guid); 2461 err = fw_card_add(&ohci->card, max_receive, link_speed, guid);
2462 if (err < 0) 2462 if (err)
2463 goto fail_self_id; 2463 goto fail_self_id;
2464 2464
2465 fw_notify("Added fw-ohci device %s, OHCI version %x.%x\n", 2465 fw_notify("Added fw-ohci device %s, OHCI version %x.%x\n",
2466 dev_name(&dev->dev), version >> 16, version & 0xff); 2466 dev_name(&dev->dev), version >> 16, version & 0xff);
2467
2467 return 0; 2468 return 0;
2468 2469
2469 fail_self_id: 2470 fail_self_id: