Skip to contentSkip to conversation

pciserial_resume_one() should check the return value of pci_enable_device()

PATCH New Simon Horman 1 participant 1 message Feb 14, 2007 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pciserial_resume_one() should check the return value of pci_enable_device()

While compiling Linus' tree this morning, I noticed the following warning, which I believe that the patch below resolves. Of course this assumes that callers of pci_enable_device check its return value, I haven't verified this.

warning: ignoring return value of `pci_enable_device', declared with attribute warn_unused_result

drivers/serial/8250_pci.c +4 -1
Index: linux-2.6/drivers/serial/8250_pci.c
===================================================================
@@ -1819,6 +1819,7 @@
 static int pciserial_resume_one(struct pci_dev *dev)
 {
 	struct serial_private *priv = pci_get_drvdata(dev);
+	int err;
 
 	pci_set_power_state(dev, PCI_D0);
 	pci_restore_state(dev);
@@ -1827,7 +1828,9 @@
 		/*
 		 * The device may have been disabled.  Re-enable it.
 		 */
-		pci_enable_device(dev);
+		err = pci_enable_device(dev);
+		if (err < 0)
+			return err;
 
 		pciserial_resume_ports(priv);
 	}