[i2c] [patch 2.6.21-rc3-git +i2c] i2c EXPORT_SYMBOL cleanup

Jean Delvare khali at linux-fr.org
Fri Mar 9 15:13:16 CET 2007


Hi David,

On Thu, 8 Mar 2007 21:25:05 -0800, David Brownell wrote:
> Make i2c-core.c obey Documentation/CodingStyle better by snugging
> the EXPORT_SYMBOL declarations next to the relevant definitions.
> 
> Signed-off-by: David Brownell <dbrownell at users.sourceforge.net>
> ---
> This goes ON TOP OF the previous five patches supporting new-style drivers.
> 
>  drivers/i2c/i2c-core.c |   64 +++++++++++++++++++++----------------------------
>  1 files changed, 28 insertions(+), 36 deletions(-)
> 
> Index: at91/drivers/i2c/i2c-core.c
> ===================================================================
> --- at91.orig/drivers/i2c/i2c-core.c	2007-03-08 20:16:02.000000000 -0800
> +++ at91/drivers/i2c/i2c-core.c	2007-03-08 20:41:51.000000000 -0800
> @@ -195,6 +195,7 @@ struct bus_type i2c_bus_type = {
>  	.suspend	= i2c_device_suspend,
>  	.resume		= i2c_device_resume,
>  };
> +EXPORT_SYMBOL_GPL(i2c_bus_type);

Any reason why this one doesn't have its "/* exported to i2c-isa */"
comment?

>  
>  /**
>   * i2c_new_device - instantiate an i2c device for use with a new style driver
> @@ -293,6 +294,7 @@ void i2c_adapter_dev_release(struct devi
>  	struct i2c_adapter *adap = to_i2c_adapter(dev);
>  	complete(&adap->dev_released);
>  }
> +EXPORT_SYMBOL_GPL(i2c_adapter_dev_release);	/* exported to i2c-isa */
>  
>  static ssize_t
>  show_adapter_name(struct device *dev, struct device_attribute *attr, char *buf)
> @@ -311,6 +313,7 @@ struct class i2c_adapter_class = {
>  	.name			= "i2c-adapter",
>  	.dev_attrs		= i2c_adapter_attrs,
>  };
> +EXPORT_SYMBOL_GPL(i2c_adapter_class);		/* exported to i2c-isa */

BTW, I think I'll move the declarations of these
exported-to-i2c-isa-only symbols from i2c.h to i2c-isa.c itself. Best
way to make sure nobody gets tempted to use them. Hopefully we'll
remove the exports themselves soon anyway.

-- 
Jean Delvare



More information about the i2c mailing list