netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Alvin Šipraga" <alsi@bang-olufsen.dk>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Luiz Angelo Daros de Luca" <luizluca@gmail.com>,
	netdev@vger.kernel.org, "kernel test robot" <lkp@intel.com>
Subject: Re: [PATCH v3] net: dsa: rtl8366rb: Fix compilation problem
Date: Thu, 20 Feb 2025 23:49:54 +0200	[thread overview]
Message-ID: <20250220214954.62lfljaxuclammce@skbuf> (raw)
In-Reply-To: <20250220-rtl8366rb-leds-compile-issue-v3-1-ecce664f1a27@linaro.org> <20250220-rtl8366rb-leds-compile-issue-v3-1-ecce664f1a27@linaro.org>

On Thu, Feb 20, 2025 at 07:48:15PM +0100, Linus Walleij wrote:
> When the kernel is compiled without LED framework support the
> rtl8366rb fails to build like this:
> 
> rtl8366rb.o: in function `rtl8366rb_setup_led':
> rtl8366rb.c:953:(.text.unlikely.rtl8366rb_setup_led+0xe8):
>   undefined reference to `led_init_default_state_get'
> rtl8366rb.c:980:(.text.unlikely.rtl8366rb_setup_led+0x240):
>   undefined reference to `devm_led_classdev_register_ext'
> 
> As this is constantly coming up in different randconfig builds,
> bite the bullet and create a separate file for the offending
> code, split out a header with all stuff needed both in the
> core driver and the leds code.
> 
> Add a new bool Kconfig option for the LED compile target, such
> that it depends on LEDS_CLASS=y || LEDS_CLASS=RTL8366RB
> which make LED support always available when LEDS_CLASS is
> compiled into the kernel and enforce that if the LEDS_CLASS
> is a module, then the RTL8366RB driver needs to be a module
> as well so that modprobe can resolve the dependencies.
> 
> Fixes: 32d617005475 ("net: dsa: realtek: add LED drivers for rtl8366rb")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202502070525.xMUImayb-lkp@intel.com/
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Changes in v3:
> - Create a new NET_DSA_REALTEK_RTL8366RB_LEDS symbol and make
>   it resolve the compiled-in vs compiled-as-module dependencies.
> - Link to v2: https://lore.kernel.org/r/20250220-rtl8366rb-leds-compile-issue-v2-1-8f8ef5a3f022@linaro.org

The Kconfig approach where NET_DSA_REALTEK_RTL8366RB_LEDS just
disappears when there is a mismatch between LEDS_CLASS and RTL8366RB is
a bit unusual to me (I'm used to just seeing "depends on LEDS_CLASS || LEDS_CLASS=n"),
but this seems to work too, as far as I can see.

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

  reply	other threads:[~2025-02-20 21:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-20 18:48 [PATCH v3] net: dsa: rtl8366rb: Fix compilation problem Linus Walleij
2025-02-20 21:49 ` Vladimir Oltean [this message]
2025-02-24  9:20 ` patchwork-bot+netdevbpf
2025-02-27 16:34 ` Jakub Kicinski
2025-02-27 22:50   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250220214954.62lfljaxuclammce@skbuf \
    --to=olteanv@gmail.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=lkp@intel.com \
    --cc=luizluca@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).