Skip to contentSkip to conversation

leds: fix the return value of ich7_lpc_probe.

PATCH In review Thiago Farina 2 participants 2 messages Nov 28, 2009 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds: fix the return value of ich7_lpc_probe.

In the function ich7_lpc_probe there is a 'return' that is not returning any value, but it should because the return type is int not void.

---
 drivers/leds/leds-ss4200.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/leds/leds-ss4200.c +1 -1
index c7f6347..a0c4092 100644
@@ -350,7 +350,7 @@ static int __devinit ich7_lpc_probe(struct pci_dev *dev,
 	status = pci_enable_device(dev);
 	if (status) {
 		dev_err(&dev->dev, "pci_enable_device failed\n");
-		return;
+		return status;
 	}
 
 	nas_gpio_pci_dev = dev;
Signature · 1 line
1.6.6.rc0.61.g41d5b
#1 lore raw
Quoted 13 lines · Thiago Farina

In the function ich7_lpc_probe there is a 'return' that is not returning any value, but it should because the return type is int not void.

---
 drivers/leds/leds-ss4200.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/leds/leds-ss4200.c +0 -0
index c7f6347..a0c4092 100644

drivers/leds/leds-ss4200.c static int __devinit ich7_lpc_probe(struct pci_dev *dev, · line 354

Quoted 6 lines
drivers/leds/leds-ss4200.c +1 -1
@@ -350,7 +350,7 @@ static int __devinit ich7_lpc_probe(struct pci_dev *dev,
 	status = pci_enable_device(dev);
 	if (status) {
 		dev_err(&dev->dev, "pci_enable_device failed\n");
-		return;
+		return status;
 	}

There's a patch in -mm to do something similar. It should be pushed upstream when the next set of -mm patches goes.

http://userweb.kernel.org/~akpm/mmotm/broken-out/drivers-leds-leds-ss4200c-fix-return-statement.patch

Thanks for posting this, though.

-- Dave