public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] add i2c_clientname()
@ 2003-04-02 16:51 Gerd Knorr
  2003-04-03  1:01 ` Greg KH
  2003-04-08 23:04 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Gerd Knorr @ 2003-04-02 16:51 UTC (permalink / raw)
  To: Kernel List, Greg KH, Frank Davis

  Hi,

This patch just adds a #define and a inline function to hide the
"i2c_client->name" => "i2c_client->dev.name" move introduced by
the recent i2c updates.  That makes it easier to build i2c drivers
on both 2.4 and 2.5 kernels.

  Gerd

diff -u linux-2.5.66/include/linux/i2c.h linux/include/linux/i2c.h
--- linux-2.5.66/include/linux/i2c.h	2003-04-02 11:42:19.455041606 +0200
+++ linux/include/linux/i2c.h	2003-04-02 11:49:36.479533709 +0200
@@ -182,6 +182,13 @@
 	return dev_set_drvdata (&dev->dev, data);
 }
 
+#define I2C_DEVNAME(str)   .dev = { .name = str }
+
+static inline char *i2c_clientname(struct i2c_client *c)
+{
+	return c->dev.name;
+}
+
 /*
  * The following structs are for those who like to implement new bus drivers:
  * i2c_algorithm is the interface to a class of hardware solutions which can

-- 
Michael Moore for president!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] add i2c_clientname()
  2003-04-02 16:51 [patch] add i2c_clientname() Gerd Knorr
@ 2003-04-03  1:01 ` Greg KH
  2003-04-03  8:57   ` Gerd Knorr
  2003-04-08 23:04 ` Greg KH
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2003-04-03  1:01 UTC (permalink / raw)
  To: Gerd Knorr; +Cc: Kernel List, Frank Davis

On Wed, Apr 02, 2003 at 06:51:16PM +0200, Gerd Knorr wrote:
> 
> This patch just adds a #define and a inline function to hide the
> "i2c_client->name" => "i2c_client->dev.name" move introduced by
> the recent i2c updates.  That makes it easier to build i2c drivers
> on both 2.4 and 2.5 kernels.

This is going to be a harder and harder problem as time goes on, and as
the i2c core changes over time.  I would just give up now :)

> +#define I2C_DEVNAME(str)   .dev = { .name = str }

Why this macro?  You don't use it in your driver, right?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] add i2c_clientname()
  2003-04-03  1:01 ` Greg KH
@ 2003-04-03  8:57   ` Gerd Knorr
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Knorr @ 2003-04-03  8:57 UTC (permalink / raw)
  To: Greg KH; +Cc: Kernel List, Frank Davis

> > This patch just adds a #define and a inline function to hide the
> > "i2c_client->name" => "i2c_client->dev.name" move introduced by
> > the recent i2c updates.  That makes it easier to build i2c drivers
> > on both 2.4 and 2.5 kernels.
> 
> This is going to be a harder and harder problem as time goes on, and as
> the i2c core changes over time.  I would just give up now :)

I don't, interfacing with the i2c core is not that much code in most
drivers.

> > +#define I2C_DEVNAME(str)   .dev = { .name = str }
> 
> Why this macro?  You don't use it in your driver, right?

I use it in my current driver code (patches are at
http://bytesex.org/patches/wip/).  Submitting those patches doesn't
make sense before that patch is in because I would get flooded with
"bttv doesn't compile any more" style mails ...

  Gerd

-- 
Michael Moore for president!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] add i2c_clientname()
  2003-04-02 16:51 [patch] add i2c_clientname() Gerd Knorr
  2003-04-03  1:01 ` Greg KH
@ 2003-04-08 23:04 ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2003-04-08 23:04 UTC (permalink / raw)
  To: Gerd Knorr; +Cc: Kernel List, Frank Davis

On Wed, Apr 02, 2003 at 06:51:16PM +0200, Gerd Knorr wrote:
>   Hi,
> 
> This patch just adds a #define and a inline function to hide the
> "i2c_client->name" => "i2c_client->dev.name" move introduced by
> the recent i2c updates.  That makes it easier to build i2c drivers
> on both 2.4 and 2.5 kernels.

Thanks, I've applied this patch and will send it on soon.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-04-08 22:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-02 16:51 [patch] add i2c_clientname() Gerd Knorr
2003-04-03  1:01 ` Greg KH
2003-04-03  8:57   ` Gerd Knorr
2003-04-08 23:04 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox