* [2.6 patch] drivers/i2c/i2c-core.c: make code static
@ 2007-07-29 14:57 Adrian Bunk
2007-08-09 9:05 ` Jean Delvare
0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2007-07-29 14:57 UTC (permalink / raw)
To: khali; +Cc: i2c, linux-kernel
After the i2c-isa removal some code can become static.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/i2c/i2c-core.c | 7 +++----
include/linux/i2c.h | 2 --
2 files changed, 3 insertions(+), 6 deletions(-)
--- linux-2.6.23-rc1-mm1/include/linux/i2c.h.old 2007-07-26 12:46:44.000000000 +0200
+++ linux-2.6.23-rc1-mm1/include/linux/i2c.h 2007-07-26 12:46:53.000000000 +0200
@@ -35,8 +35,6 @@
#include <linux/sched.h> /* for completion */
#include <linux/mutex.h>
-extern struct bus_type i2c_bus_type;
-
/* --- General options ------------------------------------------------ */
struct i2c_msg;
--- linux-2.6.23-rc1-mm1/drivers/i2c/i2c-core.c.old 2007-07-26 08:59:44.000000000 +0200
+++ linux-2.6.23-rc1-mm1/drivers/i2c/i2c-core.c 2007-07-26 09:01:42.000000000 +0200
@@ -190,7 +190,7 @@
{ },
};
-struct bus_type i2c_bus_type = {
+static struct bus_type i2c_bus_type = {
.name = "i2c",
.dev_attrs = i2c_dev_attrs,
.match = i2c_device_match,
@@ -201,7 +201,6 @@
.suspend = i2c_device_suspend,
.resume = i2c_device_resume,
};
-EXPORT_SYMBOL_GPL(i2c_bus_type);
/**
* i2c_new_device - instantiate an i2c device for use with a new style driver
@@ -285,7 +284,7 @@
/* I2C bus adapters -- one roots each I2C or SMBUS segment */
-void i2c_adapter_dev_release(struct device *dev)
+static void i2c_adapter_dev_release(struct device *dev)
{
struct i2c_adapter *adap = to_i2c_adapter(dev);
complete(&adap->dev_released);
@@ -303,7 +302,7 @@
{ },
};
-struct class i2c_adapter_class = {
+static struct class i2c_adapter_class = {
.owner = THIS_MODULE,
.name = "i2c-adapter",
.dev_attrs = i2c_adapter_attrs,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.6 patch] drivers/i2c/i2c-core.c: make code static
2007-07-29 14:57 [2.6 patch] drivers/i2c/i2c-core.c: make code static Adrian Bunk
@ 2007-08-09 9:05 ` Jean Delvare
2007-08-09 15:39 ` David Brownell
0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2007-08-09 9:05 UTC (permalink / raw)
To: Adrian Bunk; +Cc: i2c, linux-kernel, David Brownell
Hi Adrian,
On Sun, 29 Jul 2007 16:57:08 +0200, Adrian Bunk wrote:
> After the i2c-isa removal some code can become static.
>
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
>
> ---
>
> drivers/i2c/i2c-core.c | 7 +++----
> include/linux/i2c.h | 2 --
> 2 files changed, 3 insertions(+), 6 deletions(-)
>
> --- linux-2.6.23-rc1-mm1/include/linux/i2c.h.old 2007-07-26 12:46:44.000000000 +0200
> +++ linux-2.6.23-rc1-mm1/include/linux/i2c.h 2007-07-26 12:46:53.000000000 +0200
> @@ -35,8 +35,6 @@
> #include <linux/sched.h> /* for completion */
> #include <linux/mutex.h>
>
> -extern struct bus_type i2c_bus_type;
> -
> /* --- General options ------------------------------------------------ */
>
> struct i2c_msg;
> --- linux-2.6.23-rc1-mm1/drivers/i2c/i2c-core.c.old 2007-07-26 08:59:44.000000000 +0200
> +++ linux-2.6.23-rc1-mm1/drivers/i2c/i2c-core.c 2007-07-26 09:01:42.000000000 +0200
> @@ -190,7 +190,7 @@
> { },
> };
>
> -struct bus_type i2c_bus_type = {
> +static struct bus_type i2c_bus_type = {
> .name = "i2c",
> .dev_attrs = i2c_dev_attrs,
> .match = i2c_device_match,
> @@ -201,7 +201,6 @@
> .suspend = i2c_device_suspend,
> .resume = i2c_device_resume,
> };
> -EXPORT_SYMBOL_GPL(i2c_bus_type);
This one was left exported on request by David Brownell. See this
discussion thread:
http://lists.lm-sensors.org/pipermail/i2c/2007-March/000924.html
I am personally fine with removing this export, as it can always be
added later if needed. But if others share David's point of view, I am
also fine leaving the export as is.
>
> /**
> * i2c_new_device - instantiate an i2c device for use with a new style driver
> @@ -285,7 +284,7 @@
>
> /* I2C bus adapters -- one roots each I2C or SMBUS segment */
>
> -void i2c_adapter_dev_release(struct device *dev)
> +static void i2c_adapter_dev_release(struct device *dev)
> {
> struct i2c_adapter *adap = to_i2c_adapter(dev);
> complete(&adap->dev_released);
> @@ -303,7 +302,7 @@
> { },
> };
>
> -struct class i2c_adapter_class = {
> +static struct class i2c_adapter_class = {
> .owner = THIS_MODULE,
> .name = "i2c-adapter",
> .dev_attrs = i2c_adapter_attrs,
These ones are unquestionably correct, good catch, thanks.
--
Jean Delvare
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.6 patch] drivers/i2c/i2c-core.c: make code static
2007-08-09 9:05 ` Jean Delvare
@ 2007-08-09 15:39 ` David Brownell
0 siblings, 0 replies; 3+ messages in thread
From: David Brownell @ 2007-08-09 15:39 UTC (permalink / raw)
To: Jean Delvare; +Cc: Adrian Bunk, i2c, linux-kernel
On Thursday 09 August 2007, Jean Delvare wrote:
> > -EXPORT_SYMBOL_GPL(i2c_bus_type);
>
> This one was left exported on request by David Brownell. See this
> discussion thread:
> http://lists.lm-sensors.org/pipermail/i2c/2007-March/000924.html
Actually, that wasn't a request; it was me answering why I didn't
put a particular comment there, as part of moving an existing export
declaration up next to the symbol's definition.
> I am personally fine with removing this export, as it can always be
> added later if needed.
Right, that's what various other busses do.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-09 15:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-29 14:57 [2.6 patch] drivers/i2c/i2c-core.c: make code static Adrian Bunk
2007-08-09 9:05 ` Jean Delvare
2007-08-09 15:39 ` David Brownell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox