浏览代码

[PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (1/9)

Temporarily export a few structures and functions from i2c-core, because we
will soon need them in i2c-isa.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jean Delvare 20 年之前
父节点
当前提交
efde723fda
共有 2 个文件被更改,包括 17 次插入4 次删除
  1. 10 4
      drivers/i2c/i2c-core.c
  2. 7 0
      include/linux/i2c.h

+ 10 - 4
drivers/i2c/i2c-core.c

@@ -61,7 +61,7 @@ static int i2c_bus_resume(struct device * dev)
 	return rc;
 	return rc;
 }
 }
 
 
-static struct bus_type i2c_bus_type = {
+struct bus_type i2c_bus_type = {
 	.name =		"i2c",
 	.name =		"i2c",
 	.match =	i2c_device_match,
 	.match =	i2c_device_match,
 	.suspend =      i2c_bus_suspend,
 	.suspend =      i2c_bus_suspend,
@@ -78,13 +78,13 @@ static int i2c_device_remove(struct device *dev)
 	return 0;
 	return 0;
 }
 }
 
 
-static void i2c_adapter_dev_release(struct device *dev)
+void i2c_adapter_dev_release(struct device *dev)
 {
 {
 	struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
 	struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
 	complete(&adap->dev_released);
 	complete(&adap->dev_released);
 }
 }
 
 
-static struct device_driver i2c_adapter_driver = {
+struct device_driver i2c_adapter_driver = {
 	.name =	"i2c_adapter",
 	.name =	"i2c_adapter",
 	.bus = &i2c_bus_type,
 	.bus = &i2c_bus_type,
 	.probe = i2c_device_probe,
 	.probe = i2c_device_probe,
@@ -97,7 +97,7 @@ static void i2c_adapter_class_dev_release(struct class_device *dev)
 	complete(&adap->class_dev_released);
 	complete(&adap->class_dev_released);
 }
 }
 
 
-static struct class i2c_adapter_class = {
+struct class i2c_adapter_class = {
 	.name =		"i2c-adapter",
 	.name =		"i2c-adapter",
 	.release =	&i2c_adapter_class_dev_release,
 	.release =	&i2c_adapter_class_dev_release,
 };
 };
@@ -1171,6 +1171,12 @@ s32 i2c_smbus_xfer(struct i2c_adapter * adapter, u16 addr, unsigned short flags,
 }
 }
 
 
 
 
+/* Next four are needed by i2c-isa */
+EXPORT_SYMBOL_GPL(i2c_adapter_dev_release);
+EXPORT_SYMBOL_GPL(i2c_adapter_driver);
+EXPORT_SYMBOL_GPL(i2c_adapter_class);
+EXPORT_SYMBOL_GPL(i2c_bus_type);
+
 EXPORT_SYMBOL(i2c_add_adapter);
 EXPORT_SYMBOL(i2c_add_adapter);
 EXPORT_SYMBOL(i2c_del_adapter);
 EXPORT_SYMBOL(i2c_del_adapter);
 EXPORT_SYMBOL(i2c_add_driver);
 EXPORT_SYMBOL(i2c_add_driver);

+ 7 - 0
include/linux/i2c.h

@@ -34,6 +34,13 @@
 #include <linux/device.h>	/* for struct device */
 #include <linux/device.h>	/* for struct device */
 #include <asm/semaphore.h>
 #include <asm/semaphore.h>
 
 
+/* --- For i2c-isa ---------------------------------------------------- */
+
+extern void i2c_adapter_dev_release(struct device *dev);
+extern struct device_driver i2c_adapter_driver;
+extern struct class i2c_adapter_class;
+extern struct bus_type i2c_bus_type;
+
 /* --- General options ------------------------------------------------	*/
 /* --- General options ------------------------------------------------	*/
 
 
 struct i2c_msg;
 struct i2c_msg;