All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: TXx9: use IS_BUILTIN() for CONFIG_LEDS_CLASS
@ 2018-01-29 11:26 ` Matt Redfearn
  0 siblings, 0 replies; 4+ messages in thread
From: Matt Redfearn @ 2018-01-29 11:26 UTC (permalink / raw)
  To: Ralf Baechle, James Hogan; +Cc: linux-mips, Matt Redfearn, linux-kernel

When commit b27311e1cace ("MIPS: TXx9: Add RBTX4939 board support")
added board support for the RBTX4939, it added a call to
led_classdev_register even if the LED class is built as a module.
Built-in arch code cannot call module code directly like this. Commit
b33b44073734 ("MIPS: TXX9: use IS_ENABLED() macro") subsequently
changed the inclusion of this code to a single check that
CONFIG_LEDS_CLASS is either builtin or a module, but the same issue
remains.
This leads to MIPS allmodconfig builds failing when CONFIG_MACH_TX49XX=y
is set:

arch/mips/txx9/rbtx4939/setup.o: In function `rbtx4939_led_probe':
setup.c:(.init.text+0xc0): undefined reference to `of_led_classdev_register'
make: *** [Makefile:999: vmlinux] Error 1

Fix this by using the IS_BUILTIN() macro instead.

Fixes: b27311e1cace ("MIPS: TXx9: Add RBTX4939 board support")
Fixes: b33b44073734 ("MIPS: TXX9: use IS_ENABLED() macro")

Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>

---

 arch/mips/txx9/rbtx4939/setup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
index 8b937300fb7f..fd26fadc8617 100644
--- a/arch/mips/txx9/rbtx4939/setup.c
+++ b/arch/mips/txx9/rbtx4939/setup.c
@@ -186,7 +186,7 @@ static void __init rbtx4939_update_ioc_pen(void)
 
 #define RBTX4939_MAX_7SEGLEDS	8
 
-#if IS_ENABLED(CONFIG_LEDS_CLASS)
+#if IS_BUILTIN(CONFIG_LEDS_CLASS)
 static u8 led_val[RBTX4939_MAX_7SEGLEDS];
 struct rbtx4939_led_data {
 	struct led_classdev cdev;
@@ -261,7 +261,7 @@ static inline void rbtx4939_led_setup(void)
 
 static void __rbtx4939_7segled_putc(unsigned int pos, unsigned char val)
 {
-#if IS_ENABLED(CONFIG_LEDS_CLASS)
+#if IS_BUILTIN(CONFIG_LEDS_CLASS)
 	unsigned long flags;
 	local_irq_save(flags);
 	/* bit7: reserved for LED class */
-- 
2.7.4

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

* [PATCH] MIPS: TXx9: use IS_BUILTIN() for CONFIG_LEDS_CLASS
@ 2018-01-29 11:26 ` Matt Redfearn
  0 siblings, 0 replies; 4+ messages in thread
From: Matt Redfearn @ 2018-01-29 11:26 UTC (permalink / raw)
  To: Ralf Baechle, James Hogan; +Cc: linux-mips, Matt Redfearn, linux-kernel

When commit b27311e1cace ("MIPS: TXx9: Add RBTX4939 board support")
added board support for the RBTX4939, it added a call to
led_classdev_register even if the LED class is built as a module.
Built-in arch code cannot call module code directly like this. Commit
b33b44073734 ("MIPS: TXX9: use IS_ENABLED() macro") subsequently
changed the inclusion of this code to a single check that
CONFIG_LEDS_CLASS is either builtin or a module, but the same issue
remains.
This leads to MIPS allmodconfig builds failing when CONFIG_MACH_TX49XX=y
is set:

arch/mips/txx9/rbtx4939/setup.o: In function `rbtx4939_led_probe':
setup.c:(.init.text+0xc0): undefined reference to `of_led_classdev_register'
make: *** [Makefile:999: vmlinux] Error 1

Fix this by using the IS_BUILTIN() macro instead.

Fixes: b27311e1cace ("MIPS: TXx9: Add RBTX4939 board support")
Fixes: b33b44073734 ("MIPS: TXX9: use IS_ENABLED() macro")

Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>

---

 arch/mips/txx9/rbtx4939/setup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
index 8b937300fb7f..fd26fadc8617 100644
--- a/arch/mips/txx9/rbtx4939/setup.c
+++ b/arch/mips/txx9/rbtx4939/setup.c
@@ -186,7 +186,7 @@ static void __init rbtx4939_update_ioc_pen(void)
 
 #define RBTX4939_MAX_7SEGLEDS	8
 
-#if IS_ENABLED(CONFIG_LEDS_CLASS)
+#if IS_BUILTIN(CONFIG_LEDS_CLASS)
 static u8 led_val[RBTX4939_MAX_7SEGLEDS];
 struct rbtx4939_led_data {
 	struct led_classdev cdev;
@@ -261,7 +261,7 @@ static inline void rbtx4939_led_setup(void)
 
 static void __rbtx4939_7segled_putc(unsigned int pos, unsigned char val)
 {
-#if IS_ENABLED(CONFIG_LEDS_CLASS)
+#if IS_BUILTIN(CONFIG_LEDS_CLASS)
 	unsigned long flags;
 	local_irq_save(flags);
 	/* bit7: reserved for LED class */
-- 
2.7.4

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

* Re: [PATCH] MIPS: TXx9: use IS_BUILTIN() for CONFIG_LEDS_CLASS
  2018-01-29 11:26 ` Matt Redfearn
  (?)
@ 2018-01-29 12:30 ` James Hogan
  -1 siblings, 0 replies; 4+ messages in thread
From: James Hogan @ 2018-01-29 12:30 UTC (permalink / raw)
  To: Matt Redfearn; +Cc: Ralf Baechle, linux-mips, linux-kernel

On Mon, Jan 29, 2018 at 11:26:45AM +0000, Matt Redfearn wrote:
> When commit b27311e1cace ("MIPS: TXx9: Add RBTX4939 board support")
> added board support for the RBTX4939, it added a call to
> led_classdev_register even if the LED class is built as a module.
> Built-in arch code cannot call module code directly like this. Commit
> b33b44073734 ("MIPS: TXX9: use IS_ENABLED() macro") subsequently
> changed the inclusion of this code to a single check that
> CONFIG_LEDS_CLASS is either builtin or a module, but the same issue
> remains.
> This leads to MIPS allmodconfig builds failing when CONFIG_MACH_TX49XX=y
> is set:
> 
> arch/mips/txx9/rbtx4939/setup.o: In function `rbtx4939_led_probe':
> setup.c:(.init.text+0xc0): undefined reference to `of_led_classdev_register'
> make: *** [Makefile:999: vmlinux] Error 1
> 
> Fix this by using the IS_BUILTIN() macro instead.
> 
> Fixes: b27311e1cace ("MIPS: TXx9: Add RBTX4939 board support")
> Fixes: b33b44073734 ("MIPS: TXX9: use IS_ENABLED() macro")

Well, I don't think the latter did anything wrong or made anything
worse, so shouldn't really be implicated by "Fixes:", but other than
that it looks like a reasonable workaround (even if ideally the
driverlet would be separate from the device instantiation):

Reviewed-by: James Hogan <jhogan@kernel.org>

Thanks
James

> 
> Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
> 
> ---
> 
>  arch/mips/txx9/rbtx4939/setup.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
> index 8b937300fb7f..fd26fadc8617 100644
> --- a/arch/mips/txx9/rbtx4939/setup.c
> +++ b/arch/mips/txx9/rbtx4939/setup.c
> @@ -186,7 +186,7 @@ static void __init rbtx4939_update_ioc_pen(void)
>  
>  #define RBTX4939_MAX_7SEGLEDS	8
>  
> -#if IS_ENABLED(CONFIG_LEDS_CLASS)
> +#if IS_BUILTIN(CONFIG_LEDS_CLASS)
>  static u8 led_val[RBTX4939_MAX_7SEGLEDS];
>  struct rbtx4939_led_data {
>  	struct led_classdev cdev;
> @@ -261,7 +261,7 @@ static inline void rbtx4939_led_setup(void)
>  
>  static void __rbtx4939_7segled_putc(unsigned int pos, unsigned char val)
>  {
> -#if IS_ENABLED(CONFIG_LEDS_CLASS)
> +#if IS_BUILTIN(CONFIG_LEDS_CLASS)
>  	unsigned long flags;
>  	local_irq_save(flags);
>  	/* bit7: reserved for LED class */
> -- 
> 2.7.4
> 

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

* Re: [PATCH] MIPS: TXx9: use IS_BUILTIN() for CONFIG_LEDS_CLASS
  2018-01-29 11:26 ` Matt Redfearn
  (?)
  (?)
@ 2018-02-05 13:36 ` James Hogan
  -1 siblings, 0 replies; 4+ messages in thread
From: James Hogan @ 2018-02-05 13:36 UTC (permalink / raw)
  To: Matt Redfearn; +Cc: Ralf Baechle, linux-mips, linux-kernel

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

On Mon, Jan 29, 2018 at 11:26:45AM +0000, Matt Redfearn wrote:
> When commit b27311e1cace ("MIPS: TXx9: Add RBTX4939 board support")
> added board support for the RBTX4939, it added a call to
> led_classdev_register even if the LED class is built as a module.
> Built-in arch code cannot call module code directly like this. Commit
> b33b44073734 ("MIPS: TXX9: use IS_ENABLED() macro") subsequently
> changed the inclusion of this code to a single check that
> CONFIG_LEDS_CLASS is either builtin or a module, but the same issue
> remains.
> This leads to MIPS allmodconfig builds failing when CONFIG_MACH_TX49XX=y
> is set:
> 
> arch/mips/txx9/rbtx4939/setup.o: In function `rbtx4939_led_probe':
> setup.c:(.init.text+0xc0): undefined reference to `of_led_classdev_register'
> make: *** [Makefile:999: vmlinux] Error 1
> 
> Fix this by using the IS_BUILTIN() macro instead.
> 
> Fixes: b27311e1cace ("MIPS: TXx9: Add RBTX4939 board support")
> Fixes: b33b44073734 ("MIPS: TXX9: use IS_ENABLED() macro")
> 
> Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>

Thanks, applied

Cheers
James

> 
> ---
> 
>  arch/mips/txx9/rbtx4939/setup.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/txx9/rbtx4939/setup.c b/arch/mips/txx9/rbtx4939/setup.c
> index 8b937300fb7f..fd26fadc8617 100644
> --- a/arch/mips/txx9/rbtx4939/setup.c
> +++ b/arch/mips/txx9/rbtx4939/setup.c
> @@ -186,7 +186,7 @@ static void __init rbtx4939_update_ioc_pen(void)
>  
>  #define RBTX4939_MAX_7SEGLEDS	8
>  
> -#if IS_ENABLED(CONFIG_LEDS_CLASS)
> +#if IS_BUILTIN(CONFIG_LEDS_CLASS)
>  static u8 led_val[RBTX4939_MAX_7SEGLEDS];
>  struct rbtx4939_led_data {
>  	struct led_classdev cdev;
> @@ -261,7 +261,7 @@ static inline void rbtx4939_led_setup(void)
>  
>  static void __rbtx4939_7segled_putc(unsigned int pos, unsigned char val)
>  {
> -#if IS_ENABLED(CONFIG_LEDS_CLASS)
> +#if IS_BUILTIN(CONFIG_LEDS_CLASS)
>  	unsigned long flags;
>  	local_irq_save(flags);
>  	/* bit7: reserved for LED class */
> -- 
> 2.7.4
> 

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

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

end of thread, other threads:[~2018-02-05 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-29 11:26 [PATCH] MIPS: TXx9: use IS_BUILTIN() for CONFIG_LEDS_CLASS Matt Redfearn
2018-01-29 11:26 ` Matt Redfearn
2018-01-29 12:30 ` James Hogan
2018-02-05 13:36 ` James Hogan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.