* [PATCH v4] MIPS: rb532: move GPIOD definition into C-files
@ 2022-03-30 12:09 Jackie Liu
2022-03-30 18:35 ` Thomas Bogendoerfer
0 siblings, 1 reply; 2+ messages in thread
From: Jackie Liu @ 2022-03-30 12:09 UTC (permalink / raw)
To: linus.walleij, ralf, tsbogend
Cc: linux-mips, jic23, andy.shevchenko, sergei.shtylyov, liu.yun
From: Jackie Liu <liuyun01@kylinos.cn>
My kernel robot reports build error from drivers/iio/adc/da9150-gpadc.c,
drivers/iio/adc/da9150-gpadc.c:254:13: error: ‘DA9150_GPADC_CHAN_0x08’
undeclared here (not in a function); did you mean ‘DA9150_GPADC_CHAN_TBAT’?
254 | .channel = DA9150_GPADC_CHAN_##_id,
We define GPIOD in rb.h, in fact it should only be used in gpio.c, but
it affects the driver da9150-gpadc.c which goes against the original
intention of the design, just move it to its scope.
Fixes: 1b432840d0a4 ("MIPS: RB532: GPIO register offsets are relative to GPIOBASE")
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reported-by: k2ci <kernel-bot@kylinos.cn>
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
---
v1->v2:
Keep GPIONMIEN and IMASK6 as hardware document.
v2->v3:
s/he/it/.
v3->v4:
s/his/its/.
arch/mips/include/asm/mach-rc32434/rb.h | 9 ---------
arch/mips/rb532/gpio.c | 10 ++++++++++
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/mips/include/asm/mach-rc32434/rb.h b/arch/mips/include/asm/mach-rc32434/rb.h
index 34d179ca020b..dd9d4b026e62 100644
--- a/arch/mips/include/asm/mach-rc32434/rb.h
+++ b/arch/mips/include/asm/mach-rc32434/rb.h
@@ -29,15 +29,6 @@
#define DEV3TC 0x01003C
#define BTCS 0x010040
#define BTCOMPARE 0x010044
-#define GPIOBASE 0x050000
-/* Offsets relative to GPIOBASE */
-#define GPIOFUNC 0x00
-#define GPIOCFG 0x04
-#define GPIOD 0x08
-#define GPIOILEVEL 0x0C
-#define GPIOISTAT 0x10
-#define GPIONMIEN 0x14
-#define IMASK6 0x38
#define LO_WPX (1 << 0)
#define LO_ALE (1 << 1)
#define LO_CLE (1 << 2)
diff --git a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c
index 94f02ada4082..29c21b9d42da 100644
--- a/arch/mips/rb532/gpio.c
+++ b/arch/mips/rb532/gpio.c
@@ -37,6 +37,16 @@
#include <asm/mach-rc32434/rb.h>
#include <asm/mach-rc32434/gpio.h>
+#define GPIOBASE 0x050000
+/* Offsets relative to GPIOBASE */
+#define GPIOFUNC 0x00
+#define GPIOCFG 0x04
+#define GPIOD 0x08
+#define GPIOILEVEL 0x0C
+#define GPIOISTAT 0x10
+#define GPIONMIEN 0x14
+#define IMASK6 0x38
+
struct rb532_gpio_chip {
struct gpio_chip chip;
void __iomem *regbase;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v4] MIPS: rb532: move GPIOD definition into C-files
2022-03-30 12:09 [PATCH v4] MIPS: rb532: move GPIOD definition into C-files Jackie Liu
@ 2022-03-30 18:35 ` Thomas Bogendoerfer
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2022-03-30 18:35 UTC (permalink / raw)
To: Jackie Liu
Cc: linus.walleij, ralf, linux-mips, jic23, andy.shevchenko,
sergei.shtylyov
On Wed, Mar 30, 2022 at 08:09:21PM +0800, Jackie Liu wrote:
> From: Jackie Liu <liuyun01@kylinos.cn>
>
> My kernel robot reports build error from drivers/iio/adc/da9150-gpadc.c,
>
> drivers/iio/adc/da9150-gpadc.c:254:13: error: ‘DA9150_GPADC_CHAN_0x08’
> undeclared here (not in a function); did you mean ‘DA9150_GPADC_CHAN_TBAT’?
> 254 | .channel = DA9150_GPADC_CHAN_##_id,
>
> We define GPIOD in rb.h, in fact it should only be used in gpio.c, but
> it affects the driver da9150-gpadc.c which goes against the original
> intention of the design, just move it to its scope.
>
> Fixes: 1b432840d0a4 ("MIPS: RB532: GPIO register offsets are relative to GPIOBASE")
> Suggested-by: Jonathan Cameron <jic23@kernel.org>
> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Reported-by: k2ci <kernel-bot@kylinos.cn>
> Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-30 19:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-30 12:09 [PATCH v4] MIPS: rb532: move GPIOD definition into C-files Jackie Liu
2022-03-30 18:35 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox