Skip to contentSkip to conversation

i2c/buses/scx200_acb: handle PCI errors

PATCH In review Jeff Garzik 2 participants 2 messages Oct 10, 2006 – Oct 11, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c/buses/scx200_acb: handle PCI errors

---

 drivers/i2c/busses/scx200_acb.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/i2c/busses/scx200_acb.c +4 -3
index 32aab0d..714bae7 100644
@@ -494,11 +494,12 @@ static __init int scx200_create_pci(cons
 	iface->pdev = pdev;
 	iface->bar = bar;
 
-	pci_enable_device_bars(iface->pdev, 1 << iface->bar);
+	rc = pci_enable_device_bars(iface->pdev, 1 << iface->bar);
+	if (rc)
+		goto errout_free;
 
 	rc = pci_request_region(iface->pdev, iface->bar, iface->adapter.name);
-
-	if (rc != 0) {
+	if (rc) {
 		printk(KERN_ERR NAME ": can't allocate PCI BAR %d\n",
 				iface->bar);
 		goto errout_free;
#1 lore raw

Hi Jeff,

Quoted 13 lines
 drivers/i2c/busses/scx200_acb.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/i2c/busses/scx200_acb.c +1 -1
index 32aab0d..714bae7 100644
@@ -494,11 +494,12 @@ static __init int scx200_create_pci(cons
 	iface->pdev = pdev;
 	iface->bar = bar;
 
-	pci_enable_device_bars(iface->pdev, 1 << iface->bar);
+	rc = pci_enable_device_bars(iface->pdev, 1 << iface->bar);

drivers/i2c/busses/scx200_acb.c static __init int scx200_create_pci(cons · line 505

Quoted 10 lines
drivers/i2c/busses/scx200_acb.c +3 -2
+	if (rc)
+		goto errout_free;
 
 	rc = pci_request_region(iface->pdev, iface->bar, iface->adapter.name);
-
-	if (rc != 0) {
+	if (rc) {
 		printk(KERN_ERR NAME ": can't allocate PCI BAR %d\n",
 				iface->bar);
 		goto errout_free;

Looks good, applied, thanks.

Signature · 1 line
Jean Delvare