linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: i2c build failure
@ 2008-05-15  2:12 Stephen Rothwell
  2008-05-15  8:22 ` Jean Delvare
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2008-05-15  2:12 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linux-next, Olof Johansson

[-- Attachment #1: Type: text/plain, Size: 755 bytes --]

Hi Jean,

Today's linux-next build (powerpc ppc64_defconfig) fails like this:

arch/powerpc/platforms/pasemi/misc.c: In function 'find_i2c_driver':
arch/powerpc/platforms/pasemi/misc.c:43: error: 'struct i2c_board_info' has no member named 'driver_name'
arch/powerpc/platforms/pasemi/misc.c:44: error: 'struct i2c_board_info' has no member named 'driver_name'
arch/powerpc/platforms/pasemi/misc.c:44: error: 'struct i2c_board_info' has no member named 'driver_name'

So I reverted commit f625810ef235a8b238427df3129792f89187c085 ("i2c: Kill
the old driver matching scheme").  Obviously not the correct fix, but it
makes the build work.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: linux-next: i2c build failure
  2008-05-15  2:12 linux-next: i2c build failure Stephen Rothwell
@ 2008-05-15  8:22 ` Jean Delvare
  2008-05-15 10:39   ` Stephen Rothwell
  2008-05-15 19:47   ` Olof Johansson
  0 siblings, 2 replies; 6+ messages in thread
From: Jean Delvare @ 2008-05-15  8:22 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, Olof Johansson

Hi Stephen,

On Thu, 15 May 2008 12:12:41 +1000, Stephen Rothwell wrote:
> Today's linux-next build (powerpc ppc64_defconfig) fails like this:
> 
> arch/powerpc/platforms/pasemi/misc.c: In function 'find_i2c_driver':
> arch/powerpc/platforms/pasemi/misc.c:43: error: 'struct i2c_board_info' has no member named 'driver_name'
> arch/powerpc/platforms/pasemi/misc.c:44: error: 'struct i2c_board_info' has no member named 'driver_name'
> arch/powerpc/platforms/pasemi/misc.c:44: error: 'struct i2c_board_info' has no member named 'driver_name'
> 
> So I reverted commit f625810ef235a8b238427df3129792f89187c085 ("i2c: Kill
> the old driver matching scheme").  Obviously not the correct fix, but it
> makes the build work.

Thanks for the notification and sorry for the trouble. I thought that I
knew about all users of struct i2c_board_info and that they were all
converted by now but obviously not. I didn't know that fsl_soc.c had
been partly forked for the pasemi platform.

Here's a fix, it's the same that was applied to fsl_soc.c:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blobdiff;f=arch/powerpc/sysdev/fsl_soc.c;h=324c01b70dddfc14701210dc1547c3dfd9a65fab;hp=7b45670c7af387c34d670018dcc76108958d45fb;hb=3760f736716f74bdc62a4ba5406934338da93eb2;hpb=d2653e92732bd3911feff6bee5e23dbf959381db

---
 arch/powerpc/platforms/pasemi/misc.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

--- linux-2.6.26-rc2.orig/arch/powerpc/platforms/pasemi/misc.c	2008-04-17 04:49:44.000000000 +0200
+++ linux-2.6.26-rc2/arch/powerpc/platforms/pasemi/misc.c	2008-05-15 10:15:32.000000000 +0200
@@ -24,12 +24,11 @@
  */
 struct i2c_driver_device {
 	char    *of_device;
-	char    *i2c_driver;
 	char    *i2c_type;
 };
 
 static struct i2c_driver_device i2c_devices[] __initdata = {
-	{"dallas,ds1338",  "rtc-ds1307",  "ds1338"},
+	{"dallas,ds1338",  "ds1338"},
 };
 
 static int __init find_i2c_driver(struct device_node *node,
@@ -40,9 +39,7 @@ static int __init find_i2c_driver(struct
 	for (i = 0; i < ARRAY_SIZE(i2c_devices); i++) {
 		if (!of_device_is_compatible(node, i2c_devices[i].of_device))
 			continue;
-		if (strlcpy(info->driver_name, i2c_devices[i].i2c_driver,
-			    KOBJ_NAME_LEN) >= KOBJ_NAME_LEN ||
-		    strlcpy(info->type, i2c_devices[i].i2c_type,
+		if (strlcpy(info->type, i2c_devices[i].i2c_type,
 			    I2C_NAME_SIZE) >= I2C_NAME_SIZE)
 			return -ENOMEM;
 		return 0;


Olof, please test it if you can. I will push this patch to Linux
quickly.

Stephen, I'm updating my i2c tree now and you'll get this patch under
the name i2c-02-switch-pasemi-to-module-aliases.patch. Note that this
will cause one more conflict with Greg KH driver tree, which you can
solve the same way you solved the other ones.

Thanks,
-- 
Jean Delvare

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

* Re: linux-next: i2c build failure
  2008-05-15  8:22 ` Jean Delvare
@ 2008-05-15 10:39   ` Stephen Rothwell
  2008-05-15 19:47   ` Olof Johansson
  1 sibling, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2008-05-15 10:39 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linux-next, Olof Johansson

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

Hi Jean,

On Thu, 15 May 2008 10:22:15 +0200 Jean Delvare <khali@linux-fr.org> wrote:
>
> Thanks for the notification and sorry for the trouble. I thought that I
> knew about all users of struct i2c_board_info and that they were all
> converted by now but obviously not. I didn't know that fsl_soc.c had
> been partly forked for the pasemi platform.

This is one of the reasons linux-next is here.  However, grep -R (or git
grep) is you friend. :-)


> Stephen, I'm updating my i2c tree now and you'll get this patch under
> the name i2c-02-switch-pasemi-to-module-aliases.patch. Note that this
> will cause one more conflict with Greg KH driver tree, which you can
> solve the same way you solved the other ones.

OK, that will be in linux-next tomorrow.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: linux-next: i2c build failure
  2008-05-15  8:22 ` Jean Delvare
  2008-05-15 10:39   ` Stephen Rothwell
@ 2008-05-15 19:47   ` Olof Johansson
  1 sibling, 0 replies; 6+ messages in thread
From: Olof Johansson @ 2008-05-15 19:47 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Stephen Rothwell, linux-next

Hi,

On Thu, May 15, 2008 at 10:22:15AM +0200, Jean Delvare wrote:

> Thanks for the notification and sorry for the trouble. I thought that I
> knew about all users of struct i2c_board_info and that they were all
> converted by now but obviously not. I didn't know that fsl_soc.c had
> been partly forked for the pasemi platform.

Yeah, I did that because the "real" solution wasn't going to be ready
for .25 and I needed my boards to work. I saw no need in abstracting
it out and sharing code when it was something so simple that was just
going to go away soon anyway...

> Olof, please test it if you can. I will push this patch to Linux
> quickly.

Seems to work ok here.

Acked-by: Olof Johansson <olof@lixom.net>


-Olof

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

* Re: linux-next: i2c build failure
  2008-05-23  1:32 Stephen Rothwell
@ 2008-05-23  1:58 ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2008-05-23  1:58 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Jean Delvare, linux-next, Dave Young, Kay Sievers

On Fri, May 23, 2008 at 11:32:55AM +1000, Stephen Rothwell wrote:
> Hi Jean,
> 
> Today's linux-next build (powerpc ppc64_defconfig) failed like this:
> 
> drivers/i2c/i2c-core.c: In function 'i2c_register_driver':
> drivers/i2c/i2c-core.c:697: warning: passing argument 2 of 'class_for_each_device' from incompatible pointer type
> drivers/i2c/i2c-core.c:697: error: too few arguments to function 'class_for_each_device'
> drivers/i2c/i2c-core.c: In function 'i2c_del_driver':
> drivers/i2c/i2c-core.c:749: warning: passing argument 2 of 'class_for_each_device' from incompatible pointer type
> drivers/i2c/i2c-core.c:749: error: too few arguments to function 'class_for_each_device'
> 
> This is caused by commit f79228aaa062668bcbabf9762e819a1d7ee7c5c4 ("i2c:
> Use class_for_each_device") from the i2c tree interacting with commit
> a3ec024649e0095368d38a2e434ad092b79aa7af ("Driver Core: add ability for
> class_for_each_device to start in middle of list") from the driver-core
> tree.  The latter added a parameter to class_for_each_device while the
> former added a new usage.
> 
> I applied the patch below.

The patch looks correct, thanks.

> Greg, is there some better way to handle this interface change?  (e.g. new
> function name?)

There's only what, 5 users in the kernel for it today in 3 different
files?  I'd rather not go through that kind of sequence, can you just
keep this patch and we'll handle it when we merge together once .27
opens.  Sound reasonable?

thanks,

greg k-h

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

* linux-next: i2c build failure
@ 2008-05-23  1:32 Stephen Rothwell
  2008-05-23  1:58 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2008-05-23  1:32 UTC (permalink / raw)
  To: Jean Delvare, Greg KH; +Cc: linux-next, Dave Young, Kay Sievers

Hi Jean,

Today's linux-next build (powerpc ppc64_defconfig) failed like this:

drivers/i2c/i2c-core.c: In function 'i2c_register_driver':
drivers/i2c/i2c-core.c:697: warning: passing argument 2 of 'class_for_each_device' from incompatible pointer type
drivers/i2c/i2c-core.c:697: error: too few arguments to function 'class_for_each_device'
drivers/i2c/i2c-core.c: In function 'i2c_del_driver':
drivers/i2c/i2c-core.c:749: warning: passing argument 2 of 'class_for_each_device' from incompatible pointer type
drivers/i2c/i2c-core.c:749: error: too few arguments to function 'class_for_each_device'

This is caused by commit f79228aaa062668bcbabf9762e819a1d7ee7c5c4 ("i2c:
Use class_for_each_device") from the i2c tree interacting with commit
a3ec024649e0095368d38a2e434ad092b79aa7af ("Driver Core: add ability for
class_for_each_device to start in middle of list") from the driver-core
tree.  The latter added a parameter to class_for_each_device while the
former added a new usage.

I applied the patch below.

Greg, is there some better way to handle this interface change?  (e.g. new
function name?)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

>From 4dde1df49f5c1301b5eea93a3776624de6e4f0c5 Mon Sep 17 00:00:00 2001
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 23 May 2008 11:27:59 +1000
Subject: [PATCH] i2c: fix fallout from class_for_each_device change.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/i2c/i2c-core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index e06067e..a1021d5 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -693,7 +693,7 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver)
 
 	/* legacy drivers scan i2c busses directly */
 	if (driver->attach_adapter)
-		class_for_each_device(&i2c_adapter_class, driver,
+		class_for_each_device(&i2c_adapter_class, NULL, driver,
 				      __attach_adapter);
 
 	mutex_unlock(&core_lock);
@@ -745,7 +745,7 @@ void i2c_del_driver(struct i2c_driver *driver)
 
 	/* legacy driver? */
 	if (!is_newstyle_driver(driver))
-		class_for_each_device(&i2c_adapter_class, driver,
+		class_for_each_device(&i2c_adapter_class, NULL, driver,
 				      __detach_adapter);
 
 	driver_unregister(&driver->driver);
-- 
1.5.5.1


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

end of thread, other threads:[~2008-05-23  1:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-15  2:12 linux-next: i2c build failure Stephen Rothwell
2008-05-15  8:22 ` Jean Delvare
2008-05-15 10:39   ` Stephen Rothwell
2008-05-15 19:47   ` Olof Johansson
2008-05-23  1:32 Stephen Rothwell
2008-05-23  1:58 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).