Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (38 sloc) 1.19 KB
===== via686a.c 1.52 vs edited =====
--- 1.52/drivers/i2c/chips/via686a.c 2005-01-11 12:26:15 -08:00
+++ edited/via686a.c 2005-01-14 10:55:19 -08:00
@@ -815,13 +815,21 @@
return -ENODEV;
}
normal_isa[0] = addr;
- s_bridge = dev;
- return i2c_add_driver(&via686a_driver);
+ s_bridge = pci_dev_get(dev);
+ if (i2c_add_driver(&via686a_driver)) {
+ pci_dev_put(s_bridge);
+ s_bridge = NULL;
+ }
+
+ /* Always return failure here. This is to allow other drivers to bind
+ * to this pci device. We don't really want to have control over the
+ * pci device, we only wanted to read as few register values from it.
+ * */
+ return -ENODEV;
}
static void __devexit via686a_pci_remove(struct pci_dev *dev)
{
- i2c_del_driver(&via686a_driver);
}
static struct pci_driver via686a_pci_driver = {
@@ -838,7 +846,12 @@
static void __exit sm_via686a_exit(void)
{
- pci_unregister_driver(&via686a_pci_driver);
+ pci_unregister_driver(&via686a_pci_driver);
+ if (s_bridge != NULL) {
+ i2c_del_driver(&via686a_driver);
+ pci_dev_put(s_bridge);
+ s_bridge = NULL;
+ }
}
MODULE_AUTHOR("Kyösti Mälkki <kmalkki@cc.hut.fi>, "