Commit 0f8fca15 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[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.
parent 9130c488
...@@ -65,6 +65,14 @@ int i2c_device_remove(struct device *dev) ...@@ -65,6 +65,14 @@ int i2c_device_remove(struct device *dev)
return 0; 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 * registering functions
* --------------------------------------------------- * ---------------------------------------------------
...@@ -106,6 +114,7 @@ int i2c_add_adapter(struct i2c_adapter *adap) ...@@ -106,6 +114,7 @@ int i2c_add_adapter(struct i2c_adapter *adap)
if (adap->dev.parent == NULL) if (adap->dev.parent == NULL)
adap->dev.parent = &legacy_bus; adap->dev.parent = &legacy_bus;
sprintf(adap->dev.bus_id, "i2c-%d", i); sprintf(adap->dev.bus_id, "i2c-%d", i);
adap->dev.driver = &i2c_generic_driver;
device_register(&adap->dev); device_register(&adap->dev);
/* inform drivers of new adapters */ /* inform drivers of new adapters */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment