2020-07-17 03:42:41

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the mfd tree

Hi all,

After merging the mfd tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

drivers/mfd/kempld-core.c: In function 'kempld_register_cells_generic':
drivers/mfd/kempld-core.c:105:13: error: assignment of read-only location 'devs[i++]'
105 | devs[i++] = kempld_devs[KEMPLD_I2C];
| ^
drivers/mfd/kempld-core.c:108:13: error: assignment of read-only location 'devs[i++]'
108 | devs[i++] = kempld_devs[KEMPLD_WDT];
| ^
drivers/mfd/kempld-core.c:111:13: error: assignment of read-only location 'devs[i++]'
111 | devs[i++] = kempld_devs[KEMPLD_GPIO];
| ^
drivers/mfd/kempld-core.c:114:13: error: assignment of read-only location 'devs[i++]'
114 | devs[i++] = kempld_devs[KEMPLD_UART];
| ^

Caused by commit

70d48975c152 ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes")

I have added the following fix patch for today (I assume that there is
a better solution):

From: Stephen Rothwell <[email protected]>
Date: Fri, 17 Jul 2020 13:36:22 +1000
Subject: [PATCH] fix up for struct mfd_cell change

Fixes: 70d48975c152 ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes")
Signed-off-by: Stephen Rothwell <[email protected]>
---
drivers/mfd/kempld-core.c | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
index f48e21d8b97c..ad68ee699cb5 100644
--- a/drivers/mfd/kempld-core.c
+++ b/drivers/mfd/kempld-core.c
@@ -79,39 +79,31 @@ enum kempld_cells {
KEMPLD_UART,
};

-static const struct mfd_cell kempld_devs[] = {
- [KEMPLD_I2C] = {
- .name = "kempld-i2c",
- },
- [KEMPLD_WDT] = {
- .name = "kempld-wdt",
- },
- [KEMPLD_GPIO] = {
- .name = "kempld-gpio",
- },
- [KEMPLD_UART] = {
- .name = "kempld-uart",
- },
+static const char *kempld_devs[] = {
+ [KEMPLD_I2C] = "kempld-i2c",
+ [KEMPLD_WDT] = "kempld-wdt",
+ [KEMPLD_GPIO] = "kempld-gpio",
+ [KEMPLD_UART] = "kempld-uart",
};

#define KEMPLD_MAX_DEVS ARRAY_SIZE(kempld_devs)

static int kempld_register_cells_generic(struct kempld_device_data *pld)
{
- struct mfd_cell devs[KEMPLD_MAX_DEVS];
+ struct mfd_cell devs[KEMPLD_MAX_DEVS] = {};
int i = 0;

if (pld->feature_mask & KEMPLD_FEATURE_BIT_I2C)
- devs[i++] = kempld_devs[KEMPLD_I2C];
+ devs[i++].name = kempld_devs[KEMPLD_I2C];

if (pld->feature_mask & KEMPLD_FEATURE_BIT_WATCHDOG)
- devs[i++] = kempld_devs[KEMPLD_WDT];
+ devs[i++].name = kempld_devs[KEMPLD_WDT];

if (pld->feature_mask & KEMPLD_FEATURE_BIT_GPIO)
- devs[i++] = kempld_devs[KEMPLD_GPIO];
+ devs[i++].name = kempld_devs[KEMPLD_GPIO];

if (pld->feature_mask & KEMPLD_FEATURE_MASK_UART)
- devs[i++] = kempld_devs[KEMPLD_UART];
+ devs[i++].name = kempld_devs[KEMPLD_UART];

return mfd_add_devices(pld->dev, -1, devs, i, NULL, 0, NULL);
}
--
2.27.0

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2020-07-17 06:58:14

by Lee Jones

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the mfd tree

On Fri, 17 Jul 2020, Stephen Rothwell wrote:

> Hi all,
>
> After merging the mfd tree, today's linux-next build (x86_64 allmodconfig)
> failed like this:
>
> drivers/mfd/kempld-core.c: In function 'kempld_register_cells_generic':
> drivers/mfd/kempld-core.c:105:13: error: assignment of read-only location 'devs[i++]'
> 105 | devs[i++] = kempld_devs[KEMPLD_I2C];
> | ^
> drivers/mfd/kempld-core.c:108:13: error: assignment of read-only location 'devs[i++]'
> 108 | devs[i++] = kempld_devs[KEMPLD_WDT];
> | ^
> drivers/mfd/kempld-core.c:111:13: error: assignment of read-only location 'devs[i++]'
> 111 | devs[i++] = kempld_devs[KEMPLD_GPIO];
> | ^
> drivers/mfd/kempld-core.c:114:13: error: assignment of read-only location 'devs[i++]'
> 114 | devs[i++] = kempld_devs[KEMPLD_UART];
> | ^
>
> Caused by commit
>
> 70d48975c152 ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes")
>
> I have added the following fix patch for today (I assume that there is
> a better solution):
>
> From: Stephen Rothwell <[email protected]>
> Date: Fri, 17 Jul 2020 13:36:22 +1000
> Subject: [PATCH] fix up for struct mfd_cell change
>
> Fixes: 70d48975c152 ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes")

Thanks for fixing this Stephen.

I need to investigate why this didn't show up during my own testing.

> Signed-off-by: Stephen Rothwell <[email protected]>
> ---
> drivers/mfd/kempld-core.c | 28 ++++++++++------------------
> 1 file changed, 10 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
> index f48e21d8b97c..ad68ee699cb5 100644
> --- a/drivers/mfd/kempld-core.c
> +++ b/drivers/mfd/kempld-core.c
> @@ -79,39 +79,31 @@ enum kempld_cells {
> KEMPLD_UART,
> };
>
> -static const struct mfd_cell kempld_devs[] = {
> - [KEMPLD_I2C] = {
> - .name = "kempld-i2c",
> - },
> - [KEMPLD_WDT] = {
> - .name = "kempld-wdt",
> - },
> - [KEMPLD_GPIO] = {
> - .name = "kempld-gpio",
> - },
> - [KEMPLD_UART] = {
> - .name = "kempld-uart",
> - },
> +static const char *kempld_devs[] = {

Do you mind if I change this to 'kempld_dev_names' and still keep your
SoB?

> + [KEMPLD_I2C] = "kempld-i2c",
> + [KEMPLD_WDT] = "kempld-wdt",
> + [KEMPLD_GPIO] = "kempld-gpio",
> + [KEMPLD_UART] = "kempld-uart",
> };
>
> #define KEMPLD_MAX_DEVS ARRAY_SIZE(kempld_devs)
>
> static int kempld_register_cells_generic(struct kempld_device_data *pld)
> {
> - struct mfd_cell devs[KEMPLD_MAX_DEVS];
> + struct mfd_cell devs[KEMPLD_MAX_DEVS] = {};
> int i = 0;
>
> if (pld->feature_mask & KEMPLD_FEATURE_BIT_I2C)
> - devs[i++] = kempld_devs[KEMPLD_I2C];
> + devs[i++].name = kempld_devs[KEMPLD_I2C];
>
> if (pld->feature_mask & KEMPLD_FEATURE_BIT_WATCHDOG)
> - devs[i++] = kempld_devs[KEMPLD_WDT];
> + devs[i++].name = kempld_devs[KEMPLD_WDT];
>
> if (pld->feature_mask & KEMPLD_FEATURE_BIT_GPIO)
> - devs[i++] = kempld_devs[KEMPLD_GPIO];
> + devs[i++].name = kempld_devs[KEMPLD_GPIO];
>
> if (pld->feature_mask & KEMPLD_FEATURE_MASK_UART)
> - devs[i++] = kempld_devs[KEMPLD_UART];
> + devs[i++].name = kempld_devs[KEMPLD_UART];
>
> return mfd_add_devices(pld->dev, -1, devs, i, NULL, 0, NULL);
> }



--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-07-17 07:01:29

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the mfd tree

Hi Lee,

On Fri, 17 Jul 2020 07:56:36 +0100 Lee Jones <[email protected]> wrote:
>
> > +static const char *kempld_devs[] = {
>
> Do you mind if I change this to 'kempld_dev_names' and still keep your
> SoB?

No worries, I just did a quick hack, so if you neaten it up that would
be good.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2020-07-17 07:13:44

by Lee Jones

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the mfd tree

On Fri, 17 Jul 2020, Stephen Rothwell wrote:

> Hi Lee,
>
> On Fri, 17 Jul 2020 07:56:36 +0100 Lee Jones <[email protected]> wrote:
> >
> > > +static const char *kempld_devs[] = {
> >
> > Do you mind if I change this to 'kempld_dev_names' and still keep your
> > SoB?
>
> No worries, I just did a quick hack, so if you neaten it up that would
> be good.

Great. Thanks again.

Applied, thanks.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2020-11-05 04:42:12

by Michał Mirosław

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the mfd tree

On Thu, Nov 05, 2020 at 12:50:27PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the mfd tree, today's linux-next build (arm
> multi_v7_defconfig) failed like this:
>
> drivers/gpio/gpio-tps65910.c: In function 'tps65910_gpio_get':
> drivers/gpio/gpio-tps65910.c:31:2: error: implicit declaration of function 'tps65910_reg_read' [-Werror=implicit-function-declaration]
> 31 | tps65910_reg_read(tps65910, TPS65910_GPIO0 + offset, &val);
> | ^~~~~~~~~~~~~~~~~
> drivers/gpio/gpio-tps65910.c: In function 'tps65910_gpio_set':
> drivers/gpio/gpio-tps65910.c:46:3: error: implicit declaration of function 'tps65910_reg_set_bits' [-Werror=implicit-function-declaration]
> 46 | tps65910_reg_set_bits(tps65910, TPS65910_GPIO0 + offset,
> | ^~~~~~~~~~~~~~~~~~~~~
> drivers/gpio/gpio-tps65910.c:49:3: error: implicit declaration of function 'tps65910_reg_clear_bits' [-Werror=implicit-function-declaration]
> 49 | tps65910_reg_clear_bits(tps65910, TPS65910_GPIO0 + offset,
> | ^~~~~~~~~~~~~~~~~~~~~~~
>
> Caused by commit
>
> 23feb2c3367c ("mfd: tps65910: Clean up after switching to regmap")
>
> I have used the version of the mfd tree from next-20201104 for today.

Hi,

It's missing a patch for gpio part [1].

[1] https://lkml.org/lkml/2020/9/26/398

Best Regards
Micha? Miros?aw

2020-11-05 09:10:51

by Lee Jones

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the mfd tree

On Thu, 05 Nov 2020, Michał Mirosław wrote:

> On Thu, Nov 05, 2020 at 12:50:27PM +1100, Stephen Rothwell wrote:
> > Hi all,
> >
> > After merging the mfd tree, today's linux-next build (arm
> > multi_v7_defconfig) failed like this:
> >
> > drivers/gpio/gpio-tps65910.c: In function 'tps65910_gpio_get':
> > drivers/gpio/gpio-tps65910.c:31:2: error: implicit declaration of function 'tps65910_reg_read' [-Werror=implicit-function-declaration]
> > 31 | tps65910_reg_read(tps65910, TPS65910_GPIO0 + offset, &val);
> > | ^~~~~~~~~~~~~~~~~
> > drivers/gpio/gpio-tps65910.c: In function 'tps65910_gpio_set':
> > drivers/gpio/gpio-tps65910.c:46:3: error: implicit declaration of function 'tps65910_reg_set_bits' [-Werror=implicit-function-declaration]
> > 46 | tps65910_reg_set_bits(tps65910, TPS65910_GPIO0 + offset,
> > | ^~~~~~~~~~~~~~~~~~~~~
> > drivers/gpio/gpio-tps65910.c:49:3: error: implicit declaration of function 'tps65910_reg_clear_bits' [-Werror=implicit-function-declaration]
> > 49 | tps65910_reg_clear_bits(tps65910, TPS65910_GPIO0 + offset,
> > | ^~~~~~~~~~~~~~~~~~~~~~~
> >
> > Caused by commit
> >
> > 23feb2c3367c ("mfd: tps65910: Clean up after switching to regmap")
> >
> > I have used the version of the mfd tree from next-20201104 for today.
>
> Hi,
>
> It's missing a patch for gpio part [1].
>
> [1] https://lkml.org/lkml/2020/9/26/398

I'm aware of it. Just waiting for Linus' reply.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog