mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Randy Dunlap <rdunlap@infradead.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] mux: mmio: select REGMAP as the code has that dependency
Date: Fri, 10 Feb 2023 11:46:42 +0100	[thread overview]
Message-ID: <89199aca-5b57-e8df-03ca-b2658ee9d8b3@axentia.se> (raw)
In-Reply-To: <d1a3d8dd-213b-3772-17a7-c08e06cab837@axentia.se>

If CONFIG_REGMAP is not active, the build errors out like this:

../drivers/mux/mmio.c: In function ‘mux_mmio_probe’:
../drivers/mux/mmio.c:76:34: error: storage size of ‘field’ isn’t known
   76 |                 struct reg_field field;
      |                                  ^~~~~
In file included from ../include/linux/bits.h:21,
                 from ../include/linux/bitops.h:6,
                 from ../drivers/mux/mmio.c:8:
../include/linux/bits.h:23:28: error: first argument to ‘__builtin_choose_expr’ not a constant
   23 |         (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
      |                            ^~~~~~~~~~~~~~~~~~~~~
../include/linux/build_bug.h:16:62: note: in definition of macro ‘BUILD_BUG_ON_ZERO’
   16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
      |                                                              ^
../include/linux/bits.h:37:10: note: in expansion of macro ‘GENMASK_INPUT_CHECK’
   37 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
      |          ^~~~~~~~~~~~~~~~~~~
../drivers/mux/mmio.c:96:29: note: in expansion of macro ‘GENMASK’
   96 |                 if (mask != GENMASK(field.msb, field.lsb)) {
      |                             ^~~~~~~
../include/linux/build_bug.h:16:51: error: bit-field ‘<anonymous>’ width not an integer constant
   16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
      |                                                   ^
../include/linux/bits.h:23:10: note: in expansion of macro ‘BUILD_BUG_ON_ZERO’
   23 |         (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
      |          ^~~~~~~~~~~~~~~~~
../include/linux/bits.h:37:10: note: in expansion of macro ‘GENMASK_INPUT_CHECK’
   37 |         (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
      |          ^~~~~~~~~~~~~~~~~~~
../drivers/mux/mmio.c:96:29: note: in expansion of macro ‘GENMASK’
   96 |                 if (mask != GENMASK(field.msb, field.lsb)) {
      |                             ^~~~~~~
../drivers/mux/mmio.c:102:29: error: implicit declaration of function ‘devm_regmap_field_alloc’ [-Werror=implicit-function-declaration]
  102 |                 fields[i] = devm_regmap_field_alloc(dev, regmap, field);
      |                             ^~~~~~~~~~~~~~~~~~~~~~~
../drivers/mux/mmio.c:76:34: warning: unused variable ‘field’ [-Wunused-variable]
   76 |                 struct reg_field field;
      |                                  ^~~~~

Reported by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/lkml/64cf625b-2495-2382-0331-519d1cab0adf@infradead.org/
Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/mux/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Note, there is a patch in linux-next that removes "|| COMPILE_TEST" from depends.

Cheers,
Peter

diff --git a/drivers/mux/Kconfig b/drivers/mux/Kconfig
index 80f015cf6e54..9234f8c400ca 100644
--- a/drivers/mux/Kconfig
+++ b/drivers/mux/Kconfig
@@ -48,6 +48,7 @@ config MUX_GPIO
 config MUX_MMIO
 	tristate "MMIO/Regmap register bitfield-controlled Multiplexer"
 	depends on OF
+	select REGMAP
 	help
 	  MMIO/Regmap register bitfield-controlled Multiplexer controller.
 
-- 
2.20.1


  reply	other threads:[~2023-02-10 10:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10  3:34 mux/mmio: randconfig build errors Randy Dunlap
2023-02-10 10:41 ` Peter Rosin
2023-02-10 10:46   ` Peter Rosin [this message]
2023-02-10 11:56     ` [PATCH] mux: mmio: select REGMAP as the code has that dependency Philipp Zabel
2023-05-24 12:49       ` Peter Rosin
2023-05-24 12:52         ` [PATCH v2] mux: mmio: depend on " Peter Rosin
2023-06-11 20:59           ` Randy Dunlap
2023-06-11 21:04             ` Peter Rosin
2023-06-11 21:13               ` 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=89199aca-5b57-e8df-03ca-b2658ee9d8b3@axentia.se \
    --to=peda@axentia.se \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --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®