linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mod_devicetable: helper macro for declaring oftree module device table
@ 2019-04-24 11:08 Enrico Weigelt, metux IT consult
  2019-04-24 13:28 ` Greg KH
  2019-04-26 14:16 ` [PATCH v2] " Enrico Weigelt, metux IT consult
  0 siblings, 2 replies; 3+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-04-24 11:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, gregkh, heikki.krogerus, f.fainelli, rpjday, dvhart

Little helper macro that declares an oftree module device table,
if CONFIG_OF is enabled. Otherwise it's just noop.

This is also helpful if some drivers can be built w/ or w/o
oftree support.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 include/linux/mod_devicetable.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 448621c..853e301 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -245,6 +245,15 @@ struct of_device_id {
 	const void *data;
 };
 
+/*
+ * macro for adding the of module device table only if CONFIG_OF enabled
+ */
+#ifdef CONFIG_OF
+#define MODULE_DEVICE_TABLE_OF(name)	MODULE_DEVICE_TABLE(of,name)
+#else
+#define MODULE_DEVICE_TABLE_OF(name)
+#endif /* CONFIG_OF */
+
 /* VIO */
 struct vio_device_id {
 	char type[32];
-- 
1.9.1


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

* Re: [PATCH] mod_devicetable: helper macro for declaring oftree module device table
  2019-04-24 11:08 [PATCH] mod_devicetable: helper macro for declaring oftree module device table Enrico Weigelt, metux IT consult
@ 2019-04-24 13:28 ` Greg KH
  2019-04-26 14:16 ` [PATCH v2] " Enrico Weigelt, metux IT consult
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2019-04-24 13:28 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: linux-kernel, devicetree, heikki.krogerus, f.fainelli, rpjday, dvhart

On Wed, Apr 24, 2019 at 01:08:01PM +0200, Enrico Weigelt, metux IT consult wrote:
> Little helper macro that declares an oftree module device table,
> if CONFIG_OF is enabled. Otherwise it's just noop.
> 
> This is also helpful if some drivers can be built w/ or w/o
> oftree support.
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>

As I said before, please drop all "non-name" information from your s-o-b
line.



> ---
>  include/linux/mod_devicetable.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> index 448621c..853e301 100644
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> @@ -245,6 +245,15 @@ struct of_device_id {
>  	const void *data;
>  };
>  
> +/*
> + * macro for adding the of module device table only if CONFIG_OF enabled
> + */
> +#ifdef CONFIG_OF
> +#define MODULE_DEVICE_TABLE_OF(name)	MODULE_DEVICE_TABLE(of,name)
> +#else
> +#define MODULE_DEVICE_TABLE_OF(name)
> +#endif /* CONFIG_OF */

Do you have a real user of this?  We need that for any type of apis that
people are supposed to use, we do not just add them without users if at
all possible.

And did you run it through checkpatch.pl before sending this?  :(

thanks,

greg k-h

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

* [PATCH v2] mod_devicetable: helper macro for declaring oftree module device table
  2019-04-24 11:08 [PATCH] mod_devicetable: helper macro for declaring oftree module device table Enrico Weigelt, metux IT consult
  2019-04-24 13:28 ` Greg KH
@ 2019-04-26 14:16 ` Enrico Weigelt, metux IT consult
  1 sibling, 0 replies; 3+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-04-26 14:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: devicetree

Little helper macro that declares an oftree module device table,
if CONFIG_OF is enabled. Otherwise it's just noop.

This is also helpful if some drivers can be built w/ or w/o
oftree support.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 include/linux/mod_devicetable.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 448621c..853e301 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -245,6 +245,15 @@ struct of_device_id {
 	const void *data;
 };
 
+/*
+ * macro for adding the of module device table only if CONFIG_OF enabled
+ */
+#ifdef CONFIG_OF
+#define MODULE_DEVICE_TABLE_OF(name)	MODULE_DEVICE_TABLE(of,name)
+#else
+#define MODULE_DEVICE_TABLE_OF(name)
+#endif /* CONFIG_OF */
+
 /* VIO */
 struct vio_device_id {
 	char type[32];
-- 
1.9.1


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

end of thread, other threads:[~2019-04-26 14:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 11:08 [PATCH] mod_devicetable: helper macro for declaring oftree module device table Enrico Weigelt, metux IT consult
2019-04-24 13:28 ` Greg KH
2019-04-26 14:16 ` [PATCH v2] " Enrico Weigelt, metux IT consult

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