[ltp] slmodem-2.9.10-abby.diff

Christopher Sawtell linux-thinkpad@linux-thinkpad.org
Fri, 20 May 2005 09:38:34 +1200


--Boundary-00=_adQjCp4blJ/OVT7
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Fri, 20 May 2005 00:51, L.V.Gandhi wrote:
> Can you attach and email the patch to me.
Say "Please" next time.

--
C. S.

--Boundary-00=_adQjCp4blJ/OVT7
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="slmodem-2.9.10-abby.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="slmodem-2.9.10-abby.diff"

--- a/drivers/amrmo_init.c	2004-06-23 21:29:06.000000000 +0200
+++ b/drivers/amrmo_init.c	2004-12-27 18:23:36.000000000 +0100
@@ -692,6 +692,7 @@
 static int __init amrmo_init(void)
 {
 	struct pci_dev *dev = NULL;
+	int register_err;
 #ifdef OLD_KERNEL
 	if (!pci_present())
 		return -ENODEV;
@@ -718,15 +719,8 @@
 				dev->driver->remove(dev);
 			dev->driver = NULL;
 #else
-			struct device *reldev = get_device(&dev->dev);
-			AMRMO_DBG("device %04x:%04x is grabbed by driver %s: try to release\n",
-				  dev->vendor,dev->device,
-				  (reldev&&reldev->driver)?
-				   reldev->driver->name:"unknown");
-			if (reldev) {
-				device_release_driver(reldev);
-				put_device(reldev);
-			}
+			AMRMO_DBG("Another driver has claimed the device . . .\n");
+			return -EBUSY;
 #endif
 		}
 	}
@@ -740,7 +734,9 @@
 	}
 #endif
 
-	if (!pci_register_driver(&amrmo_pci_driver)) {
+	register_err = pci_register_driver(&amrmo_pci_driver);
+	if ( register_err < 0 ) {
+	AMRMO_DBG("error registering device: %d returned by pci_register_driver()", register_err);
 		pci_unregister_driver(&amrmo_pci_driver);
 #ifndef OLD_KERNEL
 		class_simple_destroy(amrmo_class);

--Boundary-00=_adQjCp4blJ/OVT7--