linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] module: fix mutiple defined issue
@ 2013-04-29  5:32 Inki Dae
  2013-04-29  7:35 ` Uwe Kleine-König
  2013-04-29  9:51 ` Russell King - ARM Linux
  0 siblings, 2 replies; 5+ messages in thread
From: Inki Dae @ 2013-04-29  5:32 UTC (permalink / raw)
  To: linux-arm-kernel

This patch fixes mutiple defined issue to MODULE_DEVICE_TABLE

The issue could be induced when some framework which includes two
more sub drivers, is built as one moudle because those sub drivers
could have their own MODULE_DEVICE_TABLE.

And 'struct of_device_id' isn't needed to be determined by type
argument because the definition of 'of_device_id' should be fixed.
So this patch makes 'of_devce_id' definition to be fixed and
only its instance name to be defined by type.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
---
 include/linux/module.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index 46f1ea0..ac5d79f 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -84,7 +84,7 @@ void trim_init_extable(struct module *m);
 
 #ifdef MODULE
 #define MODULE_GENERIC_TABLE(gtype,name)			\
-extern const struct gtype##_id __mod_##gtype##_table		\
+extern const struct of_device_id __mod_##gtype##_table		\
   __attribute__ ((unused, alias(__stringify(name))))
 
 #else  /* !MODULE */
-- 
1.7.5.4

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

* [PATCH] module: fix mutiple defined issue
  2013-04-29  5:32 [PATCH] module: fix mutiple defined issue Inki Dae
@ 2013-04-29  7:35 ` Uwe Kleine-König
  2013-04-29  7:56   ` Inki Dae
  2013-04-29  9:51 ` Russell King - ARM Linux
  1 sibling, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2013-04-29  7:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 29, 2013 at 02:32:01PM +0900, Inki Dae wrote:
> This patch fixes mutiple defined issue to MODULE_DEVICE_TABLE
s/mutiple/multiple/, still this sentence doesn't sound right. What is
the error message you see?
 
> The issue could be induced when some framework which includes two
> more sub drivers, is built as one moudle because those sub drivers
s/moudle/module/

> could have their own MODULE_DEVICE_TABLE.
> 
> And 'struct of_device_id' isn't needed to be determined by type
> argument because the definition of 'of_device_id' should be fixed.
> So this patch makes 'of_devce_id' definition to be fixed and
> only its instance name to be defined by type.
include/linux/isapnp.h uses:
#define ISAPNP_CARD_TABLE(name) \
		MODULE_GENERIC_TABLE(isapnp_card, name)

and you changed the table's type with your patch. Ditto for all users of

	MODULE_DEVICE_TABLE(i2c, ...);
	MODULE_DEVICE_TABLE(acpi, ...);
	MODULE_DEVICE_TABLE(platform, ...);
	MODULE_DEVICE_TABLE(pci, ...);
	MODULE_DEVICE_TABLE(sdio, ...);

So I'm pretty sure your patch is wrong and I expect it makes most
defconfigs fail to compile.

Best regards
Uwe

> 
> Signed-off-by: Inki Dae <inki.dae@samsung.com>
> ---
>  include/linux/module.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/module.h b/include/linux/module.h
> index 46f1ea0..ac5d79f 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -84,7 +84,7 @@ void trim_init_extable(struct module *m);
>  
>  #ifdef MODULE
>  #define MODULE_GENERIC_TABLE(gtype,name)			\
> -extern const struct gtype##_id __mod_##gtype##_table		\
> +extern const struct of_device_id __mod_##gtype##_table		\
>    __attribute__ ((unused, alias(__stringify(name))))
>  
>  #else  /* !MODULE */
> -- 
> 1.7.5.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* [PATCH] module: fix mutiple defined issue
  2013-04-29  7:35 ` Uwe Kleine-König
@ 2013-04-29  7:56   ` Inki Dae
  0 siblings, 0 replies; 5+ messages in thread
From: Inki Dae @ 2013-04-29  7:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,


> -----Original Message-----
> From: linux-kernel-owner at vger.kernel.org [mailto:linux-kernel-
> owner at vger.kernel.org] On Behalf Of Uwe Kleine-Konig
> Sent: Monday, April 29, 2013 4:35 PM
> To: Inki Dae
> Cc: gregkh at linuxfoundation.org; linux-kernel at vger.kernel.org; dri-
> devel at lists.freedesktop.org; linux-arm-kernel at lists.infradead.org
> Subject: Re: [PATCH] module: fix mutiple defined issue
> 
> On Mon, Apr 29, 2013 at 02:32:01PM +0900, Inki Dae wrote:
> > This patch fixes mutiple defined issue to MODULE_DEVICE_TABLE
> s/mutiple/multiple/, still this sentence doesn't sound right. What is
> the error message you see?
> 
> > The issue could be induced when some framework which includes two
> > more sub drivers, is built as one moudle because those sub drivers
> s/moudle/module/
> 
> > could have their own MODULE_DEVICE_TABLE.
> >
> > And 'struct of_device_id' isn't needed to be determined by type
> > argument because the definition of 'of_device_id' should be fixed.
> > So this patch makes 'of_devce_id' definition to be fixed and
> > only its instance name to be defined by type.
> include/linux/isapnp.h uses:
> #define ISAPNP_CARD_TABLE(name) \
> 		MODULE_GENERIC_TABLE(isapnp_card, name)
> 
> and you changed the table's type with your patch. Ditto for all users of
> 
> 	MODULE_DEVICE_TABLE(i2c, ...);
> 	MODULE_DEVICE_TABLE(acpi, ...);
> 	MODULE_DEVICE_TABLE(platform, ...);
> 	MODULE_DEVICE_TABLE(pci, ...);
> 	MODULE_DEVICE_TABLE(sdio, ...);
> 
> So I'm pretty sure your patch is wrong and I expect it makes most
> defconfigs fail to compile.
>

It might be my big mistake. Maybe xxx_device_id object was created device
tree internally. Right? Will check it out again. So please ignore it.

Thanks,
Inki Dae


> Best regards
> Uwe
> 
> >
> > Signed-off-by: Inki Dae <inki.dae@samsung.com>
> > ---
> >  include/linux/module.h |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/include/linux/module.h b/include/linux/module.h
> > index 46f1ea0..ac5d79f 100644
> > --- a/include/linux/module.h
> > +++ b/include/linux/module.h
> > @@ -84,7 +84,7 @@ void trim_init_extable(struct module *m);
> >
> >  #ifdef MODULE
> >  #define MODULE_GENERIC_TABLE(gtype,name)			\
> > -extern const struct gtype##_id __mod_##gtype##_table		\
> > +extern const struct of_device_id __mod_##gtype##_table		\
> >    __attribute__ ((unused, alias(__stringify(name))))
> >
> >  #else  /* !MODULE */
> > --
> > 1.7.5.4
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
> 
> --
> Pengutronix e.K.                           | Uwe Kleine-K?nig            |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* [PATCH] module: fix mutiple defined issue
  2013-04-29  5:32 [PATCH] module: fix mutiple defined issue Inki Dae
  2013-04-29  7:35 ` Uwe Kleine-König
@ 2013-04-29  9:51 ` Russell King - ARM Linux
  2013-04-29 10:06   ` Inki Dae
  1 sibling, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2013-04-29  9:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 29, 2013 at 02:32:01PM +0900, Inki Dae wrote:
> This patch fixes mutiple defined issue to MODULE_DEVICE_TABLE
> 
> The issue could be induced when some framework which includes two
> more sub drivers, is built as one moudle because those sub drivers
> could have their own MODULE_DEVICE_TABLE.
> 
> And 'struct of_device_id' isn't needed to be determined by type
> argument because the definition of 'of_device_id' should be fixed.
> So this patch makes 'of_devce_id' definition to be fixed and
> only its instance name to be defined by type.
> 
> Signed-off-by: Inki Dae <inki.dae@samsung.com>
> ---
>  include/linux/module.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/module.h b/include/linux/module.h
> index 46f1ea0..ac5d79f 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -84,7 +84,7 @@ void trim_init_extable(struct module *m);
>  
>  #ifdef MODULE
>  #define MODULE_GENERIC_TABLE(gtype,name)			\
> -extern const struct gtype##_id __mod_##gtype##_table		\
> +extern const struct of_device_id __mod_##gtype##_table		\
>    __attribute__ ((unused, alias(__stringify(name))))
>  
>  #else  /* !MODULE */

This patch (a) looks wrong (why would a generic device table be limited
to of_device_id when it could be ISAPNP or something else?) and (b) how
does changing the type fix the "multiple defined issue" ?  (c) include
the errors that you're fixing in the commit log.

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

* [PATCH] module: fix mutiple defined issue
  2013-04-29  9:51 ` Russell King - ARM Linux
@ 2013-04-29 10:06   ` Inki Dae
  0 siblings, 0 replies; 5+ messages in thread
From: Inki Dae @ 2013-04-29 10:06 UTC (permalink / raw)
  To: linux-arm-kernel



> -----Original Message-----
> From: linux-kernel-owner at vger.kernel.org [mailto:linux-kernel-
> owner at vger.kernel.org] On Behalf Of Russell King - ARM Linux
> Sent: Monday, April 29, 2013 6:52 PM
> To: Inki Dae
> Cc: gregkh at linuxfoundation.org; linux-kernel at vger.kernel.org; dri-
> devel at lists.freedesktop.org; linux-arm-kernel at lists.infradead.org
> Subject: Re: [PATCH] module: fix mutiple defined issue
> 
> On Mon, Apr 29, 2013 at 02:32:01PM +0900, Inki Dae wrote:
> > This patch fixes mutiple defined issue to MODULE_DEVICE_TABLE
> >
> > The issue could be induced when some framework which includes two
> > more sub drivers, is built as one moudle because those sub drivers
> > could have their own MODULE_DEVICE_TABLE.
> >
> > And 'struct of_device_id' isn't needed to be determined by type
> > argument because the definition of 'of_device_id' should be fixed.
> > So this patch makes 'of_devce_id' definition to be fixed and
> > only its instance name to be defined by type.
> >
> > Signed-off-by: Inki Dae <inki.dae@samsung.com>
> > ---
> >  include/linux/module.h |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/include/linux/module.h b/include/linux/module.h
> > index 46f1ea0..ac5d79f 100644
> > --- a/include/linux/module.h
> > +++ b/include/linux/module.h
> > @@ -84,7 +84,7 @@ void trim_init_extable(struct module *m);
> >
> >  #ifdef MODULE
> >  #define MODULE_GENERIC_TABLE(gtype,name)			\
> > -extern const struct gtype##_id __mod_##gtype##_table		\
> > +extern const struct of_device_id __mod_##gtype##_table		\
> >    __attribute__ ((unused, alias(__stringify(name))))
> >
> >  #else  /* !MODULE */
> 
> This patch (a) looks wrong (why would a generic device table be limited
> to of_device_id when it could be ISAPNP or something else?) and (b) how
> does changing the type fix the "multiple defined issue" ?  (c) include
> the errors that you're fixing in the commit log.

There was my misunderstanding. So please ignore my patch. Some headers in
include/linux/ have some kind of device_id structure such as of_device_id,
platform_device_id, i2c_device_id, and so on. And these structures should be
used properly. This was my missing point.

Thanks,
Inki Dae


> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

end of thread, other threads:[~2013-04-29 10:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-29  5:32 [PATCH] module: fix mutiple defined issue Inki Dae
2013-04-29  7:35 ` Uwe Kleine-König
2013-04-29  7:56   ` Inki Dae
2013-04-29  9:51 ` Russell King - ARM Linux
2013-04-29 10:06   ` Inki Dae

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).