Re: [PATCH] i2c driver changes for 2.5.66

From: Greg KH (greg@kroah.com)
Date: Mon Mar 24 2003 - 20:38:03 EST


ChangeSet 1.985.1.4, 2003/03/24 15:16:12-08:00, greg@kroah.com

[PATCH] i2c: set up a "generic" i2c driver to prevent oopses when devices are registering.

This is needed as we are still not using the driver core model for
matching up devices to drivers, but doing it by hand. Once that is
changed, this will not be needed.

 drivers/i2c/i2c-core.c | 9 +++++++++
 1 files changed, 9 insertions(+)

diff -Nru a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
--- a/drivers/i2c/i2c-core.c Mon Mar 24 17:26:51 2003
+++ b/drivers/i2c/i2c-core.c Mon Mar 24 17:26:51 2003
@@ -65,6 +65,14 @@
         return 0;
 }
 
+static struct device_driver i2c_generic_driver = {
+ .name = "i2c",
+ .bus = &i2c_bus_type,
+ .probe = i2c_device_probe,
+ .remove = i2c_device_remove,
+};
+
+
 /* ---------------------------------------------------
  * registering functions
  * ---------------------------------------------------
@@ -106,6 +114,7 @@
         if (adap->dev.parent == NULL)
                 adap->dev.parent = &legacy_bus;
         sprintf(adap->dev.bus_id, "i2c-%d", i);
+ adap->dev.driver = &i2c_generic_driver;
         device_register(&adap->dev);
 
         /* inform drivers of new adapters */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Mar 31 2003 - 22:00:18 EST