From: Hugo Villeneuve <hugo@hugovil.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
Hugo Villeneuve <hvilleneuve@dimonoff.com>,
kernel test robot <lkp@intel.com>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH v3] serial: max310x: fix compile errors if CONFIG_SPI_MASTER is disabled
Date: Tue, 26 May 2026 09:34:10 -0400 [thread overview]
Message-ID: <20260526093410.6162be940a20372bf766db46@hugovil.com> (raw)
In-Reply-To: <48b0e694-e75c-4d0a-8698-b0848ccaefeb@infradead.org>
On Mon, 25 May 2026 10:43:40 -0700
Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
> On 5/21/26 8:33 AM, Hugo Villeneuve wrote:
> > From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> >
> > Since commit 20ffe4b3330a8 ("serial: max310x: allow driver to be built with
> > SPI or I2C"), if I2C is enabled and SPI_MASTER is disabled, we have these
> > compile errors:
> >
> > drivers/tty/serial/max310x.c: In function 'max310x_uart_init':
> > drivers/tty/serial/max310x.c: error: 'max310x_spi_driver' undeclared...
> > drivers/tty/serial/max310x.c: In function ‘max310x_uart_init’:
> > drivers/tty/serial/max310x.c: error: label ‘err_spi_register’
> > defined but not used...
> > drivers/tty/serial/max310x.c: error: ‘regcfg’ defined but not used
> >
> > Fix by properly encapsulating i2c/spi code/variables in their respective
> > context with IS_ENABLED() macros for CONFIG_I2C and CONFIG_SPI_MASTER.
> >
> > Also fix link failure with SERIAL_MAX310X=y and I2C=m by modifying Kconfig
> > depends.
> >
> > Fixes: 20ffe4b3330a8 ("serial: max310x: allow driver to be built with SPI or I2C")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202605121847.N9DVLNg2-lkp@intel.com/
> > Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> > ---
> > note: not Cc-ing stable as the commit is still in tty-next, and even if the
> > errors originate from original commit that added I2C support, they were not
> > trigerred because the driver could not be selected/compiled if
> > CONFIG_SPI_MASTER was disabled.
> >
> > Changes for v3:
> > - Fix link failure with SERIAL_MAX310X=y and I2C=m (Arnd Bergmann)
> >
> > Changes for v2:
> > - replace #ifdef with #if IS_ENABLED() to suppoirt both built-in and modules
> > options
> > ---
> > drivers/tty/serial/Kconfig | 2 +-
> > drivers/tty/serial/max310x.c | 48 +++++++++++++++++++-----------------
> > 2 files changed, 27 insertions(+), 23 deletions(-)
> >
> > diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
> > index f834e5d292fd7..4accbfa75074c 100644
> > --- a/drivers/tty/serial/Kconfig
> > +++ b/drivers/tty/serial/Kconfig
> > @@ -321,7 +321,7 @@ config SERIAL_MAX3100
> >
> > config SERIAL_MAX310X
> > tristate "MAX310X support"
> > - depends on SPI_MASTER || I2C
> > + depends on (SPI_MASTER && !I2C) || I2C
> > select SERIAL_CORE
> > select REGMAP_SPI if SPI_MASTER
> > select REGMAP_I2C if I2C
>
> Other than preferring Arnd's Kconfig dependencies (easier to
> read/understand IMO), this is all good.
> Thanks.
Hi Randy,
thank you for testing this.
I personnaly think both syntaxes are confusing :)
I have a long term goal of converting this driver to core and
I2C/SPI parts eventually, like I did for the sc16is7xx...
Hugo.
>
> Acked-by: Randy Dunlap <rdunlap@infradead.org>
> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
>
> --
> ~Randy
next prev parent reply other threads:[~2026-05-26 13:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 15:33 Hugo Villeneuve
2026-05-25 17:43 ` Randy Dunlap
2026-05-26 13:34 ` Hugo Villeneuve [this message]
2026-05-26 16:19 ` Randy Dunlap
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=20260526093410.6162be940a20372bf766db46@hugovil.com \
--to=hugo@hugovil.com \
--cc=gregkh@linuxfoundation.org \
--cc=hvilleneuve@dimonoff.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=lkp@intel.com \
--cc=rdunlap@infradead.org \
/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
all inboxes | Powered by JetHome®