Skip to contentSkip to conversation

mfd: Use named initializers for arrays of *_device_data

PATCH Superseded Uwe Kleine-König (The Capable Hub) 8 participants 63 messages Jul 8 – Jul 10

Subsystems (52)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover mfd: Use named initializers for arrays of *_device_data

Hello,

this series superseeds my previous patch "[PATCH v1] mfd: Use named initializers for arrays of i2c_device_data"
(https://lore.kernel.org/lkml/[email protected])
that Lee asked me to rebase and also the series "[PATCH v1 0/3] mfd:
Initialize spi_device_id arrays using member names"
(https://lore.kernel.org/lkml/[email protected]).

The objective for this series is to prepare mfd for changing of_device_id etc to make driver_data a union, see
https://lore.kernel.org/all/[email protected]/
for the idea behind it.

This series is based on yesterday's next/master and it does the restructuring not only for i2c and spi (as the two series mentioned above), but for all *_device_id structures that I intend to modify with a union that affect mfd. So (I hope) this is the only patch series affecting mfd for this quest.

I don't care much about the last few patches unifying the coding style. I think it's a good opportunity to do that, but if you don't like them, just don't apply these.

Best regards
Uwe

Uwe Kleine-König (The Capable Hub) (23):
mfd: bcm2835-pm: Remove member of struct bcm2835_pm that is only used
locally
mfd: bcm2835-pm: Drop unused header
mfd: kempld: Simplify device abstraction
mfd: lp87565: Explicitly set driver data for the generic dt compatible
mfd: mt6360: Drop irrelevant __maybe_unused
mfd: rt4831: Drop irrelevant __maybe_unused
mfd: loongson-se: Drop unused assignment of acpi_device_id driver data
mfd: Drop unused assignment of i2c_device_id driver data
mfd: Drop unused assignment of platform_device_id driver data
mfd: Drop unused assignment of spi_device_id driver data
mfd: Use named initializers for acpi_device_id arrays
mfd: intel-m10-bmc-pmci: Use named initializers for dfl_device_id
array
mfd: Use named initializers for arrays of i2c_device_id
mfd: twl6030: Use named initializers for of_device_id
mfd: Use PCI_DEVICE* macros to initialize pci_device_id arrays
mfd: Use named initializers for platform_device_id array
mfd: Use named initializers for arrays of spi_device_id
mfd: Unify style of acpi_device_id arrays
mfd: Unify style of dmi_system_id arrays
mfd: Unify style of i2c_device_id arrays
mfd: Unify style of of_device_id arrays
mfd: Unify style of pci_device_id arrays
mfd: Unify style of spi_device_id arrays

 drivers/mfd/88pm800.c                 |  4 +-
 drivers/mfd/88pm805.c                 |  4 +-
 drivers/mfd/88pm860x-core.c           |  8 ++--
 drivers/mfd/aat2870-core.c            |  2 +-
 drivers/mfd/ab8500-core.c             |  8 ++--
 drivers/mfd/ab8500-sysctrl.c          |  4 +-
 drivers/mfd/ac100.c                   |  2 +-
 drivers/mfd/act8945a.c                |  8 ++--
 drivers/mfd/adp5520.c                 |  4 +-
 drivers/mfd/altera-a10sr.c            |  4 +-
 drivers/mfd/altera-sysmgr.c           |  2 +-
 drivers/mfd/arizona-i2c.c             | 14 +++----
 drivers/mfd/arizona-spi.c             | 14 +++----
 drivers/mfd/as3711.c                  |  8 ++--
 drivers/mfd/as3722.c                  |  8 ++--
 drivers/mfd/atmel-hlcdc.c             |  2 +-
 drivers/mfd/atmel-smc.c               |  2 +-
 drivers/mfd/axp20x-i2c.c              | 26 ++++++------
 drivers/mfd/axp20x-rsb.c              |  2 +-
 drivers/mfd/bcm2835-pm.c              | 15 +++++--
 drivers/mfd/bcm590xx.c                |  4 +-
 drivers/mfd/bd9571mwv.c               |  6 +--
 drivers/mfd/bq257xx.c                 |  8 ++--
 drivers/mfd/cgbc-core.c               |  2 +-
 drivers/mfd/cros_ec_dev.c             |  2 +-
 drivers/mfd/cs40l50-i2c.c             |  6 +--
 drivers/mfd/cs40l50-spi.c             |  6 +--
 drivers/mfd/cs42l43-i2c.c             |  8 ++--
 drivers/mfd/cs5535-mfd.c              |  2 +-
 drivers/mfd/da903x.c                  |  6 +--
 drivers/mfd/da9052-i2c.c              | 12 +++---
 drivers/mfd/da9052-spi.c              | 12 +++---
 drivers/mfd/da9055-i2c.c              |  2 +-
 drivers/mfd/da9062-core.c             |  4 +-
 drivers/mfd/da9063-i2c.c              | 11 ++---
 drivers/mfd/da9150-core.c             |  4 +-
 drivers/mfd/db8500-prcmu.c            |  4 +-
 drivers/mfd/exynos-lpass.c            |  2 +-
 drivers/mfd/gateworks-gsc.c           |  2 +-
 drivers/mfd/hi6421-pmic-core.c        |  6 +--
 drivers/mfd/hi655x-pmic.c             |  4 +-
 drivers/mfd/intel-lpss-acpi.c         | 58 +++++++++++++--------------
 drivers/mfd/intel-m10-bmc-pmci.c      |  2 +-
 drivers/mfd/intel-m10-bmc-spi.c       |  6 +--
 drivers/mfd/intel_pmc_bxt.c           |  2 +-
 drivers/mfd/intel_quark_i2c_gpio.c    |  6 +--
 drivers/mfd/intel_soc_pmic_bxtwc.c    |  2 +-
 drivers/mfd/intel_soc_pmic_chtdc_ti.c |  4 +-
 drivers/mfd/intel_soc_pmic_chtwc.c    |  2 +-
 drivers/mfd/intel_soc_pmic_crc.c      |  6 +--
 drivers/mfd/intel_soc_pmic_mrfld.c    |  4 +-
 drivers/mfd/ioc3.c                    |  4 +-
 drivers/mfd/janz-cmodio.c             | 14 +++----
 drivers/mfd/kempld-core.c             | 29 ++++++--------
 drivers/mfd/khadas-mcu.c              |  4 +-
 drivers/mfd/lm3533-core.c             |  2 +-
 drivers/mfd/lochnagar-i2c.c           |  2 +-
 drivers/mfd/loongson-se.c             |  2 +-
 drivers/mfd/lp3943.c                  |  4 +-
 drivers/mfd/lp873x.c                  |  4 +-
 drivers/mfd/lp87565.c                 |  9 +++--
 drivers/mfd/lp8788.c                  |  2 +-
 drivers/mfd/lpc_ich.c                 |  2 +-
 drivers/mfd/macsmc.c                  |  2 +-
 drivers/mfd/madera-core.c             |  2 +-
 drivers/mfd/madera-i2c.c              | 18 ++++-----
 drivers/mfd/madera-spi.c              | 18 ++++-----
 drivers/mfd/max14577.c                |  4 +-
 drivers/mfd/max7360.c                 |  2 +-
 drivers/mfd/max77541.c                |  4 +-
 drivers/mfd/max77620.c                |  8 ++--
 drivers/mfd/max77686.c                |  2 +-
 drivers/mfd/max77693.c                |  2 +-
 drivers/mfd/max77714.c                |  2 +-
 drivers/mfd/max77759.c                |  4 +-
 drivers/mfd/max77843.c                |  8 ++--
 drivers/mfd/max8907.c                 |  6 +--
 drivers/mfd/max8925-i2c.c             |  4 +-
 drivers/mfd/max8997.c                 |  6 +--
 drivers/mfd/max8998.c                 |  6 +--
 drivers/mfd/mc13xxx-spi.c             |  6 +--
 drivers/mfd/menelaus.c                |  2 +-
 drivers/mfd/menf21bmc.c               |  2 +-
 drivers/mfd/motorola-cpcap.c          | 12 +++---
 drivers/mfd/mp2629.c                  |  2 +-
 drivers/mfd/mt6360-core.c             |  6 +--
 drivers/mfd/mt6370.c                  |  2 +-
 drivers/mfd/mt6397-core.c             |  4 +-
 drivers/mfd/mxs-lradc.c               |  4 +-
 drivers/mfd/ntxec.c                   |  4 +-
 drivers/mfd/ocelot-spi.c              |  2 +-
 drivers/mfd/omap-usb-host.c           |  4 +-
 drivers/mfd/palmas.c                  |  8 ++--
 drivers/mfd/pf1550.c                  |  2 +-
 drivers/mfd/qcom-pm8008.c             |  4 +-
 drivers/mfd/qcom-pm8xxx.c             |  6 +--
 drivers/mfd/rc5t583.c                 |  4 +-
 drivers/mfd/rdc321x-southbridge.c     |  2 +-
 drivers/mfd/retu-mfd.c                |  4 +-
 drivers/mfd/rk8xx-i2c.c               |  2 +-
 drivers/mfd/rk8xx-spi.c               |  2 +-
 drivers/mfd/rohm-bd71828.c            |  4 +-
 drivers/mfd/rohm-bd9576.c             |  6 +--
 drivers/mfd/rsmu_i2c.c                | 18 ++++-----
 drivers/mfd/rsmu_spi.c                | 14 +++----
 drivers/mfd/rt4831.c                  |  6 +--
 drivers/mfd/rt5033.c                  |  4 +-
 drivers/mfd/rz-mtu3.c                 |  2 +-
 drivers/mfd/sec-acpm.c                |  6 +--
 drivers/mfd/sec-i2c.c                 | 22 +++++-----
 drivers/mfd/si476x-i2c.c              |  8 ++--
 drivers/mfd/simple-mfd-i2c.c          |  2 +-
 drivers/mfd/sky81452.c                |  4 +-
 drivers/mfd/sm501.c                   |  4 +-
 drivers/mfd/smpro-core.c              |  2 +-
 drivers/mfd/sprd-sc27xx-spi.c         |  4 +-
 drivers/mfd/ssbi.c                    |  2 +-
 drivers/mfd/stm32-lptimer.c           |  4 +-
 drivers/mfd/stm32-timers.c            |  4 +-
 drivers/mfd/stmfx.c                   |  4 +-
 drivers/mfd/stmpe-i2c.c               | 34 ++++++++--------
 drivers/mfd/stmpe-spi.c               | 26 ++++++------
 drivers/mfd/stw481x.c                 |  8 ++--
 drivers/mfd/sun6i-prcm.c              |  2 +-
 drivers/mfd/tc3589x.c                 | 14 +++----
 drivers/mfd/ti-lmu.c                  | 10 ++---
 drivers/mfd/timberdale.c              |  2 +-
 drivers/mfd/tps6105x.c                |  6 +--
 drivers/mfd/tps65010.c                | 10 ++---
 drivers/mfd/tps6507x.c                |  6 +--
 drivers/mfd/tps65086.c                |  4 +-
 drivers/mfd/tps65090.c                |  6 +--
 drivers/mfd/tps65217.c                |  6 +--
 drivers/mfd/tps65218.c                |  8 ++--
 drivers/mfd/tps65219.c                |  8 ++--
 drivers/mfd/tps6586x.c                |  6 +--
 drivers/mfd/tps65910.c                | 12 +++---
 drivers/mfd/tps65912-i2c.c            |  4 +-
 drivers/mfd/tps65912-spi.c            |  4 +-
 drivers/mfd/tps6594-i2c.c             | 12 +++---
 drivers/mfd/tps6594-spi.c             | 12 +++---
 drivers/mfd/tqmx86.c                  |  2 +-
 drivers/mfd/twl-core.c                | 22 +++++-----
 drivers/mfd/twl4030-audio.c           |  4 +-
 drivers/mfd/twl4030-power.c           |  2 +-
 drivers/mfd/twl6030-irq.c             |  6 +--
 drivers/mfd/twl6040.c                 |  4 +-
 drivers/mfd/upboard-fpga.c            |  6 +--
 drivers/mfd/vexpress-sysreg.c         |  4 +-
 drivers/mfd/vx855.c                   |  2 +-
 drivers/mfd/wm831x-core.c             |  2 +-
 drivers/mfd/wm831x-i2c.c              | 14 +++----
 drivers/mfd/wm831x-spi.c              | 16 ++++----
 drivers/mfd/wm8350-i2c.c              |  6 +--
 drivers/mfd/wm8400-core.c             |  4 +-
 drivers/mfd/wm8994-core.c             |  8 ++--
 include/linux/mfd/bcm2835-pm.h        |  9 -----
 include/linux/mfd/kempld.h            |  2 -
 158 files changed, 518 insertions(+), 521 deletions(-)

base-commit: 8e9685d3c41c35dd1b37df70d854137abcb2fbac

Signature · 1 line
2.55.0.11.g153666a7d9bb
#1 lore raw

PATCH v2 1/23 mfd: bcm2835-pm: Remove member of struct bcm2835_pm that is only used locally

struct bcm2835_pm::soc is only used in bcm2835_pm_probe() and thus can be replaced by a local variable.

With that change enum bcm2835_soc is only used in the mfd core driver and so the definition can move there.

---
 drivers/mfd/bcm2835-pm.c       | 11 +++++++++--
 include/linux/mfd/bcm2835-pm.h |  7 -------
 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/mfd/bcm2835-pm.c +9 -2
index 9e8e3dcf4bce..87de35075419 100644
@@ -69,10 +69,17 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev,
 	return 0;
 }
 
+enum bcm2835_soc {
+	BCM2835_PM_SOC_BCM2835,
+	BCM2835_PM_SOC_BCM2711,
+	BCM2835_PM_SOC_BCM2712,
+};
+
 static int bcm2835_pm_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct bcm2835_pm *pm;
+	enum bcm2835_soc soc;
 	int ret;
 
 	pm = devm_kzalloc(dev, sizeof(*pm), GFP_KERNEL);
@@ -81,7 +88,7 @@ static int bcm2835_pm_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, pm);
 
 	pm->dev = dev;
-	pm->soc = (uintptr_t)device_get_match_data(dev);
+	soc = (uintptr_t)device_get_match_data(dev);
 
 	ret = bcm2835_pm_get_pdata(pdev, pm);
 	if (ret)
@@ -98,7 +105,7 @@ static int bcm2835_pm_probe(struct platform_device *pdev)
 	 * bcm2835-pm binding as the key for whether we can reference
 	 * the full PM register range and support power domains.
 	 */
-	if (pm->asb || pm->soc == BCM2835_PM_SOC_BCM2712)
+	if (pm->asb || soc == BCM2835_PM_SOC_BCM2712)
 		return devm_mfd_add_devices(dev, -1, bcm2835_power_devs,
 					    ARRAY_SIZE(bcm2835_power_devs),
 					    NULL, 0, NULL);
include/linux/mfd/bcm2835-pm.h +0 -7
index d2e17ab1dbfc..f70a810c55f7 100644
@@ -5,18 +5,11 @@
 
 #include <linux/regmap.h>
 
-enum bcm2835_soc {
-	BCM2835_PM_SOC_BCM2835,
-	BCM2835_PM_SOC_BCM2711,
-	BCM2835_PM_SOC_BCM2712,
-};
-
 struct bcm2835_pm {
 	struct device *dev;
 	void __iomem *base;
 	void __iomem *asb;
 	void __iomem *rpivid_asb;
-	enum bcm2835_soc soc;
 };
 
 #endif /* BCM2835_MFD_PM_H */
Signature · 1 line
2.55.0.11.g153666a7d9bb
#4 lore raw

PATCH v2 2/23 mfd: bcm2835-pm: Drop unused header

In reply to Uwe Kleine-König (The Capable Hub)

<linux/mfd/bcm2835-pm.h> doesn't use any symbols provided by <linux/regmap.h>, and neither does any of its users (i.e. drivers/mfd/bcm2835-pm.c, drivers/pmdomain/bcm/bcm2835-power.c, drivers/watchdog/bcm2835_wdt.c).

So the header is unused and can be dropped.

---
 include/linux/mfd/bcm2835-pm.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/mfd/bcm2835-pm.h +0 -2
index f70a810c55f7..12bb6bc2c07f 100644
@@ -3,8 +3,6 @@
 #ifndef BCM2835_MFD_PM_H
 #define BCM2835_MFD_PM_H
 
-#include <linux/regmap.h>
-
 struct bcm2835_pm {
 	struct device *dev;
 	void __iomem *base;
Signature · 1 line
2.55.0.11.g153666a7d9bb
#6 lore raw

PATCH v2 3/23 mfd: kempld: Simplify device abstraction

In reply to Uwe Kleine-König (The Capable Hub)

The devices that are created by the driver from DMI data and also ACPI devices all use the same platform data. Simplify the driver by hardcoding this instead of using the ACPI abstraction for multi-variant support without real variants.

then in kempld_create_platform_device .ioresource is always the same value (and this member isn't used otherwise), so this can be simplified, too and the member be dropped from struct kempld_platform_data.

---
 drivers/mfd/kempld-core.c  | 25 +++++++++++--------------
 include/linux/mfd/kempld.h |  2 --
 2 files changed, 11 insertions(+), 16 deletions(-)
drivers/mfd/kempld-core.c +11 -14
index b64729918dfd..e60736380cfe 100644
@@ -119,7 +119,6 @@ static struct resource kempld_ioresource = {
 
 static const struct kempld_platform_data kempld_platform_data_generic = {
 	.pld_clock		= KEMPLD_CLK,
-	.ioresource		= &kempld_ioresource,
 	.get_hardware_mutex	= kempld_get_hardware_mutex,
 	.release_hardware_mutex	= kempld_release_hardware_mutex,
 	.get_info		= kempld_get_info_generic,
@@ -128,15 +127,15 @@ static const struct kempld_platform_data kempld_platform_data_generic = {
 
 static struct platform_device *kempld_pdev;
 
-static int kempld_create_platform_device(const struct kempld_platform_data *pdata)
+static int kempld_create_platform_device(void)
 {
 	const struct platform_device_info pdevinfo = {
 		.name = "kempld",
 		.id = PLATFORM_DEVID_NONE,
-		.res = pdata->ioresource,
+		.res = &kempld_ioresource,
 		.num_res = 1,
-		.data = pdata,
-		.size_data = sizeof(*pdata),
+		.data = &kempld_platform_data_generic,
+		.size_data = sizeof(kempld_platform_data_generic),
 	};
 
 	kempld_pdev = platform_device_register_full(&pdevinfo);
@@ -415,11 +414,9 @@ static int kempld_probe(struct platform_device *pdev)
 		 * No kempld_pdev device has been registered in kempld_init,
 		 * so we seem to be probing an ACPI platform device.
 		 */
-		pdata = device_get_match_data(dev);
-		if (!pdata)
-			return -ENODEV;
-
-		ret = platform_device_add_data(pdev, pdata, sizeof(*pdata));
+		ret = platform_device_add_data(pdev,
+					       &kempld_platform_data_generic,
+					       sizeof(kempld_platform_data_generic));
 		if (ret)
 			return ret;
 	} else if (kempld_pdev == pdev) {
@@ -470,8 +467,8 @@ static void kempld_remove(struct platform_device *pdev)
 }
 
 static const struct acpi_device_id kempld_acpi_table[] = {
-	{ "KEM0000", (kernel_ulong_t)&kempld_platform_data_generic },
-	{ "KEM0001", (kernel_ulong_t)&kempld_platform_data_generic },
+	{ "KEM0000" },
+	{ "KEM0001" },
 	{}
 };
 MODULE_DEVICE_TABLE(acpi, kempld_acpi_table);
@@ -787,13 +784,13 @@ static int __init kempld_init(void)
 	if (force_device_id[0]) {
 		for (id = kempld_dmi_table; id->matches[0].slot != DMI_NONE; id++)
 			if (strstr(id->ident, force_device_id))
-				if (!kempld_create_platform_device(&kempld_platform_data_generic))
+				if (!kempld_create_platform_device())
 					break;
 		if (id->matches[0].slot == DMI_NONE)
 			return -ENODEV;
 	} else {
 		for (id = dmi_first_match(kempld_dmi_table); id; id = dmi_first_match(id+1))
-			if (kempld_create_platform_device(&kempld_platform_data_generic))
+			if (kempld_create_platform_device())
 				break;
 	}
 	return platform_driver_register(&kempld_driver);
include/linux/mfd/kempld.h +0 -2
index 5d75071eaaea..e9b3e4063aae 100644
@@ -99,7 +99,6 @@ struct kempld_device_data {
  * struct kempld_platform_data - PLD hardware configuration structure
  * @pld_clock:			PLD clock frequency
  * @gpio_base:			GPIO base pin number
- * @ioresource:			IO addresses of the PLD
  * @get_hardware_mutex:		PLD specific get_mutex callback
  * @release_hardware_mutex:	PLD specific release_mutex callback
  * @get_info:			PLD specific get_info callback
@@ -108,7 +107,6 @@ struct kempld_device_data {
 struct kempld_platform_data {
 	u32				pld_clock;
 	int				gpio_base;
-	struct resource			*ioresource;
 	void (*get_hardware_mutex)	(struct kempld_device_data *);
 	void (*release_hardware_mutex)	(struct kempld_device_data *);
 	int (*get_info)			(struct kempld_device_data *);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#8 lore raw

PATCH v2 4/23 mfd: lp87565: Explicitly set driver data for the generic dt compatible

In reply to Uwe Kleine-König (The Capable Hub)

The driver relies on .data being (void *)LP87565_DEVICE_TYPE_UNKNOWN (i.e. NULL) for the generic device tree compatible. Make this explicit.

---
Hello,

while I'm sure that the driver is improved by this patch, I'm unsure about the handling of the generic dt compatible. E.g. drivers/regulator/lp87565-regulator.c has:

        switch (lp87565->dev_type) {
        case LP87565_DEVICE_TYPE_LP87565_Q1:
                min_idx = LP87565_BUCK_10;
                max_idx = LP87565_BUCK_23;
                break;
        case LP87565_DEVICE_TYPE_LP87561_Q1:
                min_idx = LP87565_BUCK_3210;
                max_idx = LP87565_BUCK_3210;
                break;
        default:
                min_idx = LP87565_BUCK_0;
                max_idx = LP87565_BUCK_3;
                break;
        }

so if "ti,lp87565" is used for a one of the explicitly handled types above, wrong/surprising things happen. I don't know enough about this driver and hardware to suggest a better handling (apart from maybe just dropping the generic compatible handling).

Best regards
Uwe

---
 drivers/mfd/lp87565.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mfd/lp87565.c +4 -1
index b78ae79df5fa..efea1ba82811 100644
@@ -26,7 +26,10 @@ static const struct mfd_cell lp87565_cells[] = {
 };
 
 static const struct of_device_id of_lp87565_match_table[] = {
-	{ .compatible = "ti,lp87565", },
+	{
+		.compatible = "ti,lp87565",
+		.data = (void *)LP87565_DEVICE_TYPE_UNKNOWN,
+	},
 	{
 		.compatible = "ti,lp87524-q1",
 		.data = (void *)LP87565_DEVICE_TYPE_LP87524_Q1,
Signature · 1 line
2.55.0.11.g153666a7d9bb
#10 lore raw

PATCH v2 5/23 mfd: mt6360: Drop irrelevant __maybe_unused

In reply to Uwe Kleine-König (The Capable Hub)

Since commit 5ab23c7923a1 ("modpost: Create modalias for builtin modules") MODULE_DEVICE_TABLE() is enough to reference a device id array even if the driver is built-in. So mt6360_of_id[] is always used and the __maybe_unused marker serves no purpose and can be dropped.

---
 drivers/mfd/mt6360-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/mt6360-core.c +1 -1
index b9b1036c8ff4..254b00c905b7 100644
@@ -606,7 +606,7 @@ static int __maybe_unused mt6360_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(mt6360_pm_ops, mt6360_suspend, mt6360_resume);
 
-static const struct of_device_id __maybe_unused mt6360_of_id[] = {
+static const struct of_device_id mt6360_of_id[] = {
 	{ .compatible = "mediatek,mt6360", },
 	{},
 };
Signature · 1 line
2.55.0.11.g153666a7d9bb
#12 lore raw

PATCH v2 6/23 mfd: rt4831: Drop irrelevant __maybe_unused

In reply to Uwe Kleine-König (The Capable Hub)

Since commit 5ab23c7923a1 ("modpost: Create modalias for builtin modules") MODULE_DEVICE_TABLE() is enough to reference a device id array even if the driver is built-in. So rt4831_of_match[] is always used and the __maybe_unused marker serves no purpose and can be dropped.

---
 drivers/mfd/rt4831.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/rt4831.c +1 -1
index 1ab8870e4ebf..2b3f84b81c65 100644
@@ -98,7 +98,7 @@ static void rt4831_remove(struct i2c_client *client)
 		dev_warn(&client->dev, "Failed to disable outputs (%pe)\n", ERR_PTR(ret));
 }
 
-static const struct of_device_id __maybe_unused rt4831_of_match[] = {
+static const struct of_device_id rt4831_of_match[] = {
 	{ .compatible = "richtek,rt4831", },
 	{}
 };
Signature · 1 line
2.55.0.11.g153666a7d9bb
#14 lore raw

PATCH v2 7/23 mfd: loongson-se: Drop unused assignment of acpi_device_id driver data

In reply to Uwe Kleine-König (The Capable Hub)

The driver explicitly set the .driver_data member of struct acpi_device_id to zero without relying on that value. Drop this unused assignment.

This patch doesn't modify the compiled array, only its representation in source form benefits.

---
 drivers/mfd/loongson-se.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/loongson-se.c +1 -1
index 3902ba377d69..4c668e2d2241 100644
@@ -233,7 +233,7 @@ static int loongson_se_probe(struct platform_device *pdev)
 }
 
 static const struct acpi_device_id loongson_se_acpi_match[] = {
-	{ "LOON0011", 0 },
+	{ "LOON0011" },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, loongson_se_acpi_match);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#16 lore raw

PATCH v2 8/23 mfd: Drop unused assignment of i2c_device_id driver data

In reply to Uwe Kleine-König (The Capable Hub)

The drivers explicitly set the .driver_data member of struct i2c_device_id to zero without relying on that value. Drop these unused assignments.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

---
 drivers/mfd/as3711.c  | 2 +-
 drivers/mfd/rc5t583.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/as3711.c +1 -1
index 9741977031df..eb03b813d58f 100644
@@ -192,7 +192,7 @@ static int as3711_i2c_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id as3711_i2c_id[] = {
-	{.name = "as3711", .driver_data = 0},
+	{ .name = "as3711" },
 	{}
 };
 
drivers/mfd/rc5t583.c +1 -1
index 2c0e8e9630f7..4ad761fbfab2 100644
@@ -280,7 +280,7 @@ static int rc5t583_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id rc5t583_i2c_id[] = {
-	{.name = "rc5t583", .driver_data = 0},
+	{ .name = "rc5t583" },
 	{}
 };
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#18 lore raw

PATCH v2 9/23 mfd: Drop unused assignment of platform_device_id driver data

In reply to Uwe Kleine-König (The Capable Hub)

The drivers explicitly set the .driver_data member of struct platform_device_id to zero without relying on that value. Drop these unused assignments

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

---
 drivers/mfd/cros_ec_dev.c | 2 +-
 drivers/mfd/mt6397-core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/cros_ec_dev.c +1 -1
index e253c753beb6..a933cb936da6 100644
@@ -375,7 +375,7 @@ static void ec_device_remove(struct platform_device *pdev)
 }
 
 static const struct platform_device_id cros_ec_id[] = {
-	{ DRV_NAME, 0 },
+	{ DRV_NAME },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(platform, cros_ec_id);
drivers/mfd/mt6397-core.c +1 -1
index ea1d039477e3..7987583afc60 100644
@@ -429,7 +429,7 @@ static const struct of_device_id mt6397_of_match[] = {
 MODULE_DEVICE_TABLE(of, mt6397_of_match);
 
 static const struct platform_device_id mt6397_id[] = {
-	{ "mt6397", 0 },
+	{ "mt6397" },
 	{ },
 };
 MODULE_DEVICE_TABLE(platform, mt6397_id);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#20 lore raw

PATCH v2 10/23 mfd: Drop unused assignment of spi_device_id driver data

In reply to Uwe Kleine-König (The Capable Hub)

The drivers explicitly set the .driver_data member of struct spi_device_id to zero without relying on that value. Drop these unused assignments.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

---
 drivers/mfd/ocelot-spi.c   | 2 +-
 drivers/mfd/rk8xx-spi.c    | 2 +-
 drivers/mfd/tps65912-spi.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/mfd/ocelot-spi.c +1 -1
index fc30663824bb..3c8260c7f8fb 100644
@@ -270,7 +270,7 @@ static int ocelot_spi_probe(struct spi_device *spi)
 }
 
 static const struct spi_device_id ocelot_spi_ids[] = {
-	{ "vsc7512", 0 },
+	{ "vsc7512" },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, ocelot_spi_ids);
drivers/mfd/rk8xx-spi.c +1 -1
index 3405fb82ff9f..95749a89f092 100644
@@ -104,7 +104,7 @@ static const struct of_device_id rk8xx_spi_of_match[] = {
 MODULE_DEVICE_TABLE(of, rk8xx_spi_of_match);
 
 static const struct spi_device_id rk8xx_spi_id_table[] = {
-	{ "rk806", 0 },
+	{ "rk806" },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, rk8xx_spi_id_table);
drivers/mfd/tps65912-spi.c +1 -1
index 2a77dccd6059..78f9b6015902 100644
@@ -43,7 +43,7 @@ static int tps65912_spi_probe(struct spi_device *spi)
 }
 
 static const struct spi_device_id tps65912_spi_id_table[] = {
-	{ "tps65912", 0 },
+	{ "tps65912" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(spi, tps65912_spi_id_table);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#22 lore raw

PATCH v2 11/23 mfd: Use named initializers for acpi_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct acpi_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

---
 drivers/mfd/cs42l43-i2c.c             |  4 +-
 drivers/mfd/intel-lpss-acpi.c         | 58 +++++++++++++--------------
 drivers/mfd/intel_pmc_bxt.c           |  2 +-
 drivers/mfd/intel_soc_pmic_bxtwc.c    |  2 +-
 drivers/mfd/intel_soc_pmic_chtdc_ti.c |  2 +-
 drivers/mfd/intel_soc_pmic_chtwc.c    |  2 +-
 drivers/mfd/intel_soc_pmic_crc.c      |  2 +-
 drivers/mfd/intel_soc_pmic_mrfld.c    |  2 +-
 drivers/mfd/kempld-core.c             |  4 +-
 drivers/mfd/loongson-se.c             |  2 +-
 drivers/mfd/upboard-fpga.c            |  4 +-
 11 files changed, 42 insertions(+), 42 deletions(-)
drivers/mfd/cs42l43-i2c.c +2 -2
index cbe05c3ea910..e9cb4fb9854a 100644
@@ -65,8 +65,8 @@ MODULE_DEVICE_TABLE(of, cs42l43_of_match);
 
 #if IS_ENABLED(CONFIG_ACPI)
 static const struct acpi_device_id cs42l43_acpi_match[] = {
-	{ "CSC4243", CS42L43_DEVID_VAL },
-	{ "CSC2A3B", CS42L43B_DEVID_VAL },
+	{ .id = "CSC4243", .driver_data = CS42L43_DEVID_VAL },
+	{ .id = "CSC2A3B", .driver_data = CS42L43B_DEVID_VAL },
 	{}
 };
 MODULE_DEVICE_TABLE(acpi, cs42l43_acpi_match);
drivers/mfd/intel-lpss-acpi.c +29 -29

67 lines not on this page · raw message

drivers/mfd/intel_pmc_bxt.c +1 -1
index e405d7513ca1..6a9ad1f135c7 100644
@@ -414,7 +414,7 @@ static int intel_pmc_create_devices(struct intel_pmc_dev *pmc)
 }
 
 static const struct acpi_device_id intel_pmc_acpi_ids[] = {
-	{ "INT34D2" },
+	{ .id = "INT34D2" },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, intel_pmc_acpi_ids);
drivers/mfd/intel_soc_pmic_bxtwc.c +1 -1
index 117517c171b5..08fedf3d3fee 100644
@@ -606,7 +606,7 @@ static int bxtwc_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(bxtwc_pm_ops, bxtwc_suspend, bxtwc_resume);
 
 static const struct acpi_device_id bxtwc_acpi_ids[] = {
-	{ "INT34D3", },
+	{ .id = "INT34D3" },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, bxtwc_acpi_ids);
drivers/mfd/intel_soc_pmic_chtdc_ti.c +1 -1
index 6daf33e07ea0..ff6223d6f54b 100644
@@ -162,7 +162,7 @@ static int chtdc_ti_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(chtdc_ti_pm_ops, chtdc_ti_suspend, chtdc_ti_resume);
 
 static const struct acpi_device_id chtdc_ti_acpi_ids[] = {
-	{ "INT33F5" },
+	{ .id = "INT33F5" },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, chtdc_ti_acpi_ids);
drivers/mfd/intel_soc_pmic_chtwc.c +1 -1
index aa71a7d83fcd..413d2fd4f86a 100644
@@ -261,7 +261,7 @@ static const struct i2c_device_id cht_wc_i2c_id[] = {
 };
 
 static const struct acpi_device_id cht_wc_acpi_ids[] = {
-	{ "INT34D3", },
+	{ .id = "INT34D3" },
 	{ }
 };
 
drivers/mfd/intel_soc_pmic_crc.c +1 -1
index 627a89334908..d3db727c08de 100644
@@ -252,7 +252,7 @@ static int crystal_cove_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(crystal_cove_pm_ops, crystal_cove_suspend, crystal_cove_resume);
 
 static const struct acpi_device_id crystal_cove_acpi_match[] = {
-	{ "INT33FD" },
+	{ .id = "INT33FD" },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, crystal_cove_acpi_match);
drivers/mfd/intel_soc_pmic_mrfld.c +1 -1
index 77121775c1a3..9d7e1881d693 100644
@@ -139,7 +139,7 @@ static int bcove_probe(struct platform_device *pdev)
 }
 
 static const struct acpi_device_id bcove_acpi_ids[] = {
-	{ "INTC100E" },
+	{ .id = "INTC100E" },
 	{}
 };
 MODULE_DEVICE_TABLE(acpi, bcove_acpi_ids);
drivers/mfd/kempld-core.c +2 -2
index e60736380cfe..bf02189b9a70 100644
@@ -467,8 +467,8 @@ static void kempld_remove(struct platform_device *pdev)
 }
 
 static const struct acpi_device_id kempld_acpi_table[] = {
-	{ "KEM0000" },
-	{ "KEM0001" },
+	{ .id = "KEM0000" },
+	{ .id = "KEM0001" },
 	{}
 };
 MODULE_DEVICE_TABLE(acpi, kempld_acpi_table);
drivers/mfd/loongson-se.c +1 -1
index 4c668e2d2241..49a95b8e4ca3 100644
@@ -233,7 +233,7 @@ static int loongson_se_probe(struct platform_device *pdev)
 }
 
 static const struct acpi_device_id loongson_se_acpi_match[] = {
-	{ "LOON0011" },
+	{ .id = "LOON0011" },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, loongson_se_acpi_match);
drivers/mfd/upboard-fpga.c +2 -2
index 9a9599dcb0a1..6674f4a1d2fe 100644
@@ -300,8 +300,8 @@ static int upboard_fpga_probe(struct platform_device *pdev)
 }
 
 static const struct acpi_device_id upboard_fpga_acpi_match[] = {
-	{ "AANT0F01", (kernel_ulong_t)&upboard_up2_fpga_data },
-	{ "AANT0F04", (kernel_ulong_t)&upboard_up_fpga_data },
+	{ .id = "AANT0F01", .driver_data = (kernel_ulong_t)&upboard_up2_fpga_data },
+	{ .id = "AANT0F04", .driver_data = (kernel_ulong_t)&upboard_up_fpga_data },
 	{}
 };
 MODULE_DEVICE_TABLE(acpi, upboard_fpga_acpi_match);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#25 lore raw

PATCH v2 12/23 mfd: intel-m10-bmc-pmci: Use named initializers for dfl_device_id array

In reply to Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct dfl_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled array, only its representation in source form benefits.

---
 drivers/mfd/intel-m10-bmc-pmci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/intel-m10-bmc-pmci.c +1 -1
index d213c6ec04ba..f78309bbabfd 100644
@@ -434,7 +434,7 @@ static void m10bmc_pmci_remove(struct dfl_device *ddev)
 #define FME_FEATURE_ID_M10BMC_PMCI	0x12
 
 static const struct dfl_device_id m10bmc_pmci_ids[] = {
-	{ FME_ID, FME_FEATURE_ID_M10BMC_PMCI },
+	{ .type = FME_ID, .feature_id = FME_FEATURE_ID_M10BMC_PMCI },
 	{ }
 };
 MODULE_DEVICE_TABLE(dfl, m10bmc_pmci_ids);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#27 lore raw

PATCH v2 13/23 mfd: Use named initializers for arrays of i2c_device_id

In reply to Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct i2c_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

---
 drivers/mfd/88pm800.c            |  2 +-
 drivers/mfd/88pm805.c            |  2 +-
 drivers/mfd/88pm860x-core.c      |  2 +-
 drivers/mfd/aat2870-core.c       |  2 +-
 drivers/mfd/act8945a.c           |  2 +-
 drivers/mfd/adp5520.c            |  4 ++--
 drivers/mfd/arizona-i2c.c        | 12 ++++++------
 drivers/mfd/as3722.c             |  2 +-
 drivers/mfd/axp20x-i2c.c         | 22 +++++++++++-----------
 drivers/mfd/bcm590xx.c           |  4 ++--
 drivers/mfd/bd9571mwv.c          |  2 +-
 drivers/mfd/bq257xx.c            |  4 ++--
 drivers/mfd/cs40l50-i2c.c        |  2 +-
 drivers/mfd/da903x.c             |  4 ++--
 drivers/mfd/da9052-i2c.c         | 10 +++++-----
 drivers/mfd/da9055-i2c.c         |  2 +-
 drivers/mfd/da9062-core.c        |  4 ++--
 drivers/mfd/da9063-i2c.c         |  4 ++--
 drivers/mfd/da9150-core.c        |  2 +-
 drivers/mfd/intel_soc_pmic_crc.c |  2 +-
 drivers/mfd/lm3533-core.c        |  2 +-
 drivers/mfd/lp3943.c             |  2 +-
 drivers/mfd/lp873x.c             |  2 +-
 drivers/mfd/lp87565.c            |  2 +-
 drivers/mfd/lp8788.c             |  2 +-
 drivers/mfd/madera-i2c.c         | 18 +++++++++---------
 drivers/mfd/max14577.c           |  4 ++--
 drivers/mfd/max77541.c           |  4 ++--
 drivers/mfd/max77620.c           |  6 +++---
 drivers/mfd/max77693.c           |  2 +-
 drivers/mfd/max77759.c           |  2 +-
 drivers/mfd/max77843.c           |  2 +-
 drivers/mfd/max8907.c            |  2 +-
 drivers/mfd/max8925-i2c.c        |  2 +-
 drivers/mfd/max8997.c            |  4 ++--
 drivers/mfd/max8998.c            |  4 ++--
 drivers/mfd/menelaus.c           |  2 +-
 drivers/mfd/menf21bmc.c          |  2 +-
 drivers/mfd/palmas.c             |  8 ++++----
 drivers/mfd/pf1550.c             |  2 +-
 drivers/mfd/retu-mfd.c           |  4 ++--
 drivers/mfd/rsmu_i2c.c           | 15 +++++++--------
 drivers/mfd/rt5033.c             |  2 +-
 drivers/mfd/si476x-i2c.c         |  6 +++---
 drivers/mfd/sky81452.c           |  2 +-
 drivers/mfd/stmpe-i2c.c          | 16 ++++++++--------
 drivers/mfd/stw481x.c            |  2 +-
 drivers/mfd/tc3589x.c            | 14 +++++++-------
 drivers/mfd/ti-lmu.c             | 10 +++++-----
 drivers/mfd/tps6105x.c           |  4 ++--
 drivers/mfd/tps65010.c           | 10 +++++-----
 drivers/mfd/tps6507x.c           |  2 +-
 drivers/mfd/tps65086.c           |  2 +-
 drivers/mfd/tps65090.c           |  2 +-
 drivers/mfd/tps65217.c           |  2 +-
 drivers/mfd/tps65218.c           |  4 ++--
 drivers/mfd/tps6586x.c           |  2 +-
 drivers/mfd/tps65910.c           |  4 ++--
 drivers/mfd/tps65912-i2c.c       |  2 +-
 drivers/mfd/twl-core.c           | 22 +++++++++++-----------
 drivers/mfd/twl6040.c            |  4 ++--
 drivers/mfd/wm831x-i2c.c         | 14 +++++++-------
 drivers/mfd/wm8350-i2c.c         |  6 +++---
 drivers/mfd/wm8400-core.c        |  2 +-
 drivers/mfd/wm8994-core.c        |  8 ++++----
 65 files changed, 162 insertions(+), 163 deletions(-)
drivers/mfd/88pm800.c +1 -1
index e9941da58b18..74dc419402f9 100644
@@ -116,7 +116,7 @@ enum {
 #define PM800_CHIP_GEN_ID_NUM	0x3
 
 static const struct i2c_device_id pm80x_id_table[] = {
-	{ "88PM800" },
+	{ .name = "88PM800" },
 	{} /* NULL terminated */
 };
 MODULE_DEVICE_TABLE(i2c, pm80x_id_table);
drivers/mfd/88pm805.c +1 -1
index f5d6663172ee..2eb3380a5207 100644
@@ -30,7 +30,7 @@
 #include <linux/delay.h>
 
 static const struct i2c_device_id pm80x_id_table[] = {
-	{ "88PM805" },
+	{ .name = "88PM805" },
 	{} /* NULL terminated */
 };
 MODULE_DEVICE_TABLE(i2c, pm80x_id_table);
drivers/mfd/88pm860x-core.c +1 -1
index 77230fbe07be..1b201ad129c2 100644
@@ -1232,7 +1232,7 @@ static int pm860x_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(pm860x_pm_ops, pm860x_suspend, pm860x_resume);
 
 static const struct i2c_device_id pm860x_id_table[] = {
-	{ "88PM860x" },
+	{ .name = "88PM860x" },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, pm860x_id_table);
drivers/mfd/aat2870-core.c +1 -1
index 34d66ba9646a..43fbf9cb1713 100644
@@ -437,7 +437,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend,
 				aat2870_i2c_resume);
 
 static const struct i2c_device_id aat2870_i2c_id_table[] = {
-	{ "aat2870" },
+	{ .name = "aat2870" },
 	{ }
 };
 
drivers/mfd/act8945a.c +1 -1
index cafefb4451cb..bb1b4e4fb288 100644
@@ -54,7 +54,7 @@ static int act8945a_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id act8945a_i2c_id[] = {
-	{ "act8945a" },
+	{ .name = "act8945a" },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, act8945a_i2c_id);
drivers/mfd/adp5520.c +2 -2
index bd6f4965ebc8..a4b58f431f92 100644
@@ -329,8 +329,8 @@ static int adp5520_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(adp5520_pm, adp5520_suspend, adp5520_resume);
 
 static const struct i2c_device_id adp5520_id[] = {
-	{ "pmic-adp5520", ID_ADP5520 },
-	{ "pmic-adp5501", ID_ADP5501 },
+	{ .name = "pmic-adp5520", .driver_data = ID_ADP5520 },
+	{ .name = "pmic-adp5501", .driver_data = ID_ADP5501 },
 	{ }
 };
 
drivers/mfd/arizona-i2c.c +6 -6
index 10e76fc8f12e..1ea8a59948b6 100644
@@ -85,12 +85,12 @@ static void arizona_i2c_remove(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id arizona_i2c_id[] = {
-	{ "wm5102", WM5102 },
-	{ "wm5110", WM5110 },
-	{ "wm8280", WM8280 },
-	{ "wm8997", WM8997 },
-	{ "wm8998", WM8998 },
-	{ "wm1814", WM1814 },
+	{ .name = "wm5102", .driver_data = WM5102 },
+	{ .name = "wm5110", .driver_data = WM5110 },
+	{ .name = "wm8280", .driver_data = WM8280 },
+	{ .name = "wm8997", .driver_data = WM8997 },
+	{ .name = "wm8998", .driver_data = WM8998 },
+	{ .name = "wm1814", .driver_data = WM1814 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, arizona_i2c_id);
drivers/mfd/as3722.c +1 -1
index 7ab6fcc9c27c..2f58709ffd9a 100644
@@ -432,7 +432,7 @@ static const struct of_device_id as3722_of_match[] = {
 MODULE_DEVICE_TABLE(of, as3722_of_match);
 
 static const struct i2c_device_id as3722_i2c_id[] = {
-	{ "as3722" },
+	{ .name = "as3722" },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, as3722_i2c_id);
drivers/mfd/axp20x-i2c.c +11 -11
index 5c93136f977e..2f595e2b883c 100644
@@ -76,17 +76,17 @@ MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match);
 #endif
 
 static const struct i2c_device_id axp20x_i2c_id[] = {
-	{ "axp152" },
-	{ "axp192" },
-	{ "axp202" },
-	{ "axp209" },
-	{ "axp221" },
-	{ "axp223" },
-	{ "axp313a" },
-	{ "axp717" },
-	{ "axp803" },
-	{ "axp806" },
-	{ "axp15060" },
+	{ .name = "axp152" },
+	{ .name = "axp192" },
+	{ .name = "axp202" },
+	{ .name = "axp209" },
+	{ .name = "axp221" },
+	{ .name = "axp223" },
+	{ .name = "axp313a" },
+	{ .name = "axp717" },
+	{ .name = "axp803" },
+	{ .name = "axp806" },
+	{ .name = "axp15060" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id);
drivers/mfd/bcm590xx.c +2 -2
index 5a8456bbd63f..85a906b54541 100644
@@ -160,8 +160,8 @@ static const struct of_device_id bcm590xx_of_match[] = {
 MODULE_DEVICE_TABLE(of, bcm590xx_of_match);
 
 static const struct i2c_device_id bcm590xx_i2c_id[] = {
-	{ "bcm59054" },
-	{ "bcm59056" },
+	{ .name = "bcm59054" },
+	{ .name = "bcm59056" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, bcm590xx_i2c_id);
drivers/mfd/bd9571mwv.c +1 -1
index db8c2963fb48..2b6fe6fd9806 100644
@@ -268,7 +268,7 @@ static const struct of_device_id bd9571mwv_of_match_table[] = {
 MODULE_DEVICE_TABLE(of, bd9571mwv_of_match_table);
 
 static const struct i2c_device_id bd9571mwv_id_table[] = {
-	{ "bd9571mwv" },
+	{ .name = "bd9571mwv" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(i2c, bd9571mwv_id_table);
drivers/mfd/bq257xx.c +2 -2
index 054342c60b73..8ad9f0ad6512 100644
@@ -119,8 +119,8 @@ static int bq257xx_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id bq257xx_i2c_ids[] = {
-	{ "bq25703a", BQ25703A },
-	{ "bq25792", BQ25792 },
+	{ .name = "bq25703a", .driver_data = BQ25703A },
+	{ .name = "bq25792", .driver_data = BQ25792 },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, bq257xx_i2c_ids);
drivers/mfd/cs40l50-i2c.c +1 -1
index 639be743d956..6043eb6639b5 100644
@@ -40,7 +40,7 @@ static void cs40l50_i2c_remove(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id cs40l50_id_i2c[] = {
-	{ "cs40l50" },
+	{ .name = "cs40l50" },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, cs40l50_id_i2c);
drivers/mfd/da903x.c +2 -2
index e86b39de3303..c949ebc57b18 100644
@@ -439,8 +439,8 @@ static const struct da903x_chip_ops da903x_ops[] = {
 };
 
 static const struct i2c_device_id da903x_id_table[] = {
-	{ "da9030", 0 },
-	{ "da9034", 1 },
+	{ .name = "da9030", .driver_data = 0 },
+	{ .name = "da9034", .driver_data = 1 },
 	{ },
 };
 MODULE_DEVICE_TABLE(i2c, da903x_id_table);
drivers/mfd/da9052-i2c.c +5 -5
index fd000a21bcba..b75cfe805d5e 100644
@@ -103,11 +103,11 @@ static int da9052_i2c_disable_multiwrite(struct da9052 *da9052)
 }
 
 static const struct i2c_device_id da9052_i2c_id[] = {
-	{"da9052", DA9052},
-	{"da9053-aa", DA9053_AA},
-	{"da9053-ba", DA9053_BA},
-	{"da9053-bb", DA9053_BB},
-	{"da9053-bc", DA9053_BC},
+	{ .name = "da9052", .driver_data = DA9052 },
+	{ .name = "da9053-aa", .driver_data = DA9053_AA },
+	{ .name = "da9053-ba", .driver_data = DA9053_BA },
+	{ .name = "da9053-bb", .driver_data = DA9053_BB },
+	{ .name = "da9053-bc", .driver_data = DA9053_BC },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, da9052_i2c_id);
drivers/mfd/da9055-i2c.c +1 -1
index 6c1981832aaf..e85db66f79a1 100644
@@ -54,7 +54,7 @@ static void da9055_i2c_remove(struct i2c_client *i2c)
  * and CODEC, which must be different to operate together.
  */
 static const struct i2c_device_id da9055_i2c_id[] = {
-	{ "da9055-pmic" },
+	{ .name = "da9055-pmic" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, da9055_i2c_id);
drivers/mfd/da9062-core.c +2 -2
index 637c5f47a4b0..a90723d33ad9 100644
@@ -711,8 +711,8 @@ static const struct of_device_id da9062_dt_ids[] = {
 MODULE_DEVICE_TABLE(of, da9062_dt_ids);
 
 static const struct i2c_device_id da9062_i2c_id[] = {
-	{ "da9061", COMPAT_TYPE_DA9061 },
-	{ "da9062", COMPAT_TYPE_DA9062 },
+	{ .name = "da9061", .driver_data = COMPAT_TYPE_DA9061 },
+	{ .name = "da9062", .driver_data = COMPAT_TYPE_DA9062 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, da9062_i2c_id);
drivers/mfd/da9063-i2c.c +2 -2
index a803b7440f09..b57a6ee90aa9 100644
@@ -476,8 +476,8 @@ static int da9063_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id da9063_i2c_id[] = {
-	{ "da9063", PMIC_TYPE_DA9063 },
-	{ "da9063l", PMIC_TYPE_DA9063L },
+	{ .name = "da9063", .driver_data = PMIC_TYPE_DA9063 },
+	{ .name = "da9063l", .driver_data = PMIC_TYPE_DA9063L },
 	{},
 };
 MODULE_DEVICE_TABLE(i2c, da9063_i2c_id);
drivers/mfd/da9150-core.c +1 -1
index 5c59cc869fb3..ab2335b73a63 100644
@@ -494,7 +494,7 @@ static void da9150_shutdown(struct i2c_client *client)
 }
 
 static const struct i2c_device_id da9150_i2c_id[] = {
-	{ "da9150", },
+	{ .name = "da9150" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, da9150_i2c_id);
drivers/mfd/intel_soc_pmic_crc.c +1 -1
index d3db727c08de..c1c02700ef08 100644
@@ -258,7 +258,7 @@ static const struct acpi_device_id crystal_cove_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, crystal_cove_acpi_match);
 
 static const struct i2c_device_id crystal_cove_i2c_match[] = {
-	{ "intel_soc_pmic_crc" },
+	{ .name = "intel_soc_pmic_crc" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, crystal_cove_i2c_match);
drivers/mfd/lm3533-core.c +1 -1
index 0a2409d00b2e..1602d96987c5 100644
@@ -604,7 +604,7 @@ static void lm3533_i2c_remove(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id lm3533_i2c_ids[] = {
-	{ "lm3533" },
+	{ .name = "lm3533" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, lm3533_i2c_ids);
drivers/mfd/lp3943.c +1 -1
index 6764553147e4..503615a8d420 100644
@@ -126,7 +126,7 @@ static int lp3943_probe(struct i2c_client *cl)
 }
 
 static const struct i2c_device_id lp3943_ids[] = {
-	{ "lp3943" },
+	{ .name = "lp3943" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, lp3943_ids);
drivers/mfd/lp873x.c +1 -1
index d2c90302bf59..46444696f2f4 100644
@@ -67,7 +67,7 @@ static const struct of_device_id of_lp873x_match_table[] = {
 MODULE_DEVICE_TABLE(of, of_lp873x_match_table);
 
 static const struct i2c_device_id lp873x_id_table[] = {
-	{ "lp873x" },
+	{ .name = "lp873x" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, lp873x_id_table);
drivers/mfd/lp87565.c +1 -1
index efea1ba82811..14e80588efac 100644
@@ -108,7 +108,7 @@ static void lp87565_shutdown(struct i2c_client *client)
 }
 
 static const struct i2c_device_id lp87565_id_table[] = {
-	{ "lp87565-q1" },
+	{ .name = "lp87565-q1" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, lp87565_id_table);
drivers/mfd/lp8788.c +1 -1
index 32f255378f5a..48fe99a2b982 100644
@@ -216,7 +216,7 @@ static void lp8788_remove(struct i2c_client *cl)
 }
 
 static const struct i2c_device_id lp8788_ids[] = {
-	{ "lp8788" },
+	{ .name = "lp8788" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, lp8788_ids);
drivers/mfd/madera-i2c.c +9 -9
index 0986e4a99f4a..762f668ed20c 100644
@@ -112,15 +112,15 @@ static void madera_i2c_remove(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id madera_i2c_id[] = {
-	{ "cs47l15", CS47L15 },
-	{ "cs47l35", CS47L35 },
-	{ "cs47l85", CS47L85 },
-	{ "cs47l90", CS47L90 },
-	{ "cs47l91", CS47L91 },
-	{ "cs42l92", CS42L92 },
-	{ "cs47l92", CS47L92 },
-	{ "cs47l93", CS47L93 },
-	{ "wm1840", WM1840 },
+	{ .name = "cs47l15", .driver_data = CS47L15 },
+	{ .name = "cs47l35", .driver_data = CS47L35 },
+	{ .name = "cs47l85", .driver_data = CS47L85 },
+	{ .name = "cs47l90", .driver_data = CS47L90 },
+	{ .name = "cs47l91", .driver_data = CS47L91 },
+	{ .name = "cs42l92", .driver_data = CS42L92 },
+	{ .name = "cs47l92", .driver_data = CS47L92 },
+	{ .name = "cs47l93", .driver_data = CS47L93 },
+	{ .name = "wm1840", .driver_data = WM1840 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, madera_i2c_id);
drivers/mfd/max14577.c +2 -2
index da275a04a1ef..f3325d015ec6 100644
@@ -463,8 +463,8 @@ static void max14577_i2c_remove(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id max14577_i2c_id[] = {
-	{ "max14577", MAXIM_DEVICE_TYPE_MAX14577, },
-	{ "max77836", MAXIM_DEVICE_TYPE_MAX77836, },
+	{ .name = "max14577", .driver_data = MAXIM_DEVICE_TYPE_MAX14577 },
+	{ .name = "max77836", .driver_data = MAXIM_DEVICE_TYPE_MAX77836 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, max14577_i2c_id);
drivers/mfd/max77541.c +2 -2
index f91b4f5373ce..5f5b2ff181d3 100644
@@ -199,8 +199,8 @@ static const struct of_device_id max77541_of_id[] = {
 MODULE_DEVICE_TABLE(of, max77541_of_id);
 
 static const struct i2c_device_id max77541_id[] = {
-	{ "max77540", MAX77540 },
-	{ "max77541", MAX77541 },
+	{ .name = "max77540", .driver_data = MAX77540 },
+	{ .name = "max77541", .driver_data = MAX77541 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, max77541_id);
drivers/mfd/max77620.c +3 -3
index c4f89a9681f3..a66ca73997f5 100644
@@ -694,9 +694,9 @@ static int max77620_i2c_resume(struct device *dev)
 }
 
 static const struct i2c_device_id max77620_id[] = {
-	{"max77620", MAX77620},
-	{"max20024", MAX20024},
-	{"max77663", MAX77663},
+	{ .name = "max77620", .driver_data = MAX77620 },
+	{ .name = "max20024", .driver_data = MAX20024 },
+	{ .name = "max77663", .driver_data = MAX77663 },
 	{},
 };
 
drivers/mfd/max77693.c +1 -1
index 1c485a4c3dcf..411011afde37 100644
@@ -306,7 +306,7 @@ static void max77693_i2c_remove(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id max77693_i2c_id[] = {
-	{ "max77693", TYPE_MAX77693 },
+	{ .name = "max77693", .driver_data = TYPE_MAX77693 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, max77693_i2c_id);
drivers/mfd/max77759.c +1 -1
index 72b608a1ab3f..2347eb0b014b 100644
@@ -712,7 +712,7 @@ static int max77759_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id max77759_i2c_id[] = {
-	{ "max77759" },
+	{ .name = "max77759" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, max77759_i2c_id);
drivers/mfd/max77843.c +1 -1
index 2a48577b1a79..9e535ff1e3f7 100644
@@ -169,7 +169,7 @@ static const struct of_device_id max77843_dt_match[] = {
 };
 
 static const struct i2c_device_id max77843_id[] = {
-	{ "max77843", TYPE_MAX77843, },
+	{ .name = "max77843", .driver_data = TYPE_MAX77843 },
 	{ },
 };
 
drivers/mfd/max8907.c +1 -1
index 7bac1d651771..70ffc08a96d1 100644
@@ -300,7 +300,7 @@ MODULE_DEVICE_TABLE(of, max8907_of_match);
 #endif
 
 static const struct i2c_device_id max8907_i2c_id[] = {
-	{ "max8907" },
+	{ .name = "max8907" },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, max8907_i2c_id);
drivers/mfd/max8925-i2c.c +1 -1
index ab19ff0c7867..25390d0eabd4 100644
@@ -127,7 +127,7 @@ EXPORT_SYMBOL(max8925_set_bits);
 
 
 static const struct i2c_device_id max8925_id_table[] = {
-	{ "max8925" },
+	{ .name = "max8925" },
 	{ }
 };
 
drivers/mfd/max8997.c +2 -2
index 7ba8ed1dfde3..6edc18e0eebb 100644
@@ -229,8 +229,8 @@ static int max8997_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id max8997_i2c_id[] = {
-	{ "max8997", TYPE_MAX8997 },
-	{ "max8966", TYPE_MAX8966 },
+	{ .name = "max8997", .driver_data = TYPE_MAX8997 },
+	{ .name = "max8966", .driver_data = TYPE_MAX8966 },
 	{ }
 };
 
drivers/mfd/max8998.c +2 -2
index eb13bbaeda55..e93a5ffc9612 100644
@@ -223,8 +223,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id max8998_i2c_id[] = {
-	{ "max8998", TYPE_MAX8998 },
-	{ "lp3974", TYPE_LP3974},
+	{ .name = "max8998", .driver_data = TYPE_MAX8998 },
+	{ .name = "lp3974", .driver_data = TYPE_LP3974 },
 	{ }
 };
 
drivers/mfd/menelaus.c +1 -1
index a125d40fa121..22da12dbab8b 100644
@@ -1230,7 +1230,7 @@ static void menelaus_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id menelaus_id[] = {
-	{ "menelaus" },
+	{ .name = "menelaus" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, menelaus_id);
drivers/mfd/menf21bmc.c +1 -1
index 0f24de516d72..b2577f9e1e04 100644
@@ -101,7 +101,7 @@ menf21bmc_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id menf21bmc_id_table[] = {
-	{ "menf21bmc" },
+	{ .name = "menf21bmc" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, menf21bmc_id_table);
drivers/mfd/palmas.c +4 -4
index 7fc886f4f80e..26faecab1af3 100644
@@ -699,10 +699,10 @@ static const struct of_device_id of_palmas_match_tbl[] = {
 MODULE_DEVICE_TABLE(of, of_palmas_match_tbl);
 
 static const struct i2c_device_id palmas_i2c_id[] = {
-	{ "palmas", (kernel_ulong_t)&palmas_data },
-	{ "twl6035", (kernel_ulong_t)&palmas_data },
-	{ "twl6037", (kernel_ulong_t)&palmas_data },
-	{ "tps65913", (kernel_ulong_t)&palmas_data },
+	{ .name = "palmas", .driver_data = (kernel_ulong_t)&palmas_data },
+	{ .name = "twl6035", .driver_data = (kernel_ulong_t)&palmas_data },
+	{ .name = "twl6037", .driver_data = (kernel_ulong_t)&palmas_data },
+	{ .name = "tps65913", .driver_data = (kernel_ulong_t)&palmas_data },
 	{ /* end */ }
 };
 MODULE_DEVICE_TABLE(i2c, palmas_i2c_id);
drivers/mfd/pf1550.c +1 -1
index c4f567c05564..7c3348ad59dc 100644
@@ -340,7 +340,7 @@ static int pf1550_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(pf1550_pm, pf1550_suspend, pf1550_resume);
 
 static const struct i2c_device_id pf1550_i2c_id[] = {
-	{ "pf1550" },
+	{ .name = "pf1550" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(i2c, pf1550_i2c_id);
drivers/mfd/retu-mfd.c +2 -2
index 1d43458b4938..330366224e80 100644
@@ -300,8 +300,8 @@ static void retu_remove(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id retu_id[] = {
-	{ "retu" },
-	{ "tahvo" },
+	{ .name = "retu" },
+	{ .name = "tahvo" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, retu_id);
drivers/mfd/rsmu_i2c.c +7 -8
index c57795ed20f4..0041fa10981a 100644
@@ -328,14 +328,13 @@ static void rsmu_i2c_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id rsmu_i2c_id[] = {
-	{ "8a34000",  RSMU_CM },
-	{ "8a34001",  RSMU_CM },
-	{ "8a34002",  RSMU_CM },
-	{ "82p33810", RSMU_SABRE },
-	{ "82p33811", RSMU_SABRE },
-	{ "8v19n850", RSMU_SL },
-	{ "8v19n851", RSMU_SL },
-	{}
+	{ .name = "8a34000",  .driver_data = RSMU_CM },
+	{ .name = "8a34001",  .driver_data = RSMU_CM },
+	{ .name = "8a34002",  .driver_data = RSMU_CM },
+	{ .name = "82p33810", .driver_data = RSMU_SABRE },
+	{ .name = "82p33811", .driver_data = RSMU_SABRE },
+	{ .name = "8v19n850", .driver_data = RSMU_SL },
+	{ .name = "8v19n851", .driver_data = RSMU_SL },
 };
 MODULE_DEVICE_TABLE(i2c, rsmu_i2c_id);
 
drivers/mfd/rt5033.c +1 -1
index 072fd4447245..799661fb1c72 100644
@@ -107,7 +107,7 @@ static int rt5033_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id rt5033_i2c_id[] = {
-	{ "rt5033", },
+	{ .name = "rt5033" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, rt5033_i2c_id);
drivers/mfd/si476x-i2c.c +3 -3
index 55700ce711f4..f25a4b60071b 100644
@@ -841,9 +841,9 @@ static void si476x_core_remove(struct i2c_client *client)
 
 
 static const struct i2c_device_id si476x_id[] = {
-	{ "si4761", SI476X_CHIP_SI4761 },
-	{ "si4764", SI476X_CHIP_SI4764 },
-	{ "si4768", SI476X_CHIP_SI4768 },
+	{ .name = "si4761", .driver_data = SI476X_CHIP_SI4761 },
+	{ .name = "si4764", .driver_data = SI476X_CHIP_SI4764 },
+	{ .name = "si4768", .driver_data = SI476X_CHIP_SI4768 },
 	{ },
 };
 MODULE_DEVICE_TABLE(i2c, si476x_id);
drivers/mfd/sky81452.c +1 -1
index 771b62a5c70f..8a213176b7cd 100644
@@ -59,7 +59,7 @@ static int sky81452_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id sky81452_ids[] = {
-	{ "sky81452" },
+	{ .name = "sky81452" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, sky81452_ids);
drivers/mfd/stmpe-i2c.c +8 -8
index 943fa363efc3..8eee780afa16 100644
@@ -100,14 +100,14 @@ static void stmpe_i2c_remove(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id stmpe_i2c_id[] = {
-	{ "stmpe610", STMPE610 },
-	{ "stmpe801", STMPE801 },
-	{ "stmpe811", STMPE811 },
-	{ "stmpe1600", STMPE1600 },
-	{ "stmpe1601", STMPE1601 },
-	{ "stmpe1801", STMPE1801 },
-	{ "stmpe2401", STMPE2401 },
-	{ "stmpe2403", STMPE2403 },
+	{ .name = "stmpe610", .driver_data = STMPE610 },
+	{ .name = "stmpe801", .driver_data = STMPE801 },
+	{ .name = "stmpe811", .driver_data = STMPE811 },
+	{ .name = "stmpe1600", .driver_data = STMPE1600 },
+	{ .name = "stmpe1601", .driver_data = STMPE1601 },
+	{ .name = "stmpe1801", .driver_data = STMPE1801 },
+	{ .name = "stmpe2401", .driver_data = STMPE2401 },
+	{ .name = "stmpe2403", .driver_data = STMPE2403 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, stmpe_i2c_id);
drivers/mfd/stw481x.c +1 -1
index 5ed64d53c23d..da1e293d36e9 100644
@@ -222,7 +222,7 @@ static int stw481x_probe(struct i2c_client *client)
  * the structure of the I2C core.
  */
 static const struct i2c_device_id stw481x_id[] = {
-	{ "stw481x" },
+	{ .name = "stw481x" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, stw481x_id);
drivers/mfd/tc3589x.c +7 -7
index 2d4eb771e230..f812e7551f09 100644
@@ -466,13 +466,13 @@ static DEFINE_SIMPLE_DEV_PM_OPS(tc3589x_dev_pm_ops,
 				tc3589x_suspend, tc3589x_resume);
 
 static const struct i2c_device_id tc3589x_id[] = {
-	{ "tc35890", TC3589X_TC35890 },
-	{ "tc35892", TC3589X_TC35892 },
-	{ "tc35893", TC3589X_TC35893 },
-	{ "tc35894", TC3589X_TC35894 },
-	{ "tc35895", TC3589X_TC35895 },
-	{ "tc35896", TC3589X_TC35896 },
-	{ "tc3589x", TC3589X_UNKNOWN },
+	{ .name = "tc35890", .driver_data = TC3589X_TC35890 },
+	{ .name = "tc35892", .driver_data = TC3589X_TC35892 },
+	{ .name = "tc35893", .driver_data = TC3589X_TC35893 },
+	{ .name = "tc35894", .driver_data = TC3589X_TC35894 },
+	{ .name = "tc35895", .driver_data = TC3589X_TC35895 },
+	{ .name = "tc35896", .driver_data = TC3589X_TC35896 },
+	{ .name = "tc3589x", .driver_data = TC3589X_UNKNOWN },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, tc3589x_id);
drivers/mfd/ti-lmu.c +5 -5
index cfc9f88b9842..5d22830b010f 100644
@@ -206,11 +206,11 @@ static const struct of_device_id ti_lmu_of_match[] = {
 MODULE_DEVICE_TABLE(of, ti_lmu_of_match);
 
 static const struct i2c_device_id ti_lmu_ids[] = {
-	{ "lm3631", LM3631 },
-	{ "lm3632", LM3632 },
-	{ "lm3633", LM3633 },
-	{ "lm3695", LM3695 },
-	{ "lm36274", LM36274 },
+	{ .name = "lm3631", .driver_data = LM3631 },
+	{ .name = "lm3632", .driver_data = LM3632 },
+	{ .name = "lm3633", .driver_data = LM3633 },
+	{ .name = "lm3695", .driver_data = LM3695 },
+	{ .name = "lm36274", .driver_data = LM36274 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, ti_lmu_ids);
drivers/mfd/tps6105x.c +2 -2
index e2f6858d101e..94f5b1a6a923 100644
@@ -191,8 +191,8 @@ static void tps6105x_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id tps6105x_id[] = {
-	{ "tps61050" },
-	{ "tps61052" },
+	{ .name = "tps61050" },
+	{ .name = "tps61052" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, tps6105x_id);
drivers/mfd/tps65010.c +5 -5
index 8a144ec52201..4d428b82def9 100644
@@ -649,11 +649,11 @@ static int tps65010_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id tps65010_id[] = {
-	{ "tps65010", TPS65010 },
-	{ "tps65011", TPS65011 },
-	{ "tps65012", TPS65012 },
-	{ "tps65013", TPS65013 },
-	{ "tps65014", TPS65011 },	/* tps65011 charging at 6.5V max */
+	{ .name = "tps65010", .driver_data = TPS65010 },
+	{ .name = "tps65011", .driver_data = TPS65011 },
+	{ .name = "tps65012", .driver_data = TPS65012 },
+	{ .name = "tps65013", .driver_data = TPS65013 },
+	{ .name = "tps65014", .driver_data = TPS65011 },	/* tps65011 charging at 6.5V max */
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, tps65010_id);
drivers/mfd/tps6507x.c +1 -1
index 9865512dc7cc..ed806754d89f 100644
@@ -103,7 +103,7 @@ static int tps6507x_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id tps6507x_i2c_id[] = {
-	{ "tps6507x" },
+	{ .name = "tps6507x" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, tps6507x_i2c_id);
drivers/mfd/tps65086.c +1 -1
index 54832e9321b9..a73e0b5c0982 100644
@@ -127,7 +127,7 @@ static void tps65086_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id tps65086_id_table[] = {
-	{ "tps65086" },
+	{ .name = "tps65086" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(i2c, tps65086_id_table);
drivers/mfd/tps65090.c +1 -1
index 24f42175a9b4..ae845be3a8ea 100644
@@ -225,7 +225,7 @@ static int tps65090_i2c_probe(struct i2c_client *client)
 
 
 static const struct i2c_device_id tps65090_id_table[] = {
-	{ "tps65090" },
+	{ .name = "tps65090" },
 	{ }
 };
 
drivers/mfd/tps65217.c +1 -1
index c240fac0ede7..cef5cefafea3 100644
@@ -390,7 +390,7 @@ static void tps65217_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id tps65217_id_table[] = {
-	{"tps65217", TPS65217},
+	{ .name = "tps65217", .driver_data = TPS65217 },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(i2c, tps65217_id_table);
drivers/mfd/tps65218.c +2 -2
index 4f3e632f726f..d2d39bd7eddd 100644
@@ -336,8 +336,8 @@ static int tps65218_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id tps65218_id_table[] = {
-	{ "tps65218", TPS65218 },
-	{ },
+	{ .name = "tps65218", .driver_data = TPS65218 },
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, tps65218_id_table);
 
drivers/mfd/tps6586x.c +1 -1
index f5f805446603..6fa932cda025 100644
@@ -642,7 +642,7 @@ static SIMPLE_DEV_PM_OPS(tps6586x_pm_ops, tps6586x_i2c_suspend,
 			 tps6586x_i2c_resume);
 
 static const struct i2c_device_id tps6586x_id_table[] = {
-	{ "tps6586x" },
+	{ .name = "tps6586x" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, tps6586x_id_table);
drivers/mfd/tps65910.c +2 -2
index 6243b66b1b6f..b0dbee3e6ea2 100644
@@ -532,8 +532,8 @@ static int tps65910_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id tps65910_i2c_id[] = {
-       { "tps65910", TPS65910 },
-       { "tps65911", TPS65911 },
+       { .name = "tps65910", .driver_data = TPS65910 },
+       { .name = "tps65911", .driver_data = TPS65911 },
        { }
 };
 
drivers/mfd/tps65912-i2c.c +1 -1
index 138e50497b51..3eca8880532e 100644
@@ -43,7 +43,7 @@ static int tps65912_i2c_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id tps65912_i2c_id_table[] = {
-	{ "tps65912" },
+	{ .name = "tps65912" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(i2c, tps65912_i2c_id_table);
drivers/mfd/twl-core.c +11 -11
index c024a28b057e..4eb553913a7b 100644
@@ -926,17 +926,17 @@ static int __maybe_unused twl_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(twl_dev_pm_ops, twl_suspend, twl_resume);
 
 static const struct i2c_device_id twl_ids[] = {
-	{ "twl4030", TWL4030_VAUX2 },	/* "Triton 2" */
-	{ "twl5030", 0 },		/* T2 updated */
-	{ "twl5031", TWL5031 },		/* TWL5030 updated */
-	{ "tps65950", 0 },		/* catalog version of twl5030 */
-	{ "tps65930", TPS_SUBSET },	/* fewer LDOs and DACs; no charger */
-	{ "tps65920", TPS_SUBSET },	/* fewer LDOs; no codec or charger */
-	{ "tps65921", TPS_SUBSET },	/* fewer LDOs; no codec, no LED
-					   and vibrator. Charger in USB module*/
-	{ "twl6030", TWL6030_CLASS },	/* "Phoenix power chip" */
-	{ "twl6032", TWL6030_CLASS | TWL6032_SUBCLASS }, /* "Phoenix lite" */
-	{ /* end of list */ },
+	{ .name = "twl4030", .driver_data = TWL4030_VAUX2 },	/* "Triton 2" */
+	{ .name = "twl5030", .driver_data = 0 },		/* T2 updated */
+	{ .name = "twl5031", .driver_data = TWL5031 },		/* TWL5030 updated */
+	{ .name = "tps65950", .driver_data = 0 },		/* catalog version of twl5030 */
+	{ .name = "tps65930", .driver_data = TPS_SUBSET },	/* fewer LDOs and DACs; no charger */
+	{ .name = "tps65920", .driver_data = TPS_SUBSET },	/* fewer LDOs; no codec or charger */
+	{ .name = "tps65921", .driver_data = TPS_SUBSET },	/* fewer LDOs; no codec, no LED
+						   and vibrator. Charger in USB module*/
+	{ .name = "twl6030", .driver_data = TWL6030_CLASS },	/* "Phoenix power chip" */
+	{ .name = "twl6032", .driver_data = TWL6030_CLASS | TWL6032_SUBCLASS }, /* "Phoenix lite" */
+	{ /* end of list */ }
 };
 
 /* One Client Driver , 4 Clients */
drivers/mfd/twl6040.c +2 -2
index 562a0f939f6e..ed2a2cca8cb9 100644
@@ -817,8 +817,8 @@ static void twl6040_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id twl6040_i2c_id[] = {
-	{ "twl6040" },
-	{ "twl6041" },
+	{ .name = "twl6040" },
+	{ .name = "twl6041" },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, twl6040_i2c_id);
drivers/mfd/wm831x-i2c.c +7 -7
index 9bee007f9c99..5a093086021a 100644
@@ -72,13 +72,13 @@ static int wm831x_i2c_poweroff(struct device *dev)
 }
 
 static const struct i2c_device_id wm831x_i2c_id[] = {
-	{ "wm8310", WM8310 },
-	{ "wm8311", WM8311 },
-	{ "wm8312", WM8312 },
-	{ "wm8320", WM8320 },
-	{ "wm8321", WM8321 },
-	{ "wm8325", WM8325 },
-	{ "wm8326", WM8326 },
+	{ .name = "wm8310", .driver_data = WM8310 },
+	{ .name = "wm8311", .driver_data = WM8311 },
+	{ .name = "wm8312", .driver_data = WM8312 },
+	{ .name = "wm8320", .driver_data = WM8320 },
+	{ .name = "wm8321", .driver_data = WM8321 },
+	{ .name = "wm8325", .driver_data = WM8325 },
+	{ .name = "wm8326", .driver_data = WM8326 },
 	{ }
 };
 
drivers/mfd/wm8350-i2c.c +3 -3
index 767c176b12a7..b20761a88b05 100644
@@ -41,9 +41,9 @@ static int wm8350_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id wm8350_i2c_id[] = {
-	{ "wm8350" },
-	{ "wm8351" },
-	{ "wm8352" },
+	{ .name = "wm8350" },
+	{ .name = "wm8351" },
+	{ .name = "wm8352" },
 	{ }
 };
 
drivers/mfd/wm8400-core.c +1 -1
index 8ecfe878a5ba..1c0ba450ef9b 100644
@@ -135,7 +135,7 @@ static int wm8400_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id wm8400_i2c_id[] = {
-       { "wm8400" },
+       { .name = "wm8400" },
        { }
 };
 
drivers/mfd/wm8994-core.c +4 -4
index 094c0b3dbd97..903d7070dbe5 100644
@@ -643,10 +643,10 @@ static void wm8994_i2c_remove(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id wm8994_i2c_id[] = {
-	{ "wm1811", WM1811 },
-	{ "wm1811a", WM1811 },
-	{ "wm8994", WM8994 },
-	{ "wm8958", WM8958 },
+	{ .name = "wm1811", .driver_data = WM1811 },
+	{ .name = "wm1811a", .driver_data = WM1811 },
+	{ .name = "wm8994", .driver_data = WM8994 },
+	{ .name = "wm8958", .driver_data = WM8958 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, wm8994_i2c_id);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#31 lore raw

PATCH v2 14/23 mfd: twl6030: Use named initializers for of_device_id

In reply to Uwe Kleine-König (The Capable Hub)

For .compatible a named initializer was already used, unify by also doing that for the .data member.

This is easier readable for a human and more robust against changes to the struct definition. This robustness is relevant for a planned change to struct of_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled array, only its representation in source form benefits.

---
 drivers/mfd/twl6030-irq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/twl6030-irq.c +2 -2
index 0ca00f618d4d..4303fb288dd5 100644
@@ -283,8 +283,8 @@ static const struct irq_domain_ops twl6030_irq_domain_ops = {
 };
 
 static const struct of_device_id twl6030_of_match[] __maybe_unused = {
-	{.compatible = "ti,twl6030", &twl6030_interrupt_mapping},
-	{.compatible = "ti,twl6032", &twl6032_interrupt_mapping},
+	{ .compatible = "ti,twl6030", .data = &twl6030_interrupt_mapping },
+	{ .compatible = "ti,twl6032", .data = &twl6032_interrupt_mapping },
 	{ },
 };
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#33 lore raw

PATCH v2 15/23 mfd: Use PCI_DEVICE* macros to initialize pci_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

pci_device_id entries are usually initialized using these PCI_DEVICE* macros. Adapt to this more usual style.

---
 drivers/mfd/ioc3.c        |  2 +-
 drivers/mfd/janz-cmodio.c | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/mfd/ioc3.c +1 -1
index 5f8ac364b610..bf2be3bc8602 100644
@@ -654,7 +654,7 @@ static void ioc3_mfd_remove(struct pci_dev *pdev)
 }
 
 static struct pci_device_id ioc3_mfd_id_table[] = {
-	{ PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3, PCI_ANY_ID, PCI_ANY_ID },
+	{ PCI_DEVICE(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3) },
 	{ 0, },
 };
 MODULE_DEVICE_TABLE(pci, ioc3_mfd_id_table);
drivers/mfd/janz-cmodio.c +6 -6
index add3bc04185b..93e1c04bddd6 100644
@@ -259,12 +259,12 @@ static void cmodio_pci_remove(struct pci_dev *dev)
 
 /* The list of devices that this module will support */
 static const struct pci_device_id cmodio_pci_ids[] = {
-	{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030, PCI_VENDOR_ID_JANZ, 0x0101 },
-	{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_JANZ, 0x0100 },
-	{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030, PCI_VENDOR_ID_JANZ, 0x0201 },
-	{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030, PCI_VENDOR_ID_JANZ, 0x0202 },
-	{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_JANZ, 0x0201 },
-	{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_JANZ, 0x0202 },
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030, PCI_VENDOR_ID_JANZ, 0x0101) },
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_JANZ, 0x0100) },
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030, PCI_VENDOR_ID_JANZ, 0x0201) },
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030, PCI_VENDOR_ID_JANZ, 0x0202) },
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_JANZ, 0x0201) },
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_JANZ, 0x0202) },
 	{ 0, }
 };
 MODULE_DEVICE_TABLE(pci, cmodio_pci_ids);
Signature · 1 line
2.55.0.11.g153666a7d9bb
#36 lore raw

PATCH v2 16/23 mfd: Use named initializers for platform_device_id array

In reply to Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct platform_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

Also drop a tailing comma after a list terminator to match the common style for these device-id arrays.

---
 drivers/mfd/ab8500-core.c | 8 ++++----
 drivers/mfd/cros_ec_dev.c | 2 +-
 drivers/mfd/mt6397-core.c | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
drivers/mfd/ab8500-core.c +4 -4
index f0bc0b5a6f4a..7c00c71ca4ba 100644
@@ -1250,10 +1250,10 @@ static int ab8500_probe(struct platform_device *pdev)
 }
 
 static const struct platform_device_id ab8500_id[] = {
-	{ "ab8500-core", AB8500_VERSION_AB8500 },
-	{ "ab8505-core", AB8500_VERSION_AB8505 },
-	{ "ab9540-i2c", AB8500_VERSION_AB9540 },
-	{ "ab8540-i2c", AB8500_VERSION_AB8540 },
+	{ .name = "ab8500-core", .driver_data = AB8500_VERSION_AB8500 },
+	{ .name = "ab8505-core", .driver_data = AB8500_VERSION_AB8505 },
+	{ .name = "ab9540-i2c", .driver_data = AB8500_VERSION_AB9540 },
+	{ .name = "ab8540-i2c", .driver_data = AB8500_VERSION_AB8540 },
 	{ }
 };
 
drivers/mfd/cros_ec_dev.c +1 -1
index a933cb936da6..baa6487abf9e 100644
@@ -375,7 +375,7 @@ static void ec_device_remove(struct platform_device *pdev)
 }
 
 static const struct platform_device_id cros_ec_id[] = {
-	{ DRV_NAME },
+	{ .name = DRV_NAME },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(platform, cros_ec_id);
drivers/mfd/mt6397-core.c +2 -2
index 7987583afc60..7bbd9b730b75 100644
@@ -429,8 +429,8 @@ static const struct of_device_id mt6397_of_match[] = {
 MODULE_DEVICE_TABLE(of, mt6397_of_match);
 
 static const struct platform_device_id mt6397_id[] = {
-	{ "mt6397" },
-	{ },
+	{ .name = "mt6397" },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, mt6397_id);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#39 lore raw

PATCH v2 17/23 mfd: Use named initializers for arrays of spi_device_id

In reply to Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct spi_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

---
 drivers/mfd/arizona-spi.c       | 10 +++++-----
 drivers/mfd/cs40l50-spi.c       |  2 +-
 drivers/mfd/da9052-spi.c        | 10 +++++-----
 drivers/mfd/intel-m10-bmc-spi.c |  6 +++---
 drivers/mfd/madera-spi.c        | 18 +++++++++---------
 drivers/mfd/ocelot-spi.c        |  2 +-
 drivers/mfd/rk8xx-spi.c         |  2 +-
 drivers/mfd/rsmu_spi.c          | 12 ++++++------
 drivers/mfd/stmpe-spi.c         | 12 ++++++------
 drivers/mfd/tps65912-spi.c      |  2 +-
 drivers/mfd/wm831x-spi.c        | 14 +++++++-------
 11 files changed, 45 insertions(+), 45 deletions(-)
drivers/mfd/arizona-spi.c +5 -5
index eaa2b2bc5dd0..bbf520bd2eda 100644
@@ -255,11 +255,11 @@ static void arizona_spi_remove(struct spi_device *spi)
 }
 
 static const struct spi_device_id arizona_spi_ids[] = {
-	{ "wm5102", WM5102 },
-	{ "wm5110", WM5110 },
-	{ "wm8280", WM8280 },
-	{ "wm1831", WM1831 },
-	{ "cs47l24", CS47L24 },
+	{ .name = "wm5102", .driver_data = WM5102 },
+	{ .name = "wm5110", .driver_data = WM5110 },
+	{ .name = "wm8280", .driver_data = WM8280 },
+	{ .name = "wm1831", .driver_data = WM1831 },
+	{ .name = "cs47l24", .driver_data = CS47L24 },
 	{ },
 };
 MODULE_DEVICE_TABLE(spi, arizona_spi_ids);
drivers/mfd/cs40l50-spi.c +1 -1
index 53526b595a0d..2d8f0dce3494 100644
@@ -40,7 +40,7 @@ static void cs40l50_spi_remove(struct spi_device *spi)
 }
 
 static const struct spi_device_id cs40l50_id_spi[] = {
-	{ "cs40l50" },
+	{ .name = "cs40l50" },
 	{}
 };
 MODULE_DEVICE_TABLE(spi, cs40l50_id_spi);
drivers/mfd/da9052-spi.c +5 -5
index be5f2b34e18a..2a08481432e3 100644
@@ -63,11 +63,11 @@ static void da9052_spi_remove(struct spi_device *spi)
 }
 
 static const struct spi_device_id da9052_spi_id[] = {
-	{"da9052", DA9052},
-	{"da9053-aa", DA9053_AA},
-	{"da9053-ba", DA9053_BA},
-	{"da9053-bb", DA9053_BB},
-	{"da9053-bc", DA9053_BC},
+	{ .name = "da9052", .driver_data = DA9052 },
+	{ .name = "da9053-aa", .driver_data = DA9053_AA },
+	{ .name = "da9053-ba", .driver_data = DA9053_BA },
+	{ .name = "da9053-bb", .driver_data = DA9053_BB },
+	{ .name = "da9053-bc", .driver_data = DA9053_BC },
 	{}
 };
 
drivers/mfd/intel-m10-bmc-spi.c +3 -3
index cfa620f0c70e..94b9c99bb4f8 100644
@@ -160,9 +160,9 @@ static const struct intel_m10bmc_platform_info m10bmc_spi_n5010 = {
 };
 
 static const struct spi_device_id m10bmc_spi_id[] = {
-	{ "m10-n3000", (kernel_ulong_t)&m10bmc_spi_n3000 },
-	{ "m10-d5005", (kernel_ulong_t)&m10bmc_spi_d5005 },
-	{ "m10-n5010", (kernel_ulong_t)&m10bmc_spi_n5010 },
+	{ .name = "m10-n3000", .driver_data = (kernel_ulong_t)&m10bmc_spi_n3000 },
+	{ .name = "m10-d5005", .driver_data = (kernel_ulong_t)&m10bmc_spi_d5005 },
+	{ .name = "m10-n5010", .driver_data = (kernel_ulong_t)&m10bmc_spi_n5010 },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, m10bmc_spi_id);
drivers/mfd/madera-spi.c +9 -9
index ce9e90322c9c..3fffa21ceadc 100644
@@ -112,15 +112,15 @@ static void madera_spi_remove(struct spi_device *spi)
 }
 
 static const struct spi_device_id madera_spi_ids[] = {
-	{ "cs47l15", CS47L15 },
-	{ "cs47l35", CS47L35 },
-	{ "cs47l85", CS47L85 },
-	{ "cs47l90", CS47L90 },
-	{ "cs47l91", CS47L91 },
-	{ "cs42l92", CS42L92 },
-	{ "cs47l92", CS47L92 },
-	{ "cs47l93", CS47L93 },
-	{ "wm1840", WM1840 },
+	{ .name = "cs47l15", .driver_data = CS47L15 },
+	{ .name = "cs47l35", .driver_data = CS47L35 },
+	{ .name = "cs47l85", .driver_data = CS47L85 },
+	{ .name = "cs47l90", .driver_data = CS47L90 },
+	{ .name = "cs47l91", .driver_data = CS47L91 },
+	{ .name = "cs42l92", .driver_data = CS42L92 },
+	{ .name = "cs47l92", .driver_data = CS47L92 },
+	{ .name = "cs47l93", .driver_data = CS47L93 },
+	{ .name = "wm1840", .driver_data = WM1840 },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, madera_spi_ids);
drivers/mfd/ocelot-spi.c +1 -1
index 3c8260c7f8fb..d3ab4868a523 100644
@@ -270,7 +270,7 @@ static int ocelot_spi_probe(struct spi_device *spi)
 }
 
 static const struct spi_device_id ocelot_spi_ids[] = {
-	{ "vsc7512" },
+	{ .name = "vsc7512" },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, ocelot_spi_ids);
drivers/mfd/rk8xx-spi.c +1 -1
index 95749a89f092..bb85fe60518f 100644
@@ -104,7 +104,7 @@ static const struct of_device_id rk8xx_spi_of_match[] = {
 MODULE_DEVICE_TABLE(of, rk8xx_spi_of_match);
 
 static const struct spi_device_id rk8xx_spi_id_table[] = {
-	{ "rk806" },
+	{ .name = "rk806" },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, rk8xx_spi_id_table);
drivers/mfd/rsmu_spi.c +6 -6
index e07f21482439..8b2e7cb401b5 100644
@@ -239,11 +239,11 @@ static void rsmu_spi_remove(struct spi_device *client)
 }
 
 static const struct spi_device_id rsmu_spi_id[] = {
-	{ "8a34000",  RSMU_CM },
-	{ "8a34001",  RSMU_CM },
-	{ "8a34002",  RSMU_CM },
-	{ "82p33810", RSMU_SABRE },
-	{ "82p33811", RSMU_SABRE },
+	{ .name = "8a34000",  .driver_data = RSMU_CM },
+	{ .name = "8a34001",  .driver_data = RSMU_CM },
+	{ .name = "8a34002",  .driver_data = RSMU_CM },
+	{ .name = "82p33810", .driver_data = RSMU_SABRE },
+	{ .name = "82p33811", .driver_data = RSMU_SABRE },
 	{}
 };
 MODULE_DEVICE_TABLE(spi, rsmu_spi_id);
@@ -254,7 +254,7 @@ static const struct of_device_id rsmu_spi_of_match[] = {
 	{ .compatible = "idt,8a34002",  .data = (void *)RSMU_CM },
 	{ .compatible = "idt,82p33810", .data = (void *)RSMU_SABRE },
 	{ .compatible = "idt,82p33811", .data = (void *)RSMU_SABRE },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, rsmu_spi_of_match);
 
drivers/mfd/stmpe-spi.c +6 -6
index dea31efface6..22a3da062dee 100644
@@ -121,12 +121,12 @@ static const struct of_device_id stmpe_spi_of_match[] = {
 MODULE_DEVICE_TABLE(of, stmpe_spi_of_match);
 
 static const struct spi_device_id stmpe_spi_id[] = {
-	{ "stmpe610", STMPE610 },
-	{ "stmpe801", STMPE801 },
-	{ "stmpe811", STMPE811 },
-	{ "stmpe1601", STMPE1601 },
-	{ "stmpe2401", STMPE2401 },
-	{ "stmpe2403", STMPE2403 },
+	{ .name = "stmpe610", .driver_data = STMPE610 },
+	{ .name = "stmpe801", .driver_data = STMPE801 },
+	{ .name = "stmpe811", .driver_data = STMPE811 },
+	{ .name = "stmpe1601", .driver_data = STMPE1601 },
+	{ .name = "stmpe2401", .driver_data = STMPE2401 },
+	{ .name = "stmpe2403", .driver_data = STMPE2403 },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, stmpe_spi_id);
drivers/mfd/tps65912-spi.c +1 -1
index 78f9b6015902..2442a2e67d67 100644
@@ -43,7 +43,7 @@ static int tps65912_spi_probe(struct spi_device *spi)
 }
 
 static const struct spi_device_id tps65912_spi_id_table[] = {
-	{ "tps65912" },
+	{ .name = "tps65912" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(spi, tps65912_spi_id_table);
drivers/mfd/wm831x-spi.c +7 -7
index 54c87267917b..4cdb6e0734c4 100644
@@ -77,13 +77,13 @@ static const struct dev_pm_ops wm831x_spi_pm = {
 };
 
 static const struct spi_device_id wm831x_spi_ids[] = {
-	{ "wm8310", WM8310 },
-	{ "wm8311", WM8311 },
-	{ "wm8312", WM8312 },
-	{ "wm8320", WM8320 },
-	{ "wm8321", WM8321 },
-	{ "wm8325", WM8325 },
-	{ "wm8326", WM8326 },
+	{ .name = "wm8310", .driver_data = WM8310 },
+	{ .name = "wm8311", .driver_data = WM8311 },
+	{ .name = "wm8312", .driver_data = WM8312 },
+	{ .name = "wm8320", .driver_data = WM8320 },
+	{ .name = "wm8321", .driver_data = WM8321 },
+	{ .name = "wm8325", .driver_data = WM8325 },
+	{ .name = "wm8326", .driver_data = WM8326 },
 	{ },
 };
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#42 lore raw

PATCH v2 18/23 mfd: Unify style of acpi_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

Update the various acpi_device_id arrays to conform to the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Adapt the few offenders accordingly.

---
 drivers/mfd/axp20x-i2c.c              | 2 +-
 drivers/mfd/cs42l43-i2c.c             | 2 +-
 drivers/mfd/intel_soc_pmic_chtdc_ti.c | 2 +-
 drivers/mfd/intel_soc_pmic_crc.c      | 2 +-
 drivers/mfd/intel_soc_pmic_mrfld.c    | 2 +-
 drivers/mfd/kempld-core.c             | 2 +-
 drivers/mfd/upboard-fpga.c            | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
drivers/mfd/axp20x-i2c.c +1 -1
index 2f595e2b883c..57695e46e00e 100644
@@ -97,7 +97,7 @@ static const struct acpi_device_id axp20x_i2c_acpi_match[] = {
 		.id = "INT33F4",
 		.driver_data = AXP288_ID,
 	},
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, axp20x_i2c_acpi_match);
 #endif
drivers/mfd/cs42l43-i2c.c +1 -1
index e9cb4fb9854a..6a4e4ddeb268 100644
@@ -67,7 +67,7 @@ MODULE_DEVICE_TABLE(of, cs42l43_of_match);
 static const struct acpi_device_id cs42l43_acpi_match[] = {
 	{ .id = "CSC4243", .driver_data = CS42L43_DEVID_VAL },
 	{ .id = "CSC2A3B", .driver_data = CS42L43B_DEVID_VAL },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, cs42l43_acpi_match);
 #endif
drivers/mfd/intel_soc_pmic_chtdc_ti.c +1 -1
index ff6223d6f54b..49f4138961c8 100644
@@ -163,7 +163,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(chtdc_ti_pm_ops, chtdc_ti_suspend, chtdc_ti_resu
 
 static const struct acpi_device_id chtdc_ti_acpi_ids[] = {
 	{ .id = "INT33F5" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, chtdc_ti_acpi_ids);
 
drivers/mfd/intel_soc_pmic_crc.c +1 -1
index c1c02700ef08..95588caa2e77 100644
@@ -253,7 +253,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(crystal_cove_pm_ops, crystal_cove_suspend, cryst
 
 static const struct acpi_device_id crystal_cove_acpi_match[] = {
 	{ .id = "INT33FD" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, crystal_cove_acpi_match);
 
drivers/mfd/intel_soc_pmic_mrfld.c +1 -1
index 9d7e1881d693..531d8b8be44d 100644
@@ -140,7 +140,7 @@ static int bcove_probe(struct platform_device *pdev)
 
 static const struct acpi_device_id bcove_acpi_ids[] = {
 	{ .id = "INTC100E" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, bcove_acpi_ids);
 
drivers/mfd/kempld-core.c +1 -1
index bf02189b9a70..9b3a877f44fb 100644
@@ -469,7 +469,7 @@ static void kempld_remove(struct platform_device *pdev)
 static const struct acpi_device_id kempld_acpi_table[] = {
 	{ .id = "KEM0000" },
 	{ .id = "KEM0001" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, kempld_acpi_table);
 
drivers/mfd/upboard-fpga.c +1 -1
index 6674f4a1d2fe..37c3c50aa6e4 100644
@@ -302,7 +302,7 @@ static int upboard_fpga_probe(struct platform_device *pdev)
 static const struct acpi_device_id upboard_fpga_acpi_match[] = {
 	{ .id = "AANT0F01", .driver_data = (kernel_ulong_t)&upboard_up2_fpga_data },
 	{ .id = "AANT0F04", .driver_data = (kernel_ulong_t)&upboard_up_fpga_data },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, upboard_fpga_acpi_match);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#46 lore raw

PATCH v2 19/23 mfd: Unify style of dmi_system_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

These arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Only the list terminators didn't match this style as they didn't use a space.

---
 drivers/mfd/cgbc-core.c            | 2 +-
 drivers/mfd/intel_quark_i2c_gpio.c | 2 +-
 drivers/mfd/kempld-core.c          | 2 +-
 drivers/mfd/tqmx86.c               | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/mfd/cgbc-core.c +1 -1
index 10bb4b414c34..b568722cc8b7 100644
@@ -393,7 +393,7 @@ static const struct dmi_system_id cgbc_dmi_table[] __initconst = {
 			DMI_MATCH(DMI_BOARD_NAME, "conga-SA8"),
 		},
 	},
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(dmi, cgbc_dmi_table);
 
drivers/mfd/intel_quark_i2c_gpio.c +1 -1
index 9b9c76bd067b..87dbe1a94247 100644
@@ -79,7 +79,7 @@ static const struct dmi_system_id dmi_platform_info[] = {
 		},
 		.driver_data = (void *)&intel_quark_i2c_controller_fast_node,
 	},
-	{}
+	{ }
 };
 
 /* This is used as a place holder and will be modified at run-time */
drivers/mfd/kempld-core.c +1 -1
index 9b3a877f44fb..83d912e82401 100644
@@ -766,7 +766,7 @@ static const struct dmi_system_id kempld_dmi_table[] __initconst = {
 			DMI_MATCH(DMI_BOARD_NAME, "Qseven-Q7AL"),
 		},
 	},
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
 
drivers/mfd/tqmx86.c +1 -1
index 1c2fe3f91238..16f47566cf3c 100644
@@ -338,7 +338,7 @@ static const struct dmi_system_id tqmx86_dmi_table[] __initconst = {
 		},
 		.callback = tqmx86_create_platform_device,
 	},
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(dmi, tqmx86_dmi_table);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#48 lore raw

PATCH v2 20/23 mfd: Unify style of i2c_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

Most of these arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Adapt the few offenders accordingly and also use tabs for indention for two drivers.

---
 drivers/mfd/88pm800.c       | 2 +-
 drivers/mfd/88pm805.c       | 2 +-
 drivers/mfd/88pm860x-core.c | 2 +-
 drivers/mfd/act8945a.c      | 2 +-
 drivers/mfd/as3711.c        | 2 +-
 drivers/mfd/as3722.c        | 2 +-
 drivers/mfd/bq257xx.c       | 2 +-
 drivers/mfd/cs40l50-i2c.c   | 2 +-
 drivers/mfd/da903x.c        | 2 +-
 drivers/mfd/da9052-i2c.c    | 2 +-
 drivers/mfd/da9063-i2c.c    | 2 +-
 drivers/mfd/max77620.c      | 2 +-
 drivers/mfd/max77843.c      | 2 +-
 drivers/mfd/max8907.c       | 2 +-
 drivers/mfd/rc5t583.c       | 2 +-
 drivers/mfd/rsmu_i2c.c      | 1 +
 drivers/mfd/si476x-i2c.c    | 2 +-
 drivers/mfd/tps65910.c      | 6 +++---
 drivers/mfd/wm8400-core.c   | 4 ++--
 19 files changed, 22 insertions(+), 21 deletions(-)
drivers/mfd/88pm800.c +1 -1
index 74dc419402f9..fe1017c6234b 100644
@@ -117,7 +117,7 @@ enum {
 
 static const struct i2c_device_id pm80x_id_table[] = {
 	{ .name = "88PM800" },
-	{} /* NULL terminated */
+	{ } /* NULL terminated */
 };
 MODULE_DEVICE_TABLE(i2c, pm80x_id_table);
 
drivers/mfd/88pm805.c +1 -1
index 2eb3380a5207..8df11233bc4c 100644
@@ -31,7 +31,7 @@
 
 static const struct i2c_device_id pm80x_id_table[] = {
 	{ .name = "88PM805" },
-	{} /* NULL terminated */
+	{ } /* NULL terminated */
 };
 MODULE_DEVICE_TABLE(i2c, pm80x_id_table);
 
drivers/mfd/88pm860x-core.c +1 -1
index 1b201ad129c2..d3c24a7a3936 100644
@@ -1233,7 +1233,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(pm860x_pm_ops, pm860x_suspend, pm860x_resume);
 
 static const struct i2c_device_id pm860x_id_table[] = {
 	{ .name = "88PM860x" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, pm860x_id_table);
 
drivers/mfd/act8945a.c +1 -1
index bb1b4e4fb288..e5fba40f89d4 100644
@@ -55,7 +55,7 @@ static int act8945a_i2c_probe(struct i2c_client *i2c)
 
 static const struct i2c_device_id act8945a_i2c_id[] = {
 	{ .name = "act8945a" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, act8945a_i2c_id);
 
drivers/mfd/as3711.c +1 -1
index eb03b813d58f..6d2fa63e7f4b 100644
@@ -193,7 +193,7 @@ static int as3711_i2c_probe(struct i2c_client *client)
 
 static const struct i2c_device_id as3711_i2c_id[] = {
 	{ .name = "as3711" },
-	{}
+	{ }
 };
 
 static struct i2c_driver as3711_i2c_driver = {
drivers/mfd/as3722.c +1 -1
index 2f58709ffd9a..ec7be5fb326e 100644
@@ -433,7 +433,7 @@ MODULE_DEVICE_TABLE(of, as3722_of_match);
 
 static const struct i2c_device_id as3722_i2c_id[] = {
 	{ .name = "as3722" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, as3722_i2c_id);
 
drivers/mfd/bq257xx.c +1 -1
index 8ad9f0ad6512..182d67f23f60 100644
@@ -121,7 +121,7 @@ static int bq257xx_probe(struct i2c_client *client)
 static const struct i2c_device_id bq257xx_i2c_ids[] = {
 	{ .name = "bq25703a", .driver_data = BQ25703A },
 	{ .name = "bq25792", .driver_data = BQ25792 },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, bq257xx_i2c_ids);
 
drivers/mfd/cs40l50-i2c.c +1 -1
index 6043eb6639b5..b61b0484644d 100644
@@ -41,7 +41,7 @@ static void cs40l50_i2c_remove(struct i2c_client *i2c)
 
 static const struct i2c_device_id cs40l50_id_i2c[] = {
 	{ .name = "cs40l50" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, cs40l50_id_i2c);
 
drivers/mfd/da903x.c +1 -1
index c949ebc57b18..46d9d823414a 100644
@@ -441,7 +441,7 @@ static const struct da903x_chip_ops da903x_ops[] = {
 static const struct i2c_device_id da903x_id_table[] = {
 	{ .name = "da9030", .driver_data = 0 },
 	{ .name = "da9034", .driver_data = 1 },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, da903x_id_table);
 
drivers/mfd/da9052-i2c.c +1 -1
index b75cfe805d5e..6af9552ccba1 100644
@@ -108,7 +108,7 @@ static const struct i2c_device_id da9052_i2c_id[] = {
 	{ .name = "da9053-ba", .driver_data = DA9053_BA },
 	{ .name = "da9053-bb", .driver_data = DA9053_BB },
 	{ .name = "da9053-bc", .driver_data = DA9053_BC },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, da9052_i2c_id);
 
drivers/mfd/da9063-i2c.c +1 -1
index b57a6ee90aa9..068f080d1f9b 100644
@@ -478,7 +478,7 @@ static int da9063_i2c_probe(struct i2c_client *i2c)
 static const struct i2c_device_id da9063_i2c_id[] = {
 	{ .name = "da9063", .driver_data = PMIC_TYPE_DA9063 },
 	{ .name = "da9063l", .driver_data = PMIC_TYPE_DA9063L },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, da9063_i2c_id);
 
drivers/mfd/max77620.c +1 -1
index a66ca73997f5..e4d7cb4afef0 100644
@@ -697,7 +697,7 @@ static const struct i2c_device_id max77620_id[] = {
 	{ .name = "max77620", .driver_data = MAX77620 },
 	{ .name = "max20024", .driver_data = MAX20024 },
 	{ .name = "max77663", .driver_data = MAX77663 },
-	{},
+	{ }
 };
 
 static DEFINE_SIMPLE_DEV_PM_OPS(max77620_pm_ops,
drivers/mfd/max77843.c +1 -1
index 9e535ff1e3f7..c1cbf1f88b15 100644
@@ -170,7 +170,7 @@ static const struct of_device_id max77843_dt_match[] = {
 
 static const struct i2c_device_id max77843_id[] = {
 	{ .name = "max77843", .driver_data = TYPE_MAX77843 },
-	{ },
+	{ }
 };
 
 static int __maybe_unused max77843_suspend(struct device *dev)
drivers/mfd/max8907.c +1 -1
index 70ffc08a96d1..6e2fed7021a8 100644
@@ -301,7 +301,7 @@ MODULE_DEVICE_TABLE(of, max8907_of_match);
 
 static const struct i2c_device_id max8907_i2c_id[] = {
 	{ .name = "max8907" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, max8907_i2c_id);
 
drivers/mfd/rc5t583.c +1 -1
index 4ad761fbfab2..acb42868be37 100644
@@ -281,7 +281,7 @@ static int rc5t583_i2c_probe(struct i2c_client *i2c)
 
 static const struct i2c_device_id rc5t583_i2c_id[] = {
 	{ .name = "rc5t583" },
-	{}
+	{ }
 };
 
 static struct i2c_driver rc5t583_i2c_driver = {
drivers/mfd/rsmu_i2c.c +1 -0
index 0041fa10981a..c03db3ce5f12 100644
@@ -335,6 +335,7 @@ static const struct i2c_device_id rsmu_i2c_id[] = {
 	{ .name = "82p33811", .driver_data = RSMU_SABRE },
 	{ .name = "8v19n850", .driver_data = RSMU_SL },
 	{ .name = "8v19n851", .driver_data = RSMU_SL },
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, rsmu_i2c_id);
 
drivers/mfd/si476x-i2c.c +1 -1
index f25a4b60071b..30e545cd0889 100644
@@ -844,7 +844,7 @@ static const struct i2c_device_id si476x_id[] = {
 	{ .name = "si4761", .driver_data = SI476X_CHIP_SI4761 },
 	{ .name = "si4764", .driver_data = SI476X_CHIP_SI4764 },
 	{ .name = "si4768", .driver_data = SI476X_CHIP_SI4768 },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, si476x_id);
 
drivers/mfd/tps65910.c +3 -3
index b0dbee3e6ea2..d19bd3643591 100644
@@ -532,9 +532,9 @@ static int tps65910_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id tps65910_i2c_id[] = {
-       { .name = "tps65910", .driver_data = TPS65910 },
-       { .name = "tps65911", .driver_data = TPS65911 },
-       { }
+	{ .name = "tps65910", .driver_data = TPS65910 },
+	{ .name = "tps65911", .driver_data = TPS65911 },
+	{ }
 };
 
 static struct i2c_driver tps65910_i2c_driver = {
drivers/mfd/wm8400-core.c +2 -2
index 1c0ba450ef9b..d3180aa44e1a 100644
@@ -135,8 +135,8 @@ static int wm8400_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id wm8400_i2c_id[] = {
-       { .name = "wm8400" },
-       { }
+	{ .name = "wm8400" },
+	{ }
 };
 
 static struct i2c_driver wm8400_i2c_driver = {
Signature · 1 line
2.55.0.11.g153666a7d9bb
#51 lore raw

PATCH v2 21/23 mfd: Unify style of of_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

These arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Adapt the offenders accordingly.

---
 drivers/mfd/88pm860x-core.c    |  4 ++--
 drivers/mfd/ab8500-sysctrl.c   |  4 ++--
 drivers/mfd/ac100.c            |  2 +-
 drivers/mfd/act8945a.c         |  4 ++--
 drivers/mfd/altera-a10sr.c     |  2 +-
 drivers/mfd/altera-sysmgr.c    |  2 +-
 drivers/mfd/arizona-i2c.c      |  2 +-
 drivers/mfd/arizona-spi.c      |  2 +-
 drivers/mfd/as3711.c           |  4 ++--
 drivers/mfd/as3722.c           |  4 ++--
 drivers/mfd/atmel-hlcdc.c      |  2 +-
 drivers/mfd/atmel-smc.c        |  2 +-
 drivers/mfd/axp20x-i2c.c       |  2 +-
 drivers/mfd/axp20x-rsb.c       |  2 +-
 drivers/mfd/bcm2835-pm.c       |  4 ++--
 drivers/mfd/bd9571mwv.c        |  4 ++--
 drivers/mfd/bq257xx.c          |  2 +-
 drivers/mfd/cs40l50-i2c.c      |  2 +-
 drivers/mfd/cs40l50-spi.c      |  2 +-
 drivers/mfd/cs42l43-i2c.c      |  2 +-
 drivers/mfd/da9063-i2c.c       |  5 +++--
 drivers/mfd/da9150-core.c      |  2 +-
 drivers/mfd/db8500-prcmu.c     |  4 ++--
 drivers/mfd/exynos-lpass.c     |  2 +-
 drivers/mfd/gateworks-gsc.c    |  2 +-
 drivers/mfd/hi6421-pmic-core.c |  6 +++---
 drivers/mfd/hi655x-pmic.c      |  4 ++--
 drivers/mfd/khadas-mcu.c       |  4 ++--
 drivers/mfd/lochnagar-i2c.c    |  2 +-
 drivers/mfd/lp3943.c           |  2 +-
 drivers/mfd/lp873x.c           |  2 +-
 drivers/mfd/lp87565.c          |  2 +-
 drivers/mfd/macsmc.c           |  2 +-
 drivers/mfd/madera-core.c      |  2 +-
 drivers/mfd/max7360.c          |  2 +-
 drivers/mfd/max77686.c         |  2 +-
 drivers/mfd/max77714.c         |  2 +-
 drivers/mfd/max77759.c         |  2 +-
 drivers/mfd/max77843.c         |  4 ++--
 drivers/mfd/max8907.c          |  2 +-
 drivers/mfd/max8925-i2c.c      |  2 +-
 drivers/mfd/max8997.c          |  2 +-
 drivers/mfd/max8998.c          |  2 +-
 drivers/mfd/mc13xxx-spi.c      |  6 +++---
 drivers/mfd/motorola-cpcap.c   |  6 +++---
 drivers/mfd/mp2629.c           |  2 +-
 drivers/mfd/mt6360-core.c      |  4 ++--
 drivers/mfd/mt6370.c           |  2 +-
 drivers/mfd/mxs-lradc.c        |  4 ++--
 drivers/mfd/ntxec.c            |  4 ++--
 drivers/mfd/omap-usb-host.c    |  4 ++--
 drivers/mfd/qcom-pm8008.c      |  4 ++--
 drivers/mfd/qcom-pm8xxx.c      |  6 +++---
 drivers/mfd/rk8xx-i2c.c        |  2 +-
 drivers/mfd/rohm-bd71828.c     |  4 ++--
 drivers/mfd/rohm-bd9576.c      |  6 +++---
 drivers/mfd/rsmu_i2c.c         |  2 +-
 drivers/mfd/rt4831.c           |  4 ++--
 drivers/mfd/rt5033.c           |  2 +-
 drivers/mfd/rz-mtu3.c          |  2 +-
 drivers/mfd/sec-acpm.c         |  6 +++---
 drivers/mfd/sec-i2c.c          | 22 +++++++++++-----------
 drivers/mfd/simple-mfd-i2c.c   |  2 +-
 drivers/mfd/sky81452.c         |  2 +-
 drivers/mfd/sm501.c            |  2 +-
 drivers/mfd/smpro-core.c       |  2 +-
 drivers/mfd/sprd-sc27xx-spi.c  |  2 +-
 drivers/mfd/ssbi.c             |  2 +-
 drivers/mfd/stm32-lptimer.c    |  4 ++--
 drivers/mfd/stm32-timers.c     |  4 ++--
 drivers/mfd/stmfx.c            |  4 ++--
 drivers/mfd/stmpe-i2c.c        | 18 +++++++++---------
 drivers/mfd/stmpe-spi.c        | 14 +++++++-------
 drivers/mfd/stw481x.c          |  6 +++---
 drivers/mfd/sun6i-prcm.c       |  2 +-
 drivers/mfd/tps6105x.c         |  2 +-
 drivers/mfd/tps6507x.c         |  4 ++--
 drivers/mfd/tps65086.c         |  2 +-
 drivers/mfd/tps65090.c         |  4 ++--
 drivers/mfd/tps65217.c         |  4 ++--
 drivers/mfd/tps65218.c         |  4 ++--
 drivers/mfd/tps65219.c         |  8 ++++----
 drivers/mfd/tps6586x.c         |  4 ++--
 drivers/mfd/tps65910.c         |  6 +++---
 drivers/mfd/tps65912-i2c.c     |  2 +-
 drivers/mfd/tps65912-spi.c     |  2 +-
 drivers/mfd/tps6594-i2c.c      | 12 ++++++------
 drivers/mfd/tps6594-spi.c      | 12 ++++++------
 drivers/mfd/twl4030-audio.c    |  4 ++--
 drivers/mfd/twl4030-power.c    |  2 +-
 drivers/mfd/twl6030-irq.c      |  2 +-
 drivers/mfd/vexpress-sysreg.c  |  4 ++--
 drivers/mfd/wm831x-core.c      |  2 +-
 93 files changed, 176 insertions(+), 175 deletions(-)
drivers/mfd/88pm860x-core.c +2 -2
index d3c24a7a3936..2bde245fc89e 100644
@@ -1238,8 +1238,8 @@ static const struct i2c_device_id pm860x_id_table[] = {
 MODULE_DEVICE_TABLE(i2c, pm860x_id_table);
 
 static const struct of_device_id pm860x_dt_ids[] = {
-	{ .compatible = "marvell,88pm860x", },
-	{},
+	{ .compatible = "marvell,88pm860x" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, pm860x_dt_ids);
 
drivers/mfd/ab8500-sysctrl.c +2 -2
index b6b44e2e3198..e4a7d864e254 100644
@@ -149,8 +149,8 @@ static void ab8500_sysctrl_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id ab8500_sysctrl_match[] = {
-	{ .compatible = "stericsson,ab8500-sysctrl", },
-	{}
+	{ .compatible = "stericsson,ab8500-sysctrl" },
+	{ }
 };
 
 static struct platform_driver ab8500_sysctrl_driver = {
drivers/mfd/ac100.c +1 -1
index 8f47c392cbd1..a22e3ce7d484 100644
@@ -116,7 +116,7 @@ static int ac100_rsb_probe(struct sunxi_rsb_device *rdev)
 
 static const struct of_device_id ac100_of_match[] = {
 	{ .compatible = "x-powers,ac100" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, ac100_of_match);
 
drivers/mfd/act8945a.c +2 -2
index e5fba40f89d4..31b46d032363 100644
@@ -60,8 +60,8 @@ static const struct i2c_device_id act8945a_i2c_id[] = {
 MODULE_DEVICE_TABLE(i2c, act8945a_i2c_id);
 
 static const struct of_device_id act8945a_of_match[] = {
-	{ .compatible = "active-semi,act8945a", },
-	{},
+	{ .compatible = "active-semi,act8945a" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, act8945a_of_match);
 
drivers/mfd/altera-a10sr.c +1 -1
index d53e433ab5c1..260e590b87b1 100644
@@ -149,7 +149,7 @@ static int altr_a10sr_spi_probe(struct spi_device *spi)
 
 static const struct of_device_id altr_a10sr_spi_of_match[] = {
 	{ .compatible = "altr,a10sr" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, altr_a10sr_spi_of_match);
 
drivers/mfd/altera-sysmgr.c +1 -1
index 90c6902d537d..a9b9164b3651 100644
@@ -175,7 +175,7 @@ static int sysmgr_probe(struct platform_device *pdev)
 static const struct of_device_id altr_sysmgr_of_match[] = {
 	{ .compatible = "altr,sys-mgr" },
 	{ .compatible = "altr,sys-mgr-s10" },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, altr_sysmgr_of_match);
 
drivers/mfd/arizona-i2c.c +1 -1
index 1ea8a59948b6..763d9c1bd0ed 100644
@@ -103,7 +103,7 @@ static const struct of_device_id arizona_i2c_of_match[] = {
 	{ .compatible = "wlf,wm8997", .data = (void *)WM8997 },
 	{ .compatible = "wlf,wm8998", .data = (void *)WM8998 },
 	{ .compatible = "wlf,wm1814", .data = (void *)WM1814 },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, arizona_i2c_of_match);
 #endif
drivers/mfd/arizona-spi.c +1 -1
index bbf520bd2eda..c4ee5b499fce 100644
@@ -271,7 +271,7 @@ static const struct of_device_id arizona_spi_of_match[] = {
 	{ .compatible = "wlf,wm8280", .data = (void *)WM8280 },
 	{ .compatible = "wlf,wm1831", .data = (void *)WM1831 },
 	{ .compatible = "cirrus,cs47l24", .data = (void *)CS47L24 },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, arizona_spi_of_match);
 #endif
drivers/mfd/as3711.c +2 -2
index 6d2fa63e7f4b..6301b09585ba 100644
@@ -111,8 +111,8 @@ static const struct regmap_config as3711_regmap_config = {
 
 #ifdef CONFIG_OF
 static const struct of_device_id as3711_of_match[] = {
-	{.compatible = "ams,as3711",},
-	{}
+	{ .compatible = "ams,as3711" },
+	{ }
 };
 #endif
 
drivers/mfd/as3722.c +2 -2
index ec7be5fb326e..bf2564836553 100644
@@ -426,8 +426,8 @@ static int __maybe_unused as3722_i2c_resume(struct device *dev)
 }
 
 static const struct of_device_id as3722_of_match[] = {
-	{ .compatible = "ams,as3722", },
-	{},
+	{ .compatible = "ams,as3722" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, as3722_of_match);
 
drivers/mfd/atmel-hlcdc.c +1 -1
index 2a3a05122176..64f64736d819 100644
@@ -149,7 +149,7 @@ static const struct of_device_id atmel_hlcdc_match[] = {
 	{ .compatible = "microchip,sam9x60-hlcdc" },
 	{ .compatible = "microchip,sam9x75-xlcdc" },
 	{ .compatible = "microchip,sama7d65-xlcdc" },
-	{ /* sentinel */ },
+	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, atmel_hlcdc_match);
 
drivers/mfd/atmel-smc.c +1 -1
index e69be61511a4..94d03a5e2207 100644
@@ -333,7 +333,7 @@ static const struct of_device_id atmel_smc_ids[] __maybe_unused = {
 	{ .compatible = "atmel,at91sam9260-smc", .data = NULL },
 	{ .compatible = "atmel,sama5d3-smc", .data = &sama5d3_reg_layout },
 	{ .compatible = "atmel,sama5d2-smc", .data = &sama5d2_reg_layout },
-	{ /* sentinel */ },
+	{ /* sentinel */ }
 };
 
 /**
drivers/mfd/axp20x-i2c.c +1 -1
index 57695e46e00e..9754181bf53b 100644
@@ -70,7 +70,7 @@ static const struct of_device_id axp20x_i2c_of_match[] = {
 	{ .compatible = "x-powers,axp803", .data = (void *)AXP803_ID },
 	{ .compatible = "x-powers,axp806", .data = (void *)AXP806_ID },
 	{ .compatible = "x-powers,axp15060", .data = (void *)AXP15060_ID },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, axp20x_i2c_of_match);
 #endif
drivers/mfd/axp20x-rsb.c +1 -1
index 059656f2a1bd..7fe71520d5dc 100644
@@ -63,7 +63,7 @@ static const struct of_device_id axp20x_rsb_of_match[] = {
 	{ .compatible = "x-powers,axp806", .data = (void *)AXP806_ID },
 	{ .compatible = "x-powers,axp809", .data = (void *)AXP809_ID },
 	{ .compatible = "x-powers,axp813", .data = (void *)AXP813_ID },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, axp20x_rsb_of_match);
 
drivers/mfd/bcm2835-pm.c +2 -2
index 87de35075419..d812a62a05f7 100644
@@ -113,11 +113,11 @@ static int bcm2835_pm_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id bcm2835_pm_of_match[] = {
-	{ .compatible = "brcm,bcm2835-pm-wdt", },
+	{ .compatible = "brcm,bcm2835-pm-wdt" },
 	{ .compatible = "brcm,bcm2835-pm", .data = (void *)BCM2835_PM_SOC_BCM2835 },
 	{ .compatible = "brcm,bcm2711-pm", .data = (void *)BCM2835_PM_SOC_BCM2711 },
 	{ .compatible = "brcm,bcm2712-pm", .data = (void *)BCM2835_PM_SOC_BCM2712 },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match);
 
drivers/mfd/bd9571mwv.c +2 -2
index 2b6fe6fd9806..76ccca5ffbf8 100644
@@ -261,8 +261,8 @@ static int bd9571mwv_probe(struct i2c_client *client)
 }
 
 static const struct of_device_id bd9571mwv_of_match_table[] = {
-	{ .compatible = "rohm,bd9571mwv", },
-	{ .compatible = "rohm,bd9574mwf", },
+	{ .compatible = "rohm,bd9571mwv" },
+	{ .compatible = "rohm,bd9574mwf" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, bd9571mwv_of_match_table);
drivers/mfd/bq257xx.c +1 -1
index 182d67f23f60..6c0bbca5b97e 100644
@@ -128,7 +128,7 @@ MODULE_DEVICE_TABLE(i2c, bq257xx_i2c_ids);
 static const struct of_device_id bq257xx_of_match[] = {
 	{ .compatible = "ti,bq25703a", .data = (void *)BQ25703A },
 	{ .compatible = "ti,bq25792", .data = (void *)BQ25792 },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, bq257xx_of_match);
 
drivers/mfd/cs40l50-i2c.c +1 -1
index b61b0484644d..7d2455d95275 100644
@@ -47,7 +47,7 @@ MODULE_DEVICE_TABLE(i2c, cs40l50_id_i2c);
 
 static const struct of_device_id cs40l50_of_match[] = {
 	{ .compatible = "cirrus,cs40l50" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, cs40l50_of_match);
 
drivers/mfd/cs40l50-spi.c +1 -1
index 2d8f0dce3494..c273bc98e7f8 100644
@@ -47,7 +47,7 @@ MODULE_DEVICE_TABLE(spi, cs40l50_id_spi);
 
 static const struct of_device_id cs40l50_of_match[] = {
 	{ .compatible = "cirrus,cs40l50" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, cs40l50_of_match);
 
drivers/mfd/cs42l43-i2c.c +1 -1
index 6a4e4ddeb268..a8e5a62e2b10 100644
@@ -58,7 +58,7 @@ static int cs42l43_i2c_probe(struct i2c_client *i2c)
 static const struct of_device_id cs42l43_of_match[] = {
 	{ .compatible = "cirrus,cs42l43", .data = (void *)CS42L43_DEVID_VAL },
 	{ .compatible = "cirrus,cs42l43b", .data = (void *)CS42L43B_DEVID_VAL },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, cs42l43_of_match);
 #endif
drivers/mfd/da9063-i2c.c +3 -2
index 068f080d1f9b..a24fd751f343 100644
@@ -361,11 +361,12 @@ static struct regmap_config da9063_regmap_config = {
 };
 
 static const struct of_device_id da9063_dt_ids[] = {
-	{ .compatible = "dlg,da9063", },
-	{ .compatible = "dlg,da9063l", },
+	{ .compatible = "dlg,da9063" },
+	{ .compatible = "dlg,da9063l" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, da9063_dt_ids);
+
 static int da9063_i2c_probe(struct i2c_client *i2c)
 {
 	const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
drivers/mfd/da9150-core.c +1 -1
index ab2335b73a63..e3fbf36a71fb 100644
@@ -500,7 +500,7 @@ static const struct i2c_device_id da9150_i2c_id[] = {
 MODULE_DEVICE_TABLE(i2c, da9150_i2c_id);
 
 static const struct of_device_id da9150_of_match[] = {
-	{ .compatible = "dlg,da9150", },
+	{ .compatible = "dlg,da9150" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, da9150_of_match);
drivers/mfd/db8500-prcmu.c +2 -2
index 21e68a382b11..eb281062e016 100644
@@ -3073,8 +3073,8 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
 	return err;
 }
 static const struct of_device_id db8500_prcmu_match[] = {
-	{ .compatible = "stericsson,db8500-prcmu"},
-	{ },
+	{ .compatible = "stericsson,db8500-prcmu" },
+	{ }
 };
 
 static struct platform_driver db8500_prcmu_driver = {
drivers/mfd/exynos-lpass.c +1 -1
index 9bb2687c2835..7e3201e4c9b4 100644
@@ -177,7 +177,7 @@ static const struct dev_pm_ops lpass_pm_ops = {
 
 static const struct of_device_id exynos_lpass_of_match[] = {
 	{ .compatible = "samsung,exynos5433-lpass" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, exynos_lpass_of_match);
 
drivers/mfd/gateworks-gsc.c +1 -1
index a3301502ce6a..6e561403f509 100644
@@ -155,7 +155,7 @@ static struct attribute_group attr_group = {
 };
 
 static const struct of_device_id gsc_of_match[] = {
-	{ .compatible = "gw,gsc", },
+	{ .compatible = "gw,gsc" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, gsc_of_match);
drivers/mfd/hi6421-pmic-core.c +3 -3
index 5af24a438329..b20cc2c956e7 100644
@@ -38,13 +38,13 @@ static const struct regmap_config hi6421_regmap_config = {
 static const struct of_device_id of_hi6421_pmic_match[] = {
 	{
 		.compatible = "hisilicon,hi6421-pmic",
-		.data = (void *)HI6421
+		.data = (void *)HI6421,
 	},
 	{
 		.compatible = "hisilicon,hi6421v530-pmic",
-		.data = (void *)HI6421_V530
+		.data = (void *)HI6421_V530,
 	},
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_hi6421_pmic_match);
 
drivers/mfd/hi655x-pmic.c +2 -2
index 5cb392892c19..c6625d61b3ef 100644
@@ -152,8 +152,8 @@ static void hi655x_pmic_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id hi655x_pmic_match[] = {
-	{ .compatible = "hisilicon,hi655x-pmic", },
-	{},
+	{ .compatible = "hisilicon,hi655x-pmic" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, hi655x_pmic_match);
 
drivers/mfd/khadas-mcu.c +2 -2
index ba981a788692..cda31b1bc601 100644
@@ -123,8 +123,8 @@ static int khadas_mcu_probe(struct i2c_client *client)
 
 #ifdef CONFIG_OF
 static const struct of_device_id khadas_mcu_of_match[] = {
-	{ .compatible = "khadas,mcu", },
-	{},
+	{ .compatible = "khadas,mcu" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, khadas_mcu_of_match);
 #endif
drivers/mfd/lochnagar-i2c.c +1 -1
index 9d60a42745fc..24c609ebc2b0 100644
@@ -200,7 +200,7 @@ static struct lochnagar_config lochnagar_configs[] = {
 static const struct of_device_id lochnagar_of_match[] = {
 	{ .compatible = "cirrus,lochnagar1", .data = &lochnagar_configs[0] },
 	{ .compatible = "cirrus,lochnagar2", .data = &lochnagar_configs[1] },
-	{},
+	{ }
 };
 
 static int lochnagar_wait_for_boot(struct regmap *regmap, unsigned int *id)
drivers/mfd/lp3943.c +1 -1
index 503615a8d420..18c27cdab615 100644
@@ -133,7 +133,7 @@ MODULE_DEVICE_TABLE(i2c, lp3943_ids);
 
 #ifdef CONFIG_OF
 static const struct of_device_id lp3943_of_match[] = {
-	{ .compatible = "ti,lp3943", },
+	{ .compatible = "ti,lp3943" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, lp3943_of_match);
drivers/mfd/lp873x.c +1 -1
index 46444696f2f4..8184048d3341 100644
@@ -62,7 +62,7 @@ static int lp873x_probe(struct i2c_client *client)
 static const struct of_device_id of_lp873x_match_table[] = {
 	{ .compatible = "ti,lp8733", },
 	{ .compatible = "ti,lp8732", },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_lp873x_match_table);
 
drivers/mfd/lp87565.c +1 -1
index 14e80588efac..543d5423da99 100644
@@ -42,7 +42,7 @@ static const struct of_device_id of_lp87565_match_table[] = {
 		.compatible = "ti,lp87561-q1",
 		.data = (void *)LP87565_DEVICE_TYPE_LP87561_Q1,
 	},
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_lp87565_match_table);
 
drivers/mfd/macsmc.c +1 -1
index 358feec2d088..9927d08566c7 100644
@@ -485,7 +485,7 @@ static int apple_smc_probe(struct platform_device *pdev)
 static const struct of_device_id apple_smc_of_match[] = {
 	{ .compatible = "apple,t8103-smc" },
 	{ .compatible = "apple,smc" },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, apple_smc_of_match);
 
drivers/mfd/madera-core.c +1 -1
index 2f74a8c644a3..2d74b4511a8f 100644
@@ -381,7 +381,7 @@ const struct of_device_id madera_of_match[] = {
 	{ .compatible = "cirrus,cs47l92", .data = (void *)CS47L92 },
 	{ .compatible = "cirrus,cs47l93", .data = (void *)CS47L93 },
 	{ .compatible = "cirrus,wm1840", .data = (void *)WM1840 },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, madera_of_match);
 EXPORT_SYMBOL_GPL(madera_of_match);
drivers/mfd/max7360.c +1 -1
index 52fffed0c0dd..dc744b40bb38 100644
@@ -152,7 +152,7 @@ static int max7360_probe(struct i2c_client *client)
 
 static const struct of_device_id max7360_dt_match[] = {
 	{ .compatible = "maxim,max7360" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, max7360_dt_match);
 
drivers/mfd/max77686.c +1 -1
index 0118a444a68b..e8983236c1e8 100644
@@ -153,7 +153,7 @@ static const struct of_device_id max77686_pmic_dt_match[] = {
 		.compatible = "maxim,max77802",
 		.data = (void *)TYPE_MAX77802,
 	},
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, max77686_pmic_dt_match);
 
drivers/mfd/max77714.c +1 -1
index c618605a3fb2..353f657da879 100644
@@ -134,7 +134,7 @@ static int max77714_probe(struct i2c_client *client)
 
 static const struct of_device_id max77714_dt_match[] = {
 	{ .compatible = "maxim,max77714" },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, max77714_dt_match);
 
drivers/mfd/max77759.c +1 -1
index 2347eb0b014b..5833b267419f 100644
@@ -718,7 +718,7 @@ static const struct i2c_device_id max77759_i2c_id[] = {
 MODULE_DEVICE_TABLE(i2c, max77759_i2c_id);
 
 static const struct of_device_id max77759_of_id[] = {
-	{ .compatible = "maxim,max77759", },
+	{ .compatible = "maxim,max77759" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, max77759_of_id);
drivers/mfd/max77843.c +2 -2
index c1cbf1f88b15..0d0bb56a91e5 100644
@@ -164,8 +164,8 @@ static int max77843_probe(struct i2c_client *i2c)
 }
 
 static const struct of_device_id max77843_dt_match[] = {
-	{ .compatible = "maxim,max77843", },
-	{ },
+	{ .compatible = "maxim,max77843" },
+	{ }
 };
 
 static const struct i2c_device_id max77843_id[] = {
drivers/mfd/max8907.c +1 -1
index 6e2fed7021a8..c0d185f13de6 100644
@@ -294,7 +294,7 @@ static void max8907_i2c_remove(struct i2c_client *i2c)
 #ifdef CONFIG_OF
 static const struct of_device_id max8907_of_match[] = {
 	{ .compatible = "maxim,max8907" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, max8907_of_match);
 #endif
drivers/mfd/max8925-i2c.c +1 -1
index 25390d0eabd4..8d618b127f4d 100644
@@ -231,7 +231,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(max8925_pm_ops,
 
 static const struct of_device_id max8925_dt_ids[] = {
 	{ .compatible = "maxim,max8925", },
-	{},
+	{ }
 };
 
 static struct i2c_driver max8925_driver = {
drivers/mfd/max8997.c +1 -1
index 6edc18e0eebb..04e44174fd8d 100644
@@ -39,7 +39,7 @@ static const struct mfd_cell max8997_devs[] = {
 #ifdef CONFIG_OF
 static const struct of_device_id max8997_pmic_dt_match[] = {
 	{ .compatible = "maxim,max8997-pmic", .data = (void *)TYPE_MAX8997 },
-	{},
+	{ }
 };
 #endif
 
drivers/mfd/max8998.c +1 -1
index e93a5ffc9612..8d1df69a3158 100644
@@ -120,7 +120,7 @@ static const struct of_device_id max8998_dt_match[] = {
 	{ .compatible = "maxim,max8998", .data = (void *)TYPE_MAX8998 },
 	{ .compatible = "national,lp3974", .data = (void *)TYPE_LP3974 },
 	{ .compatible = "ti,lp3974", .data = (void *)TYPE_LP3974 },
-	{},
+	{ }
 };
 #endif
 
drivers/mfd/mc13xxx-spi.c +3 -3
index 56d2e57b7d73..009350aac28f 100644
@@ -35,9 +35,9 @@ static const struct spi_device_id mc13xxx_device_id[] = {
 MODULE_DEVICE_TABLE(spi, mc13xxx_device_id);
 
 static const struct of_device_id mc13xxx_dt_ids[] = {
-	{ .compatible = "fsl,mc13783", .data = &mc13xxx_variant_mc13783, },
-	{ .compatible = "fsl,mc13892", .data = &mc13xxx_variant_mc13892, },
-	{ .compatible = "fsl,mc34708", .data = &mc13xxx_variant_mc34708, },
+	{ .compatible = "fsl,mc13783", .data = &mc13xxx_variant_mc13783 },
+	{ .compatible = "fsl,mc13892", .data = &mc13xxx_variant_mc13892 },
+	{ .compatible = "fsl,mc34708", .data = &mc13xxx_variant_mc34708 },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, mc13xxx_dt_ids);
drivers/mfd/motorola-cpcap.c +3 -3
index feeccb2c6655..eab96299bc72 100644
@@ -195,9 +195,9 @@ static int cpcap_init_irq(struct cpcap_ddata *cpcap)
 }
 
 static const struct of_device_id cpcap_of_match[] = {
-	{ .compatible = "motorola,cpcap", },
-	{ .compatible = "st,6556002", },
-	{},
+	{ .compatible = "motorola,cpcap" },
+	{ .compatible = "st,6556002" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, cpcap_of_match);
 
drivers/mfd/mp2629.c +1 -1
index 717b704c3c6b..2634588a284a 100644
@@ -60,7 +60,7 @@ static int mp2629_probe(struct i2c_client *client)
 }
 
 static const struct of_device_id mp2629_of_match[] = {
-	{ .compatible = "mps,mp2629"},
+	{ .compatible = "mps,mp2629" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, mp2629_of_match);
drivers/mfd/mt6360-core.c +2 -2
index 254b00c905b7..31907e2e388c 100644
@@ -607,8 +607,8 @@ static int __maybe_unused mt6360_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(mt6360_pm_ops, mt6360_suspend, mt6360_resume);
 
 static const struct of_device_id mt6360_of_id[] = {
-	{ .compatible = "mediatek,mt6360", },
-	{},
+	{ .compatible = "mediatek,mt6360" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, mt6360_of_id);
 
drivers/mfd/mt6370.c +1 -1
index c7c2efe3598c..a7e5808b98ab 100644
@@ -294,7 +294,7 @@ static int mt6370_probe(struct i2c_client *i2c)
 
 static const struct of_device_id mt6370_match_table[] = {
 	{ .compatible = "mediatek,mt6370" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, mt6370_match_table);
 
drivers/mfd/mxs-lradc.c +2 -2
index 64afc7631790..e407bf1d74cf 100644
@@ -117,8 +117,8 @@ static struct mfd_cell mx28_cells[] = {
 };
 
 static const struct of_device_id mxs_lradc_dt_ids[] = {
-	{ .compatible = "fsl,imx23-lradc", .data = (void *)IMX23_LRADC, },
-	{ .compatible = "fsl,imx28-lradc", .data = (void *)IMX28_LRADC, },
+	{ .compatible = "fsl,imx23-lradc", .data = (void *)IMX23_LRADC },
+	{ .compatible = "fsl,imx28-lradc", .data = (void *)IMX28_LRADC },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, mxs_lradc_dt_ids);
drivers/mfd/ntxec.c +2 -2
index 08c68de0f01b..a16ca4265c40 100644
@@ -250,8 +250,8 @@ static void ntxec_remove(struct i2c_client *client)
 }
 
 static const struct of_device_id of_ntxec_match_table[] = {
-	{ .compatible = "netronix,ntxec", },
-	{}
+	{ .compatible = "netronix,ntxec" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_ntxec_match_table);
 
drivers/mfd/omap-usb-host.c +2 -2
index 4d29a6e2ed87..f9aed3fc02ce 100644
@@ -516,8 +516,8 @@ static int usbhs_omap_get_dt_pdata(struct device *dev,
 }
 
 static const struct of_device_id usbhs_child_match_table[] = {
-	{ .compatible = "ti,ehci-omap", },
-	{ .compatible = "ti,ohci-omap3", },
+	{ .compatible = "ti,ehci-omap" },
+	{ .compatible = "ti,ohci-omap3" },
 	{ }
 };
 
drivers/mfd/qcom-pm8008.c +2 -2
index 60204cc9a2dc..c1d522ecc938 100644
@@ -261,8 +261,8 @@ static int pm8008_probe(struct i2c_client *client)
 }
 
 static const struct of_device_id pm8008_match[] = {
-	{ .compatible = "qcom,pm8008", },
-	{ },
+	{ .compatible = "qcom,pm8008" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, pm8008_match);
 
drivers/mfd/qcom-pm8xxx.c +3 -3
index 0cf374c015ce..7547aecde4e0 100644
@@ -499,9 +499,9 @@ static const struct pm_irq_data pm8821_data = {
 };
 
 static const struct of_device_id pm8xxx_id_table[] = {
-	{ .compatible = "qcom,pm8058", .data = &pm8xxx_data},
-	{ .compatible = "qcom,pm8821", .data = &pm8821_data},
-	{ .compatible = "qcom,pm8921", .data = &pm8xxx_data},
+	{ .compatible = "qcom,pm8058", .data = &pm8xxx_data },
+	{ .compatible = "qcom,pm8821", .data = &pm8821_data },
+	{ .compatible = "qcom,pm8921", .data = &pm8xxx_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, pm8xxx_id_table);
drivers/mfd/rk8xx-i2c.c +1 -1
index 2951b2911a37..b09454df9494 100644
@@ -262,7 +262,7 @@ static const struct of_device_id rk8xx_i2c_of_match[] = {
 	{ .compatible = "rockchip,rk816", .data = &rk816_data },
 	{ .compatible = "rockchip,rk817", .data = &rk817_data },
 	{ .compatible = "rockchip,rk818", .data = &rk818_data },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, rk8xx_i2c_of_match);
 
drivers/mfd/rohm-bd71828.c +2 -2
index 5fb6142cf087..8bf8fc0dfcd1 100644
@@ -1127,8 +1127,8 @@ static const struct of_device_id bd71828_of_match[] = {
 	}, {
 		.compatible = "rohm,bd72720",
 		.data = (void *)ROHM_CHIP_TYPE_BD72720,
-	 },
-	{ },
+	},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, bd71828_of_match);
 
drivers/mfd/rohm-bd9576.c +3 -3
index 17323ae39803..eaf30aa3dcca 100644
@@ -167,9 +167,9 @@ static int bd957x_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct of_device_id bd957x_of_match[] = {
-	{ .compatible = "rohm,bd9576", .data = (void *)ROHM_CHIP_TYPE_BD9576, },
-	{ .compatible = "rohm,bd9573", .data = (void *)ROHM_CHIP_TYPE_BD9573, },
-	{ },
+	{ .compatible = "rohm,bd9576", .data = (void *)ROHM_CHIP_TYPE_BD9576 },
+	{ .compatible = "rohm,bd9573", .data = (void *)ROHM_CHIP_TYPE_BD9573 },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, bd957x_of_match);
 
drivers/mfd/rsmu_i2c.c +1 -1
index c03db3ce5f12..ae6a83e789db 100644
@@ -347,7 +347,7 @@ static const struct of_device_id rsmu_i2c_of_match[] = {
 	{ .compatible = "idt,82p33811", .data = (void *)RSMU_SABRE },
 	{ .compatible = "idt,8v19n850", .data = (void *)RSMU_SL },
 	{ .compatible = "idt,8v19n851", .data = (void *)RSMU_SL },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, rsmu_i2c_of_match);
 
drivers/mfd/rt4831.c +2 -2
index 2b3f84b81c65..06794ced4124 100644
@@ -99,8 +99,8 @@ static void rt4831_remove(struct i2c_client *client)
 }
 
 static const struct of_device_id rt4831_of_match[] = {
-	{ .compatible = "richtek,rt4831", },
-	{}
+	{ .compatible = "richtek,rt4831" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, rt4831_of_match);
 
drivers/mfd/rt5033.c +1 -1
index 799661fb1c72..61edc3b5f86e 100644
@@ -113,7 +113,7 @@ static const struct i2c_device_id rt5033_i2c_id[] = {
 MODULE_DEVICE_TABLE(i2c, rt5033_i2c_id);
 
 static const struct of_device_id rt5033_dt_match[] = {
-	{ .compatible = "richtek,rt5033", },
+	{ .compatible = "richtek,rt5033" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, rt5033_dt_match);
drivers/mfd/rz-mtu3.c +1 -1
index 0a254e61ec0a..75975808dd64 100644
@@ -352,7 +352,7 @@ static int rz_mtu3_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id rz_mtu3_of_match[] = {
-	{ .compatible = "renesas,rz-mtu3", },
+	{ .compatible = "renesas,rz-mtu3" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, rz_mtu3_of_match);
drivers/mfd/sec-acpm.c +3 -3
index d11fbf5b94b7..5c744148554e 100644
@@ -560,9 +560,9 @@ static const struct sec_pmic_acpm_platform_data s2mpg11_data = {
 };
 
 static const struct of_device_id sec_pmic_acpm_of_match[] = {
-	{ .compatible = "samsung,s2mpg10-pmic", .data = &s2mpg10_data, },
-	{ .compatible = "samsung,s2mpg11-pmic", .data = &s2mpg11_data, },
-	{ },
+	{ .compatible = "samsung,s2mpg10-pmic", .data = &s2mpg10_data },
+	{ .compatible = "samsung,s2mpg11-pmic", .data = &s2mpg11_data },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, sec_pmic_acpm_of_match);
 
drivers/mfd/sec-i2c.c +11 -11
index 4eec8f7ceee3..5c614098470f 100644
@@ -236,17 +236,17 @@ static const struct sec_pmic_i2c_platform_data s5m8767_data = {
 };
 
 static const struct of_device_id sec_pmic_i2c_of_match[] = {
-	{ .compatible = "samsung,s2dos05", .data = &s2dos05_data, },
-	{ .compatible = "samsung,s2mpa01-pmic", .data = &s2mpa01_data, },
-	{ .compatible = "samsung,s2mps11-pmic", .data = &s2mps11_data, },
-	{ .compatible = "samsung,s2mps13-pmic", .data = &s2mps13_data, },
-	{ .compatible = "samsung,s2mps14-pmic", .data = &s2mps14_data, },
-	{ .compatible = "samsung,s2mps15-pmic", .data = &s2mps15_data, },
-	{ .compatible = "samsung,s2mpu02-pmic", .data = &s2mpu02_data, },
-	{ .compatible = "samsung,s2mpu05-pmic", .data = &s2mpu05_data, },
-	{ .compatible = "samsung,s2mu005-pmic", .data = &s2mu005_data, },
-	{ .compatible = "samsung,s5m8767-pmic", .data = &s5m8767_data, },
-	{ },
+	{ .compatible = "samsung,s2dos05", .data = &s2dos05_data },
+	{ .compatible = "samsung,s2mpa01-pmic", .data = &s2mpa01_data },
+	{ .compatible = "samsung,s2mps11-pmic", .data = &s2mps11_data },
+	{ .compatible = "samsung,s2mps13-pmic", .data = &s2mps13_data },
+	{ .compatible = "samsung,s2mps14-pmic", .data = &s2mps14_data },
+	{ .compatible = "samsung,s2mps15-pmic", .data = &s2mps15_data },
+	{ .compatible = "samsung,s2mpu02-pmic", .data = &s2mpu02_data },
+	{ .compatible = "samsung,s2mpu05-pmic", .data = &s2mpu05_data },
+	{ .compatible = "samsung,s2mu005-pmic", .data = &s2mu005_data },
+	{ .compatible = "samsung,s5m8767-pmic", .data = &s5m8767_data },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, sec_pmic_i2c_of_match);
 
drivers/mfd/simple-mfd-i2c.c +1 -1
index ef3ce4bdf98b..4813faf9fd3e 100644
@@ -126,7 +126,7 @@ static const struct of_device_id simple_mfd_i2c_of_match[] = {
 	{ .compatible = "maxim,max77705-battery", .data = &maxim_mon_max77705 },
 	{ .compatible = "silergy,sy7636a", .data = &silergy_sy7636a },
 	{ .compatible = "spacemit,p1", .data = &spacemit_p1 },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match);
 
drivers/mfd/sky81452.c +1 -1
index 8a213176b7cd..7d72b357061d 100644
@@ -66,7 +66,7 @@ MODULE_DEVICE_TABLE(i2c, sky81452_ids);
 
 #ifdef CONFIG_OF
 static const struct of_device_id sky81452_of_match[] = {
-	{ .compatible = "skyworks,sky81452", },
+	{ .compatible = "skyworks,sky81452" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, sky81452_of_match);
drivers/mfd/sm501.c +1 -1
index b5bda477ebfc..c53b5cfd675d 100644
@@ -1656,7 +1656,7 @@ static struct pci_driver sm501_pci_driver = {
 MODULE_ALIAS("platform:sm501");
 
 static const struct of_device_id of_sm501_match_tbl[] = {
-	{ .compatible = "smi,sm501", },
+	{ .compatible = "smi,sm501" },
 	{ /* end */ }
 };
 MODULE_DEVICE_TABLE(of, of_sm501_match_tbl);
drivers/mfd/smpro-core.c +1 -1
index 59d31590c69b..b236e4235cb5 100644
@@ -120,7 +120,7 @@ static int smpro_core_probe(struct i2c_client *i2c)
 
 static const struct of_device_id smpro_core_of_match[] = {
 	{ .compatible = "ampere,smpro", .data = &smpro_regmap_config },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, smpro_core_of_match);
 
drivers/mfd/sprd-sc27xx-spi.c +1 -1
index aa052f646623..11d4aed1d43f 100644
@@ -287,7 +287,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops,
 static const struct of_device_id sprd_pmic_match[] = {
 	{ .compatible = "sprd,sc2730", .data = (void *)PMIC_TYPE_SC2730 },
 	{ .compatible = "sprd,sc2731", .data = (void *)PMIC_TYPE_SC2731 },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(of, sprd_pmic_match);
 
drivers/mfd/ssbi.c +1 -1
index 6e7aff6e2746..2797aef48a22 100644
@@ -306,7 +306,7 @@ static int ssbi_probe(struct platform_device *pdev)
 
 static const struct of_device_id ssbi_match_table[] = {
 	{ .compatible = "qcom,ssbi" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(of, ssbi_match_table);
 
drivers/mfd/stm32-lptimer.c +2 -2
index 123659178cc2..6518d45e9dd3 100644
@@ -113,8 +113,8 @@ static int stm32_lptimer_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id stm32_lptimer_of_match[] = {
-	{ .compatible = "st,stm32-lptimer", },
-	{},
+	{ .compatible = "st,stm32-lptimer" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, stm32_lptimer_of_match);
 
drivers/mfd/stm32-timers.c +2 -2
index b3dbc02aaf79..0e618260f595 100644
@@ -348,9 +348,9 @@ static void stm32_timers_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id stm32_timers_of_match[] = {
-	{ .compatible = "st,stm32-timers", },
+	{ .compatible = "st,stm32-timers" },
 	{ .compatible = "st,stm32mp25-timers", .data = (void *)STM32MP25_TIM_IPIDR },
-	{ /* end node */ },
+	{ /* end node */ }
 };
 MODULE_DEVICE_TABLE(of, stm32_timers_of_match);
 
drivers/mfd/stmfx.c +2 -2
index f683fdb6ece6..2c7c5f81c2d7 100644
@@ -540,8 +540,8 @@ static int stmfx_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(stmfx_dev_pm_ops, stmfx_suspend, stmfx_resume);
 
 static const struct of_device_id stmfx_of_match[] = {
-	{ .compatible = "st,stmfx-0300", },
-	{},
+	{ .compatible = "st,stmfx-0300" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, stmfx_of_match);
 
drivers/mfd/stmpe-i2c.c +9 -9
index 8eee780afa16..5ff9afdb8350 100644
@@ -54,15 +54,15 @@ static struct stmpe_client_info i2c_ci = {
 };
 
 static const struct of_device_id stmpe_of_match[] = {
-	{ .compatible = "st,stmpe610", .data = (void *)STMPE610, },
-	{ .compatible = "st,stmpe801", .data = (void *)STMPE801, },
-	{ .compatible = "st,stmpe811", .data = (void *)STMPE811, },
-	{ .compatible = "st,stmpe1600", .data = (void *)STMPE1600, },
-	{ .compatible = "st,stmpe1601", .data = (void *)STMPE1601, },
-	{ .compatible = "st,stmpe1801", .data = (void *)STMPE1801, },
-	{ .compatible = "st,stmpe2401", .data = (void *)STMPE2401, },
-	{ .compatible = "st,stmpe2403", .data = (void *)STMPE2403, },
-	{},
+	{ .compatible = "st,stmpe610", .data = (void *)STMPE610 },
+	{ .compatible = "st,stmpe801", .data = (void *)STMPE801 },
+	{ .compatible = "st,stmpe811", .data = (void *)STMPE811 },
+	{ .compatible = "st,stmpe1600", .data = (void *)STMPE1600 },
+	{ .compatible = "st,stmpe1601", .data = (void *)STMPE1601 },
+	{ .compatible = "st,stmpe1801", .data = (void *)STMPE1801 },
+	{ .compatible = "st,stmpe2401", .data = (void *)STMPE2401},
+	{ .compatible = "st,stmpe2403", .data = (void *)STMPE2403 },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, stmpe_of_match);
 
drivers/mfd/stmpe-spi.c +7 -7
index 22a3da062dee..7d6dcc9dc5d3 100644
@@ -110,13 +110,13 @@ static void stmpe_spi_remove(struct spi_device *spi)
 }
 
 static const struct of_device_id stmpe_spi_of_match[] = {
-	{ .compatible = "st,stmpe610", },
-	{ .compatible = "st,stmpe801", },
-	{ .compatible = "st,stmpe811", },
-	{ .compatible = "st,stmpe1601", },
-	{ .compatible = "st,stmpe2401", },
-	{ .compatible = "st,stmpe2403", },
-	{ /* sentinel */ },
+	{ .compatible = "st,stmpe610" },
+	{ .compatible = "st,stmpe801" },
+	{ .compatible = "st,stmpe811" },
+	{ .compatible = "st,stmpe1601" },
+	{ .compatible = "st,stmpe2401" },
+	{ .compatible = "st,stmpe2403" },
+	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, stmpe_spi_of_match);
 
drivers/mfd/stw481x.c +3 -3
index da1e293d36e9..14f60eed9762 100644
@@ -228,9 +228,9 @@ static const struct i2c_device_id stw481x_id[] = {
 MODULE_DEVICE_TABLE(i2c, stw481x_id);
 
 static const struct of_device_id stw481x_match[] = {
-	{ .compatible = "st,stw4810", },
-	{ .compatible = "st,stw4811", },
-	{ },
+	{ .compatible = "st,stw4810" },
+	{ .compatible = "st,stw4811" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, stw481x_match);
 
drivers/mfd/sun6i-prcm.c +1 -1
index ee03db0b8485..a8a168f66fc1 100644
@@ -122,7 +122,7 @@ static const struct of_device_id sun6i_prcm_dt_ids[] = {
 		.compatible = "allwinner,sun8i-a23-prcm",
 		.data = &sun8i_a23_prcm_data,
 	},
-	{ /* sentinel */ },
+	{ /* sentinel */ }
 };
 
 static int sun6i_prcm_probe(struct platform_device *pdev)
drivers/mfd/tps6105x.c +1 -1
index 94f5b1a6a923..d486d143288c 100644
@@ -200,7 +200,7 @@ MODULE_DEVICE_TABLE(i2c, tps6105x_id);
 static const struct of_device_id tps6105x_of_match[] = {
 	{ .compatible = "ti,tps61050" },
 	{ .compatible = "ti,tps61052" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, tps6105x_of_match);
 
drivers/mfd/tps6507x.c +2 -2
index ed806754d89f..1d1435a6b9c2 100644
@@ -110,8 +110,8 @@ MODULE_DEVICE_TABLE(i2c, tps6507x_i2c_id);
 
 #ifdef CONFIG_OF
 static const struct of_device_id tps6507x_of_match[] = {
-	{.compatible = "ti,tps6507x", },
-	{},
+	{ .compatible = "ti,tps6507x" },
+	{}
 };
 MODULE_DEVICE_TABLE(of, tps6507x_of_match);
 #endif
drivers/mfd/tps65086.c +1 -1
index a73e0b5c0982..51dc0acbe781 100644
@@ -57,7 +57,7 @@ static const struct regmap_irq_chip tps65086_irq_chip = {
 };
 
 static const struct of_device_id tps65086_of_match_table[] = {
-	{ .compatible = "ti,tps65086", },
+	{ .compatible = "ti,tps65086" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, tps65086_of_match_table);
drivers/mfd/tps65090.c +2 -2
index ae845be3a8ea..ffe3a014b8ad 100644
@@ -157,8 +157,8 @@ static const struct regmap_config tps65090_regmap_config = {
 
 #ifdef CONFIG_OF
 static const struct of_device_id tps65090_of_match[] = {
-	{ .compatible = "ti,tps65090",},
-	{},
+	{ .compatible = "ti,tps65090" },
+	{ }
 };
 #endif
 
drivers/mfd/tps65217.c +2 -2
index cef5cefafea3..a76389f99c0d 100644
@@ -302,8 +302,8 @@ static const struct regmap_config tps65217_regmap_config = {
 };
 
 static const struct of_device_id tps65217_of_match[] = {
-	{ .compatible = "ti,tps65217"},
-	{ /* sentinel */ },
+	{ .compatible = "ti,tps65217" },
+	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, tps65217_of_match);
 
drivers/mfd/tps65218.c +2 -2
index d2d39bd7eddd..37aa43a2e29b 100644
@@ -197,8 +197,8 @@ static const struct regmap_irq_chip tps65218_irq_chip = {
 };
 
 static const struct of_device_id of_tps65218_match_table[] = {
-	{ .compatible = "ti,tps65218", },
-	{}
+	{ .compatible = "ti,tps65218" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_tps65218_match_table);
 
drivers/mfd/tps65219.c +4 -4
index e52fbf1481fe..a63640221397 100644
@@ -554,10 +554,10 @@ static int tps65219_probe(struct i2c_client *client)
 }
 
 static const struct of_device_id of_tps65219_match_table[] = {
-	{ .compatible = "ti,tps65214", .data = (void *)TPS65214, },
-	{ .compatible = "ti,tps65215", .data = (void *)TPS65215, },
-	{ .compatible = "ti,tps65219", .data = (void *)TPS65219, },
-	{}
+	{ .compatible = "ti,tps65214", .data = (void *)TPS65214 },
+	{ .compatible = "ti,tps65215", .data = (void *)TPS65215 },
+	{ .compatible = "ti,tps65219", .data = (void *)TPS65219 },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, of_tps65219_match_table);
 
drivers/mfd/tps6586x.c +2 -2
index 6fa932cda025..9f0190851969 100644
@@ -432,8 +432,8 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien
 }
 
 static const struct of_device_id tps6586x_of_match[] = {
-	{ .compatible = "ti,tps6586x", },
-	{ },
+	{ .compatible = "ti,tps6586x" },
+	{ }
 };
 #else
 static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *client)
drivers/mfd/tps65910.c +3 -3
index d19bd3643591..488fd879702e 100644
@@ -366,9 +366,9 @@ static int tps65910_sleepinit(struct tps65910 *tps65910,
 
 #ifdef CONFIG_OF
 static const struct of_device_id tps65910_of_match[] = {
-	{ .compatible = "ti,tps65910", .data = (void *)TPS65910},
-	{ .compatible = "ti,tps65911", .data = (void *)TPS65911},
-	{ },
+	{ .compatible = "ti,tps65910", .data = (void *)TPS65910 },
+	{ .compatible = "ti,tps65911", .data = (void *)TPS65911 },
+	{ }
 };
 
 static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
drivers/mfd/tps65912-i2c.c +1 -1
index 3eca8880532e..66978d1ad537 100644
@@ -16,7 +16,7 @@
 #include <linux/mfd/tps65912.h>
 
 static const struct of_device_id tps65912_i2c_of_match_table[] = {
-	{ .compatible = "ti,tps65912", },
+	{ .compatible = "ti,tps65912" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, tps65912_i2c_of_match_table);
drivers/mfd/tps65912-spi.c +1 -1
index 2442a2e67d67..6eee103887cd 100644
@@ -16,7 +16,7 @@
 #include <linux/mfd/tps65912.h>
 
 static const struct of_device_id tps65912_spi_of_match_table[] = {
-	{ .compatible = "ti,tps65912", },
+	{ .compatible = "ti,tps65912" },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, tps65912_spi_of_match_table);
drivers/mfd/tps6594-i2c.c +6 -6
index d2269f14f068..a3ad0d61f8de 100644
@@ -197,12 +197,12 @@ static struct regmap_config tps6594_i2c_regmap_config = {
 };
 
 static const struct of_device_id tps6594_i2c_of_match_table[] = {
-	{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, },
-	{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, },
-	{ .compatible = "ti,lp8764-q1",  .data = (void *)LP8764,  },
-	{ .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, },
-	{ .compatible = "ti,tps652g1", .data = (void *)TPS652G1, },
-	{}
+	{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594 },
+	{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593 },
+	{ .compatible = "ti,lp8764-q1", .data = (void *)LP8764  },
+	{ .compatible = "ti,tps65224-q1", .data = (void *)TPS65224 },
+	{ .compatible = "ti,tps652g1", .data = (void *)TPS652G1 },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, tps6594_i2c_of_match_table);
 
drivers/mfd/tps6594-spi.c +6 -6
index bb95d6b64cb4..e2f6bb69fe60 100644
@@ -82,12 +82,12 @@ static struct regmap_config tps6594_spi_regmap_config = {
 };
 
 static const struct of_device_id tps6594_spi_of_match_table[] = {
-	{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, },
-	{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, },
-	{ .compatible = "ti,lp8764-q1",  .data = (void *)LP8764,  },
-	{ .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, },
-	{ .compatible = "ti,tps652g1", .data = (void *)TPS652G1, },
-	{}
+	{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594 },
+	{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593 },
+	{ .compatible = "ti,lp8764-q1", .data = (void *)LP8764  },
+	{ .compatible = "ti,tps65224-q1", .data = (void *)TPS65224 },
+	{ .compatible = "ti,tps652g1", .data = (void *)TPS652G1 },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, tps6594_spi_of_match_table);
 
drivers/mfd/twl4030-audio.c +2 -2
index a4a550bafb3c..96e2a281e7fe 100644
@@ -265,8 +265,8 @@ static void twl4030_audio_remove(struct platform_device *pdev)
 }
 
 static const struct of_device_id twl4030_audio_of_match[] = {
-	{.compatible = "ti,twl4030-audio", },
-	{ },
+	{ .compatible = "ti,twl4030-audio" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, twl4030_audio_of_match);
 
drivers/mfd/twl4030-power.c +1 -1
index fc1cf316c236..f7fe6fcce891 100644
@@ -875,7 +875,7 @@ static const struct of_device_id twl4030_power_of_match[] = {
 		.compatible = "ti,twl4030-power-omap3-evm",
 		.data = &omap3_idle_ac_quirk,
 	},
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, twl4030_power_of_match);
 #endif	/* CONFIG_OF */
drivers/mfd/twl6030-irq.c +1 -1
index 4303fb288dd5..b3e9fbeb5acb 100644
@@ -285,7 +285,7 @@ static const struct irq_domain_ops twl6030_irq_domain_ops = {
 static const struct of_device_id twl6030_of_match[] __maybe_unused = {
 	{ .compatible = "ti,twl6030", .data = &twl6030_interrupt_mapping },
 	{ .compatible = "ti,twl6032", .data = &twl6032_interrupt_mapping },
-	{ },
+	{ }
 };
 
 int twl6030_init_irq(struct device *dev, int irq_num)
drivers/mfd/vexpress-sysreg.c +2 -2
index f49cee91f71c..3de377744aa1 100644
@@ -142,8 +142,8 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id vexpress_sysreg_match[] = {
-	{ .compatible = "arm,vexpress-sysreg", },
-	{},
+	{ .compatible = "arm,vexpress-sysreg" },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, vexpress_sysreg_match);
 
drivers/mfd/wm831x-core.c +1 -1
index df8e76e000cc..00edac4216e2 100644
@@ -1445,7 +1445,7 @@ const struct of_device_id wm831x_of_match[] = {
 	{ .compatible = "wlf,wm8321", .data = (void *)WM8321 },
 	{ .compatible = "wlf,wm8325", .data = (void *)WM8325 },
 	{ .compatible = "wlf,wm8326", .data = (void *)WM8326 },
-	{ },
+	{ }
 };
 EXPORT_SYMBOL_GPL(wm831x_of_match);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#56 lore raw

PATCH v2 22/23 mfd: Unify style of pci_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

These arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Adapt the offenders accordingly.

---
 drivers/mfd/cs5535-mfd.c           | 2 +-
 drivers/mfd/intel_quark_i2c_gpio.c | 4 ++--
 drivers/mfd/ioc3.c                 | 2 +-
 drivers/mfd/janz-cmodio.c          | 2 +-
 drivers/mfd/lpc_ich.c              | 2 +-
 drivers/mfd/rdc321x-southbridge.c  | 2 +-
 drivers/mfd/sm501.c                | 2 +-
 drivers/mfd/timberdale.c           | 2 +-
 drivers/mfd/vx855.c                | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)
drivers/mfd/cs5535-mfd.c +1 -1
index f3becbef19f5..3b52717aa316 100644
@@ -155,7 +155,7 @@ static void cs5535_mfd_remove(struct pci_dev *pdev)
 static const struct pci_device_id cs5535_mfd_pci_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_ISA) },
 	{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA) },
-	{ 0, }
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, cs5535_mfd_pci_tbl);
 
drivers/mfd/intel_quark_i2c_gpio.c +2 -2
index 87dbe1a94247..8e10b1c7c128 100644
@@ -153,8 +153,8 @@ static struct mfd_cell intel_quark_mfd_cells[] = {
 };
 
 static const struct pci_device_id intel_quark_mfd_ids[] = {
-	{ PCI_VDEVICE(INTEL, 0x0934), },
-	{},
+	{ PCI_VDEVICE(INTEL, 0x0934) },
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, intel_quark_mfd_ids);
 
drivers/mfd/ioc3.c +1 -1
index bf2be3bc8602..b78dbb98b9a5 100644
@@ -655,7 +655,7 @@ static void ioc3_mfd_remove(struct pci_dev *pdev)
 
 static struct pci_device_id ioc3_mfd_id_table[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3) },
-	{ 0, },
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, ioc3_mfd_id_table);
 
drivers/mfd/janz-cmodio.c +1 -1
index 93e1c04bddd6..96556ea754fa 100644
@@ -265,7 +265,7 @@ static const struct pci_device_id cmodio_pci_ids[] = {
 	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030, PCI_VENDOR_ID_JANZ, 0x0202) },
 	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_JANZ, 0x0201) },
 	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_JANZ, 0x0202) },
-	{ 0, }
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, cmodio_pci_ids);
 
drivers/mfd/lpc_ich.c +1 -1
index d2efcc92bb59..8d4b0a499da8 100644
@@ -958,7 +958,7 @@ static const struct pci_device_id lpc_ich_ids[] = {
 	{ PCI_VDEVICE(INTEL, 0xa1c7), .driver_data = LPC_LEWISBURG },
 	{ PCI_VDEVICE(INTEL, 0xa242), .driver_data = LPC_LEWISBURG },
 	{ PCI_VDEVICE(INTEL, 0xa243), .driver_data = LPC_LEWISBURG },
-	{ },			/* End of list */
+	{ }			/* End of list */
 };
 MODULE_DEVICE_TABLE(pci, lpc_ich_ids);
 
drivers/mfd/rdc321x-southbridge.c +1 -1
index c44a76285147..9405d9ac9918 100644
@@ -79,7 +79,7 @@ static int rdc321x_sb_probe(struct pci_dev *pdev,
 
 static const struct pci_device_id rdc321x_sb_table[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_RDC, PCI_DEVICE_ID_RDC_R6030) },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, rdc321x_sb_table);
 
drivers/mfd/sm501.c +1 -1
index c53b5cfd675d..82628c2c0de7 100644
@@ -1641,7 +1641,7 @@ static void sm501_plat_remove(struct platform_device *dev)
 
 static const struct pci_device_id sm501_pci_tbl[] = {
 	{ PCI_DEVICE(0x126f, 0x0501) },
-	{ },
+	{ }
 };
 
 MODULE_DEVICE_TABLE(pci, sm501_pci_tbl);
drivers/mfd/timberdale.c +1 -1
index e75e1d6851ab..adf7a7ead3b6 100644
@@ -845,7 +845,7 @@ static void timb_remove(struct pci_dev *dev)
 
 static const struct pci_device_id timberdale_pci_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_TIMB, PCI_DEVICE_ID_TIMB) },
-	{ 0 }
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, timberdale_pci_tbl);
 
drivers/mfd/vx855.c +1 -1
index 985f81c1739c..623735be62ad 100644
@@ -105,7 +105,7 @@ static void vx855_remove(struct pci_dev *pdev)
 
 static const struct pci_device_id vx855_pci_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VX855) },
-	{ 0, }
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, vx855_pci_tbl);
 
Signature · 1 line
2.55.0.11.g153666a7d9bb
#58 lore raw

PATCH v2 23/23 mfd: Unify style of spi_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)

These arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Adapt the offenders accordingly.

---
 drivers/mfd/altera-a10sr.c    | 2 +-
 drivers/mfd/arizona-spi.c     | 2 +-
 drivers/mfd/cs40l50-spi.c     | 2 +-
 drivers/mfd/da9052-spi.c      | 2 +-
 drivers/mfd/motorola-cpcap.c  | 6 +++---
 drivers/mfd/rsmu_spi.c        | 2 +-
 drivers/mfd/sprd-sc27xx-spi.c | 2 +-
 drivers/mfd/wm831x-spi.c      | 2 +-
 8 files changed, 10 insertions(+), 10 deletions(-)
drivers/mfd/altera-a10sr.c +1 -1
index 260e590b87b1..6ce20c764e30 100644
@@ -155,7 +155,7 @@ MODULE_DEVICE_TABLE(of, altr_a10sr_spi_of_match);
 
 static const struct spi_device_id altr_a10sr_spi_ids[] = {
 	{ .name = "a10sr" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(spi, altr_a10sr_spi_ids);
 
drivers/mfd/arizona-spi.c +1 -1
index c4ee5b499fce..c02b291574a6 100644
@@ -260,7 +260,7 @@ static const struct spi_device_id arizona_spi_ids[] = {
 	{ .name = "wm8280", .driver_data = WM8280 },
 	{ .name = "wm1831", .driver_data = WM1831 },
 	{ .name = "cs47l24", .driver_data = CS47L24 },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(spi, arizona_spi_ids);
 
drivers/mfd/cs40l50-spi.c +1 -1
index c273bc98e7f8..902a6c324d83 100644
@@ -41,7 +41,7 @@ static void cs40l50_spi_remove(struct spi_device *spi)
 
 static const struct spi_device_id cs40l50_id_spi[] = {
 	{ .name = "cs40l50" },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(spi, cs40l50_id_spi);
 
drivers/mfd/da9052-spi.c +1 -1
index 2a08481432e3..29cf2c17fde1 100644
@@ -68,7 +68,7 @@ static const struct spi_device_id da9052_spi_id[] = {
 	{ .name = "da9053-ba", .driver_data = DA9053_BA },
 	{ .name = "da9053-bb", .driver_data = DA9053_BB },
 	{ .name = "da9053-bc", .driver_data = DA9053_BC },
-	{}
+	{ }
 };
 
 static struct spi_driver da9052_spi_driver = {
drivers/mfd/motorola-cpcap.c +3 -3
index eab96299bc72..3d7aa4b0895f 100644
@@ -202,9 +202,9 @@ static const struct of_device_id cpcap_of_match[] = {
 MODULE_DEVICE_TABLE(of, cpcap_of_match);
 
 static const struct spi_device_id cpcap_spi_ids[] = {
-	{ .name = "cpcap", },
-	{ .name = "6556002", },
-	{},
+	{ .name = "cpcap" },
+	{ .name = "6556002" },
+	{ }
 };
 MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
 
drivers/mfd/rsmu_spi.c +1 -1
index 8b2e7cb401b5..3fc1135c24be 100644
@@ -244,7 +244,7 @@ static const struct spi_device_id rsmu_spi_id[] = {
 	{ .name = "8a34002",  .driver_data = RSMU_CM },
 	{ .name = "82p33810", .driver_data = RSMU_SABRE },
 	{ .name = "82p33811", .driver_data = RSMU_SABRE },
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(spi, rsmu_spi_id);
 
drivers/mfd/sprd-sc27xx-spi.c +1 -1
index 11d4aed1d43f..3d7d896e11df 100644
@@ -294,7 +294,7 @@ MODULE_DEVICE_TABLE(of, sprd_pmic_match);
 static const struct spi_device_id sprd_pmic_spi_ids[] = {
 	{ .name = "sc2730", .driver_data = PMIC_TYPE_SC2730 },
 	{ .name = "sc2731", .driver_data = PMIC_TYPE_SC2731 },
-	{},
+	{ }
 };
 MODULE_DEVICE_TABLE(spi, sprd_pmic_spi_ids);
 
drivers/mfd/wm831x-spi.c +1 -1
index 4cdb6e0734c4..1e519fd9a9e1 100644
@@ -84,7 +84,7 @@ static const struct spi_device_id wm831x_spi_ids[] = {
 	{ .name = "wm8321", .driver_data = WM8321 },
 	{ .name = "wm8325", .driver_data = WM8325 },
 	{ .name = "wm8326", .driver_data = WM8326 },
-	{ },
+	{ }
 };
 
 static struct spi_driver wm831x_spi_driver = {
Signature · 1 line
2.55.0.11.g153666a7d9bb
Reviewed-by on v2 18/23
#43 lore raw

Re: [PATCH v2 18/23] mfd: Unify style of acpi_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 4 lines · Uwe Kleine-König (The Capable Hub)

Update the various acpi_device_id arrays to conform to the most used and generally recommended coding style. That is:

Quoted 8 lines

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Adapt the few offenders accordingly.

You combined different type of drivers into one patch. I don't care much about this, but personally I would prefer PMICs to be in a separate patch, and the rest perhaps per driver. In any case,

it's up to Lee.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#11 lore raw

Re: [PATCH v2 05/23] mfd: mt6360: Drop irrelevant __maybe_unused

In reply to Uwe Kleine-König (The Capable Hub)
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 6 lines

Since commit 5ab23c7923a1 ("modpost: Create modalias for builtin modules") MODULE_DEVICE_TABLE() is enough to reference a device id array even if the driver is built-in. So mt6360_of_id[] is always used and the __maybe_unused marker serves no purpose and can be dropped.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
#21 lore raw

Re: [PATCH v2 10/23] mfd: Drop unused assignment of spi_device_id driver data

In reply to Uwe Kleine-König (The Capable Hub)
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 8 lines

The drivers explicitly set the .driver_data member of struct spi_device_id to zero without relying on that value. Drop these unused assignments.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=10
#37 lore raw

Re: [PATCH v2 16/23] mfd: Use named initializers for platform_device_id array

In reply to Uwe Kleine-König (The Capable Hub)
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 8 lines

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct platform_device_id that replaces .driver_data by an anonymous union.

Quoted 7 lines

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

Also drop a tailing comma after a list terminator to match the common style for these device-id arrays.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=16
#13 lore raw

Re: [PATCH v2 06/23] mfd: rt4831: Drop irrelevant __maybe_unused

In reply to Uwe Kleine-König (The Capable Hub)
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 6 lines

Since commit 5ab23c7923a1 ("modpost: Create modalias for builtin modules") MODULE_DEVICE_TABLE() is enough to reference a device id array even if the driver is built-in. So rt4831_of_match[] is always used and the __maybe_unused marker serves no purpose and can be dropped.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
#17 lore raw

Re: [PATCH v2 08/23] mfd: Drop unused assignment of i2c_device_id driver data

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Pre-existing issues:
- [High] Manual IRQ descriptors set up in rc5t583_irq_init are not unwound if devm_mfd_add_devices fails, leaving dangling pointers in the IRQ domain.
- [Medium] The as3711_subdevs array is declared as static struct mfd_cell rather than static const struct mfd_cell and is dynamically modified during the probe sequence to inject platform data. This violates the MFD subsystem requirement that cell arrays must be constant and exposes the driver to data races. --

--- Patch [8]: [PATCH v2 08/23] mfd: Drop unused assignment of i2c_device_id driver data --- commit 8379acaecc9704c9b84d18aac2206438b37018a2
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: Drop unused assignment of i2c_device_id driver data

The drivers explicitly set the .driver_data member of struct i2c_device_id to zero without relying on that value. Drop these unused assignments.

drivers/mfd/as3711.c static int as3711_i2c_probe(struct i2c_client *client) · line 192

Quoted 6 lines
drivers/mfd/as3711.c +0 -0
index 9741977031df0..eb03b813d58f0 100644
@@ -192,7 +192,7 @@ static int as3711_i2c_probe(struct i2c_client *client)
 }

[Severity: Medium]
This is a pre-existing issue, but I noticed that the as3711_subdevs array is dynamically mutated during the probe sequence in as3711_i2c_probe():

	if (pdata) {
		as3711_subdevs[AS3711_REGULATOR].platform_data =
			&pdata->regulator;
		as3711_subdevs[AS3711_REGULATOR].pdata_size =
			sizeof(pdata->regulator);
		...
	}

The cell array is incorrectly declared as static struct mfd_cell instead of static const struct mfd_cell. Could this cause the wrong platform data to be assigned if multiple instances of the AS3711 PMIC are probed concurrently on different buses, as they would race to write their device-specific data into the shared global as3711_subdevs array before it is copied by devm_mfd_add_devices()?

Quoted 6 lines
drivers/mfd/as3711.c +1 -1
 static const struct i2c_device_id as3711_i2c_id[] = {
-	{.name = "as3711", .driver_data = 0},
+	{ .name = "as3711" },
 	{}
 };

[ ... ]

drivers/mfd/rc5t583.c static int rc5t583_i2c_probe(struct i2c_client *i2c) · line 280

Quoted 6 lines
drivers/mfd/rc5t583.c +0 -0
index 2c0e8e9630f74..4ad761fbfab24 100644
@@ -280,7 +280,7 @@ static int rc5t583_i2c_probe(struct i2c_client *i2c)
 }

[Severity: High]
This isn't a bug introduced by this patch, but there appears to be an error handling issue in rc5t583_i2c_probe(). Manual IRQ descriptors are set up via rc5t583_irq_init() using irq_set_chip_data() and irq_set_chip_and_handler(), which point to the devres-managed rc5t583 instance.

If devm_mfd_add_devices() fails, the probe exits:

	ret = devm_mfd_add_devices(rc5t583->dev, -1, rc5t583_subdevs,
				   ARRAY_SIZE(rc5t583_subdevs), NULL, 0, NULL);
	if (ret) {
		dev_err(&i2c->dev, "add mfd devices failed: %d\n", ret);
		return ret;
	}

Since these descriptors are not explicitly unwound on this error path, and devres frees the rc5t583 structure, does this leave dangling pointers in the IRQ domain? Could this lead to a use-after-free if the IRQ debugfs interfaces or /proc/interrupts are queried later for those IRQ numbers?

Quoted 6 lines
drivers/mfd/rc5t583.c +1 -1
 static const struct i2c_device_id rc5t583_i2c_id[] = {
-	{.name = "rc5t583", .driver_data = 0},
+	{ .name = "rc5t583" },
 	{}
 };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8
#23 lore raw

Re: [PATCH v2 11/23] mfd: Use named initializers for acpi_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 5 lines

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

Quoted 7 lines

The mentioned robustness is relevant for a planned change to struct acpi_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=11
#28 lore raw

Re: [PATCH v2 13/23] mfd: Use named initializers for arrays of i2c_device_id

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] The `rsmu_i2c_id` array is missing its required null-terminating sentinel element. --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The rsmu_i2c_id array is missing its required null-terminating sentinel element. --

--- Patch [13]: [PATCH v2 13/23] mfd: Use named initializers for arrays of i2c_device_id --- commit f026cb9dcb83c5116a80b49dec846447e0d9699f
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: Use named initializers for arrays of i2c_device_id

This patch updates arrays of i2c_device_id to use named initializers instead of relying on positional initializers. This improves robustness against future changes to the struct.

Quoted 2 lines
drivers/mfd/rsmu_i2c.c +0 -0

[ ... ]

Quoted 10 lines
drivers/mfd/rsmu_i2c.c +0 -6
@@ -328,14 +328,13 @@ static void rsmu_i2c_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id rsmu_i2c_id[] = {
-	{ "8a34000",  RSMU_CM },
-	{ "8a34001",  RSMU_CM },
-	{ "8a34002",  RSMU_CM },
-	{ "82p33810", RSMU_SABRE },
-	{ "82p33811", RSMU_SABRE },
-	{ "8v19n850", RSMU_SL },

drivers/mfd/rsmu_i2c.c static void rsmu_i2c_remove(struct i2c_client *client) · line 338

Quoted 10 lines
drivers/mfd/rsmu_i2c.c +7 -2
-	{ "8v19n851", RSMU_SL },
-	{}
+	{ .name = "8a34000",  .driver_data = RSMU_CM },
+	{ .name = "8a34001",  .driver_data = RSMU_CM },
+	{ .name = "8a34002",  .driver_data = RSMU_CM },
+	{ .name = "82p33810", .driver_data = RSMU_SABRE },
+	{ .name = "82p33811", .driver_data = RSMU_SABRE },
+	{ .name = "8v19n850", .driver_data = RSMU_SL },
+	{ .name = "8v19n851", .driver_data = RSMU_SL },
 };

[Severity: High]
Will this lead to an out-of-bounds read during device matching? The terminating null sentinel was inadvertently removed from the end of the rsmu_i2c_id array.

The I2C subsystem (specifically i2c_match_id()) loops over i2c_device_id arrays until it encounters an element with an empty name string, so it will now read past the end of the array.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=13
#19 lore raw

Re: [PATCH v2 09/23] mfd: Drop unused assignment of platform_device_id driver data

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

Pre-existing issues:
- [High] Global PM notifier registered in irq init is never unregistered, leading to a use-after-free on probe failure or module unload.
- [Medium] The driver incorrectly passes platform data containing mfd_cell arrays directly via the .data field of the of_device_id match table.
- [Medium] The driver fails to unwind and remove registered child devices when a subsequent child device fails to register during the probe sequence. --

--- Patch [9]: [PATCH v2 09/23] mfd: Drop unused assignment of platform_device_id driver data --- commit 3723bdf6f78114270ad724f7a7a9017e2dfaa8b5
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: Drop unused assignment of platform_device_id driver data

The drivers explicitly set the driver_data member of struct platform_device_id to zero without relying on that value. Drop these unused assignments. This patch doesn't modify the compiled arrays, only their representation in source form benefits.

drivers/mfd/cros_ec_dev.c static void ec_device_remove(struct platform_device *pdev) · line 378

Quoted 10 lines
drivers/mfd/cros_ec_dev.c +1 -1
index e253c753beb6d..a933cb936da6a 100644
@@ -375,7 +375,7 @@ static void ec_device_remove(struct platform_device *pdev)
 }
 
 static const struct platform_device_id cros_ec_id[] = {
-	{ DRV_NAME, 0 },
+	{ DRV_NAME },

[Severity: Medium]
This is a pre-existing issue, but does this driver fail to unwind and remove registered child devices when a subsequent child device fails to register during the probe sequence?

In ec_device_probe(), the code iterates through multiple mfd_add_hotplug_devices() calls and logs an error without failing the probe or unwinding:

drivers/mfd/cros_ec_dev.c:ec_device_probe() {
    ...
    retval = mfd_add_hotplug_devices(ec->dev,
                cros_subdevices[i].mfd_cells,
                cros_subdevices[i].num_cells);
    if (retval)
        dev_err(ec->dev,
                "failed to add %s subdevice: %d\n",
                cros_subdevices[i].mfd_cells->name,
                retval);
    ...
}

Should the error path call mfd_remove_devices() and fail the probe?

drivers/mfd/mt6397-core.c static const struct of_device_id mt6397_of_match[] = { · line 429

Quoted 9 lines
drivers/mfd/cros_ec_dev.c +0 -0
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(platform, cros_ec_id);
drivers/mfd/mt6397-core.c +0 -0
index ea1d039477e30..7987583afc600 100644
@@ -429,7 +429,7 @@ static const struct of_device_id mt6397_of_match[] = {
 MODULE_DEVICE_TABLE(of, mt6397_of_match);

[Severity: Medium]
This is a pre-existing issue, but does the driver incorrectly pass platform data containing mfd_cell arrays directly via the data field of the of_device_id match table?

The match table populates the data field with pointers to struct chip_data:

drivers/mfd/mt6397-core.c:mt6397_of_match[] = {
    {
        .compatible = "mediatek,mt6323",
        .data = &mt6323_core,
    },
    ...
};

And mt6397_probe() retrieves it and passes its mfd_cell arrays directly to devm_mfd_add_devices():

drivers/mfd/mt6397-core.c:mt6397_probe() {
    ...
    ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE,
                               pmic_core->cells, pmic_core->cell_size,
                               NULL, 0, pmic->irq_domain);
    ...
}

Should this driver store an ID enum in the match table data field and select the static const mfd_cell array during probe instead?

[Severity: High]
This is a pre-existing issue, but does the global PM notifier registered in mt6397_irq_init() ever get unregistered?

If devm_mfd_add_devices() fails in mt6397_probe() or if the driver is unbound via sysfs, devm_kzalloc frees pmic, which includes pm_nb:

drivers/mfd/mt6397-core.c:mt6397_probe() {
    ...
    ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE,
                               pmic_core->cells, pmic_core->cell_size,
                               NULL, 0, pmic->irq_domain);
    if (ret) {
        irq_domain_remove(pmic->irq_domain);
        dev_err(&pdev->dev, "failed to add child devices: %d\n", ret);
    }
    return ret;
}

Since mt6397_irq_init() calls register_pm_notifier(&chip->pm_nb), returning an error frees the memory while the PM notifier chain retains a pointer to the freed pm_nb structure.

Can this lead to a use-after-free during a subsequent system suspend?

Quoted 7 lines
drivers/mfd/mt6397-core.c +1 -1
 static const struct platform_device_id mt6397_id[] = {
-	{ "mt6397", 0 },
+	{ "mt6397" },
 	{ },
 };
 MODULE_DEVICE_TABLE(platform, mt6397_id);
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=9
#7 lore raw

Re: [PATCH v2 03/23] mfd: kempld: Simplify device abstraction

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Critical] The local pointer pdata is left uninitialized in the ACPI probe path of kempld_probe(), leading to a critical uninitialized memory dereference.

Pre-existing issues:
- [High] The fallback DMI matching loop in kempld_init() breaks on failure instead of success due to an inverted condition. --

--- Patch [3]: [PATCH v2 03/23] mfd: kempld: Simplify device abstraction --- commit d573a2c98e6eca131a75d3abab38caed905aae33
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: kempld: Simplify device abstraction

This commit simplifies the driver by hardcoding the platform data instead of using the ACPI abstraction for multi-variant support. It also removes the unused ioresource member from the kempld_platform_data struct.

Quoted 4 lines
drivers/mfd/kempld-core.c +0 -0
index b64729918dfd3..e60736380cfe5 100644

[ ... ]

drivers/mfd/kempld-core.c static int kempld_probe(struct platform_device *pdev) · line 419

Quoted 12 lines
drivers/mfd/kempld-core.c +3 -5
@@ -415,11 +414,9 @@ static int kempld_probe(struct platform_device *pdev)
 		 * No kempld_pdev device has been registered in kempld_init,
 		 * so we seem to be probing an ACPI platform device.
 		 */
-		pdata = device_get_match_data(dev);
-		if (!pdata)
-			return -ENODEV;
-
-		ret = platform_device_add_data(pdev, pdata, sizeof(*pdata));
+		ret = platform_device_add_data(pdev,
+					       &kempld_platform_data_generic,
+					       sizeof(kempld_platform_data_generic));

[Severity: Critical]
By removing the pdata assignment here, doesn't pdata remain uninitialized in the ACPI path?

Later in kempld_probe() the driver unconditionally dereferences it:

	pld->pld_clock = pdata->pld_clock;

Will this cause a kernel panic due to an uninitialized stack pointer dereference when booting on hardware using the ACPI path?

Quoted 3 lines
drivers/mfd/kempld-core.c +0 -0
 		if (ret)
 			return ret;
 	} else if (kempld_pdev == pdev) {

[ ... ]

drivers/mfd/kempld-core.c static int __init kempld_init(void) · line 793

Quoted 13 lines
drivers/mfd/kempld-core.c +2 -2
@@ -787,13 +784,13 @@ static int __init kempld_init(void)
 	if (force_device_id[0]) {
 		for (id = kempld_dmi_table; id->matches[0].slot != DMI_NONE; id++)
 			if (strstr(id->ident, force_device_id))
-				if (!kempld_create_platform_device(&kempld_platform_data_generic))
+				if (!kempld_create_platform_device())
 					break;
 		if (id->matches[0].slot == DMI_NONE)
 			return -ENODEV;
 	} else {
 		for (id = dmi_first_match(kempld_dmi_table); id; id = dmi_first_match(id+1))
-			if (kempld_create_platform_device(&kempld_platform_data_generic))
+			if (kempld_create_platform_device())

[Severity: High]
This is a pre-existing issue, but should this if statement have a '!' like the force_device_id loop above it?

Since kempld_create_platform_device() returns 0 on success, this currently breaks out of the loop on failure instead of success.

If multiple DMI entries match the hardware, a successful registration evaluates to false causing the loop to continue. It then fails on the next iteration with -EEXIST and overwrites the global kempld_pdev with an error pointer, which forces the driver into the ACPI fallback path.

Quoted 3 lines
drivers/mfd/kempld-core.c +0 -0
 				break;
 	}
 	return platform_driver_register(&kempld_driver);
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
#59 lore raw

Re: [PATCH v2 23/23] mfd: Unify style of spi_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 10 lines

These arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Quoted 3 lines

Adapt the offenders accordingly.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=23
#2 lore raw

Re: [PATCH v2 01/23] mfd: bcm2835-pm: Remove member of struct bcm2835_pm that is only used locally

In reply to Uwe Kleine-König (The Capable Hub)
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 7 lines

struct bcm2835_pm::soc is only used in bcm2835_pm_probe() and thus can be replaced by a local variable.

With that change enum bcm2835_soc is only used in the mfd core driver and so the definition can move there.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#32 lore raw

Re: [PATCH v2 14/23] mfd: twl6030: Use named initializers for of_device_id

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Probe error path for devm_mfd_add_devices() skips twl_remove(), leaking I2C dummy devices and causing use-after-free crashes in IRQ/PM handlers. --

--- Patch [14]: [PATCH v2 14/23] mfd: twl6030: Use named initializers for of_device_id --- commit b98ced8719cc69d2b021a8dc33d71bce99241fa4
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: twl6030: Use named initializers for of_device_id

This commit updates the of_device_id struct initialization to use a named initializer for the .data member, matching the .compatible member. This improves readability and makes it more robust against future struct changes.

Quoted 5 lines
drivers/mfd/twl6030-irq.c +0 -0
index 0ca00f618d4d4..4303fb288dd5a 100644

drivers/mfd/twl6030-irq.c static const struct irq_domain_ops twl6030_irq_domain_ops = { · line 290

Quoted 10 lines
drivers/mfd/twl6030-irq.c +2 -2
@@ -283,8 +283,8 @@ static const struct irq_domain_ops twl6030_irq_domain_ops = {
 };
 
 static const struct of_device_id twl6030_of_match[] __maybe_unused = {
-	{.compatible = "ti,twl6030", &twl6030_interrupt_mapping},
-	{.compatible = "ti,twl6032", &twl6032_interrupt_mapping},
+	{ .compatible = "ti,twl6030", .data = &twl6030_interrupt_mapping },
+	{ .compatible = "ti,twl6032", .data = &twl6032_interrupt_mapping },
 	{ },
 };
 

[Severity: High]
This is a pre-existing issue, but while reviewing this code I noticed a potential use-after-free issue in the error path.

In drivers/mfd/twl-core.c:twl_probe(), if devm_mfd_add_devices() fails, the error path jumps to free:

drivers/mfd/twl-core.c:twl_probe() {
    ...
		status = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE,
					      cells, num_cells, NULL, 0, NULL);
		if (status < 0)
			goto free;
    ...
fail:
	if (status < 0)
		twl_remove(client);
free:
	if (status < 0)
    ...
}

This skips the fail block and the twl_remove() unwinding step.

Meanwhile, earlier in the probe sequence, twl6030_init_irq() explicitly registers a threaded IRQ and PM notifier without devres management:

drivers/mfd/twl6030-irq.c:twl6030_init_irq() {
    ...
	status = request_threaded_irq(irq_num, NULL, twl6030_irq_thread,
				      IRQF_ONESHOT, "TWL6030-PIH", twl6030_irq);
    ...
	twl6030_irq->twl_irq = irq_num;
	register_pm_notifier(&twl6030_irq->pm_nb);
    ...
}

Because twl_remove() is skipped on this failure path, does this leak the I2C dummy devices and leave the interrupt handler and PM notifier active?

Since the twl6030_irq structure is managed by devres (devm_kzalloc), it will be freed upon probe failure. Would this cause a use-after-free if an interrupt triggers or a PM event occurs after the probe fails?

Should the error path for devm_mfd_add_devices() jump to fail instead of free to ensure proper cleanup?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=14
#34 lore raw

Re: [PATCH v2 15/23] mfd: Use PCI_DEVICE* macros to initialize pci_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Non-standard commit message prefix omitting the driver name. --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Non-standard commit message prefix omitting the driver name.
--

--- Patch [15]: [PATCH v2 15/23] mfd: Use PCI_DEVICE* macros to initialize pci_device_id arrays --- commit 01daeb728dc1ab5baf28174c28473f068ecb03ae
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: Use PCI_DEVICE* macros to initialize pci_device_id arrays

pci_device_id entries are usually initialized using these PCI_DEVICE* macros. Adapt to this more usual style.

Quoted 1 line

mfd: Use PCI_DEVICE* macros to initialize pci_device_id arrays

[Severity: Low]
This isn't a bug, but does this commit message subject violate the MFD subsystem guidelines? The guidelines require the prefix to follow the format "mfd: <Driver>: <Capitalized description>". The driver name appears to be missing from the subject line.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=15
#5 lore raw

Re: [PATCH v2 02/23] mfd: bcm2835-pm: Drop unused header

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:

Pre-existing issues:
- [High] The bcm2835_init_power_domain function ignores the return value of pm_genpd_init(), which causes a NULL pointer dereference kernel panic during error unwinding if the initialization fails.
- [Medium] The bcm2835_power_probe error path leaks generic PM domains because pm_genpd_remove fails for domains that have subdomains attached.
- [Low] Driver-specific header placed in the global MFD include directory and used to pass non-shared raw MMIO resources between parent and children via a custom structure.
- [Low] Hard-coded device ID used instead of PLATFORM_DEVID_AUTO when calling devm_mfd_add_devices().
--

--- Patch [2]: [PATCH v2 02/23] mfd: bcm2835-pm: Drop unused header --- commit 7a2e01f06af404772de056dd430681d5c2f3c409
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: bcm2835-pm: Drop unused header

This patch removes the linux/regmap.h include from linux/mfd/bcm2835-pm.h. The header isn't used by the file itself or any of its users.

include/linux/mfd/bcm2835-pm.h line 8

Quoted 13 lines
include/linux/mfd/bcm2835-pm.h +0 -2
index f70a810c55f7d..12bb6bc2c07f4 100644
@@ -3,8 +3,6 @@
 #ifndef BCM2835_MFD_PM_H
 #define BCM2835_MFD_PM_H
 
-#include <linux/regmap.h>
-
 struct bcm2835_pm {
 	struct device *dev;
 	void __iomem *base;

[Severity: Low]
This is a pre-existing issue, but does this custom structure violate the MFD subsystem guidelines?

According to MFD rules, child drivers should retrieve parent data via standard APIs and use a regmap, rather than sharing non-shared raw MMIO resources through a bespoke structure in the global MFD include directory.

For example, bcm2835_pm_get_pdata() maps asb and rpivid_asb in the parent even though they are exclusively consumed by the power domain child. Also, the watchdog child accesses pm->base directly in bcm2835_wdt_probe().

[Severity: High]
This is a pre-existing issue, but could ignoring the return value of pm_genpd_init() lead to a NULL pointer dereference kernel panic?

If pm_genpd_init() fails (e.g. due to -ENOMEM), it returns an error and the domain's list_head remains zero-initialized:

drivers/pmdomain/bcm/bcm2835-power.c:bcm2835_init_power_domain() {
	...
	/* XXX: on/off at boot? */
	pm_genpd_init(&dom->base, NULL, true);

	power->pd_xlate.domains[pd_xlate_index] = &dom->base;
	return 0;
}

If a subsequent probe step fails, the error path calls pm_genpd_remove() for any domain with a name:

drivers/pmdomain/bcm/bcm2835-power.c:bcm2835_power_probe() {
	...
fail:
	for (i = 0; i < ARRAY_SIZE(power_domain_names); i++) {
		struct generic_pm_domain *dom = &power->domains[i].base;

		if (dom->name)
			pm_genpd_remove(dom);
	}
	return ret;
}

Since dom->name was already assigned before the failed pm_genpd_init() call, pm_genpd_remove() will invoke list_del() on the zero-initialized list_head, which causes a NULL pointer dereference in __list_del_entry_valid().

[Severity: Medium]
This is a pre-existing issue, but does bcm2835_power_probe() leak generic PM domains on its error path?

When devm_reset_controller_register() fails, the code iterates forwards over the power_domain_names array:

drivers/pmdomain/bcm/bcm2835-power.c:bcm2835_power_probe() {
	...
fail:
	for (i = 0; i < ARRAY_SIZE(power_domain_names); i++) {
		struct generic_pm_domain *dom = &power->domains[i].base;

		if (dom->name)
			pm_genpd_remove(dom);
	}
	return ret;
}

Will this forward iteration cause pm_genpd_remove() to fail and leak parent domains?

If a domain has subdomains attached, pm_genpd_remove() returns -EBUSY. Since parent domains appear earlier in the array than their subdomains, this error path attempts to remove the parent first, causing the removal to fail.

[Severity: Low]
This is a pre-existing issue, but are hard-coded device IDs used incorrectly here?

In drivers/mfd/bcm2835-pm.c:

drivers/mfd/bcm2835-pm.c:bcm2835_pm_probe() {
	...
	ret = devm_mfd_add_devices(dev, -1,
				   bcm2835_pm_devs, ARRAY_SIZE(bcm2835_pm_devs),
				   NULL, 0, NULL);
	...
}

Should devm_mfd_add_devices() use PLATFORM_DEVID_AUTO instead of -1?

Using -1 (PLATFORM_DEVID_NONE) can lead to sysfs naming collisions and driver load failures if multiple instances of the MFD parent are registered.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#9 lore raw

Re: [PATCH v2 04/23] mfd: lp87565: Explicitly set driver data for the generic dt compatible

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Pre-existing issues:
- [High] The I2C device ID table lp87565_id_table omits the .driver_data field for the lp87565-q1 entry, incorrectly identifying it as an unknown device when probed via I2C.
- [High] The probe function fails to properly propagate errors from devm_gpiod_get_optional(), improperly swallowing errors and misusing the resulting ERR_PTR. --

--- Patch [4]: [PATCH v2 04/23] mfd: lp87565: Explicitly set driver data for the generic dt compatible --- commit 4968e817f8387b287a7ba469356ea70ac971b3dd
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: lp87565: Explicitly set driver data for the generic dt compatible

The driver relies on .data being (void *)LP87565_DEVICE_TYPE_UNKNOWN (i.e. NULL) for the generic device tree compatible. Make this explicit.

Quoted 6 lines
drivers/mfd/lp87565.c +0 -0
index b78ae79df5fa6..efea1ba82811a 100644
@@ -26,7 +26,10 @@ static const struct mfd_cell lp87565_cells[] = {
 };

drivers/mfd/lp87565.c static const struct mfd_cell lp87565_cells[] = { · line 35

Quoted 10 lines
drivers/mfd/lp87565.c +4 -1
 
 static const struct of_device_id of_lp87565_match_table[] = {
-	{ .compatible = "ti,lp87565", },
+	{
+		.compatible = "ti,lp87565",
+		.data = (void *)LP87565_DEVICE_TYPE_UNKNOWN,
+	},
 	{
 		.compatible = "ti,lp87524-q1",
 		.data = (void *)LP87565_DEVICE_TYPE_LP87524_Q1,

[Severity: High]
This isn't a bug introduced by this patch, but while looking at device matching, I noticed that the I2C device ID table omits the .driver_data field for the lp87565-q1 entry:

drivers/mfd/lp87565.c:lp87565_id_table[] = {
	{ "lp87565-q1" },
	{ }
};

When the device is instantiated via I2C board info or sysfs instead of Device Tree, it evaluates to 0 (LP87565_DEVICE_TYPE_UNKNOWN). The child regulator driver then falls back to the default configuration of 4 single-phase bucks instead of the correct configuration for lp87565-q1 (2 dual-phase bucks).

Should this have the driver_data explicitly set similarly to the DT match table?

[Severity: High]
This is a pre-existing issue, but the probe function seems to improperly handle errors from devm_gpiod_get_optional():

drivers/mfd/lp87565.c:lp87565_probe() {
	...
	if (IS_ERR(lp87565->reset_gpio)) {
		ret = PTR_ERR(lp87565->reset_gpio);
		if (ret == -EPROBE_DEFER)
			return ret;
	}
	...
}

If devm_gpiod_get_optional() returns an error other than -EPROBE_DEFER, the error is swallowed and the ERR_PTR is stored in lp87565->reset_gpio.

Because an error pointer is non-NULL, the condition if (lp87565->reset_gpio) evaluates to true. The driver then incorrectly passes the error pointer to gpiod_set_value_cansleep().

While gpiolib's VALIDATE_DESC() catches the invalid pointer and prevents a kernel crash by returning early after logging a warning, the driver falsely succeeds probe without acquiring its critical reset GPIO and repeatedly spams the kernel log.

Does this need to be updated to return the error for non-EPROBE_DEFER cases as well?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
#40 lore raw

Re: [PATCH v2 17/23] mfd: Use named initializers for arrays of spi_device_id

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The intel-m10-bmc-spi driver improperly passes pointers to structures containing mfd_cells via the spi_device_id match table's driver_data field, and the mfd_cell arrays are not declared as static const. --

--- Patch [17]: [PATCH v2 17/23] mfd: Use named initializers for arrays of spi_device_id --- commit cfa932dab5cca9437ebac2bf23f56766068cfb6b
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: Use named initializers for arrays of spi_device_id

This patch modifies arrays of spi_device_id across various MFD drivers to use named initializers. This improves readability and prepares for a planned change to struct spi_device_id where .driver_data becomes an anonymous union.

Quoted 5 lines
drivers/mfd/intel-m10-bmc-spi.c +0 -0
index cfa620f0c70e1..94b9c99bb4f86 100644

drivers/mfd/intel-m10-bmc-spi.c static const struct intel_m10bmc_platform_info m10bmc_spi_n5010 = { · line 165

Quoted 9 lines
drivers/mfd/intel-m10-bmc-spi.c +3 -3
@@ -160,9 +160,9 @@ static const struct intel_m10bmc_platform_info m10bmc_spi_n5010 = {
 };
 
 static const struct spi_device_id m10bmc_spi_id[] = {
-	{ "m10-n3000", (kernel_ulong_t)&m10bmc_spi_n3000 },
-	{ "m10-d5005", (kernel_ulong_t)&m10bmc_spi_d5005 },
-	{ "m10-n5010", (kernel_ulong_t)&m10bmc_spi_n5010 },
+	{ .name = "m10-n3000", .driver_data = (kernel_ulong_t)&m10bmc_spi_n3000 },
+	{ .name = "m10-d5005", .driver_data = (kernel_ulong_t)&m10bmc_spi_d5005 },
+	{ .name = "m10-n5010", .driver_data = (kernel_ulong_t)&m10bmc_spi_n5010 },

[Severity: High]
This isn't a bug introduced by this patch, but should this driver be refactored to avoid passing complex pointers through the match table?

The MFD architectural guidelines state that passing complex pointers, such as platform data and mfd_cell arrays, through match data tables can cause memory safety hazards and initialization ordering races during device probing.

Would it be better to store an enum or integer ID in the .driver_data field of m10bmc_spi_id, and use a switch statement in the probe function to select the correct static const mfd_cell array instead?

Additionally, looking at the structures referenced here, such as m10bmc_d5005_subdevs, it appears the mfd_cell arrays are missing the mandatory const modifier. Could those arrays be updated to static const?

Quoted 2 lines
drivers/mfd/intel-m10-bmc-spi.c +0 -0
 	{ }
 };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=17
#44 lore raw

Re: [PATCH v2 18/23] mfd: Unify style of acpi_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 10 lines

Update the various acpi_device_id arrays to conform to the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Quoted 3 lines

Adapt the few offenders accordingly.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=18
#26 lore raw

Re: [PATCH v2 12/23] mfd: intel-m10-bmc-pmci: Use named initializers for dfl_device_id array

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

Pre-existing issues:
- [High] pmci_flash_bulk_read and pmci_flash_bulk_write incorrectly handle unaligned sizes, dropping remainder bytes and potentially corrupting the FIFO state.
- [High] m10bmc_pmci_remove destroys flash_mutex before managed child devices are removed, leading to use-after-destroy.
--

--- Patch [12]: [PATCH v2 12/23] mfd: intel-m10-bmc-pmci: Use named initializers for dfl_device_id array --- commit d38fbca8e0d6c9a4d89f55b7970cd697c0c54a46
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: intel-m10-bmc-pmci: Use named initializers for dfl_device_id array

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

drivers/mfd/intel-m10-bmc-pmci.c static void m10bmc_pmci_remove(struct dfl_device *ddev) · line 440

Quoted 13 lines
drivers/mfd/intel-m10-bmc-pmci.c +1 -1
index d213c6ec04bad..f78309bbabfdb 100644
@@ -434,7 +434,7 @@ static void m10bmc_pmci_remove(struct dfl_device *ddev)
 #define FME_FEATURE_ID_M10BMC_PMCI	0x12
 
 static const struct dfl_device_id m10bmc_pmci_ids[] = {
-	{ FME_ID, FME_FEATURE_ID_M10BMC_PMCI },
+	{ .type = FME_ID, .feature_id = FME_FEATURE_ID_M10BMC_PMCI },
 	{ }
 };
 MODULE_DEVICE_TABLE(dfl, m10bmc_pmci_ids);

[Severity: High]
This is a pre-existing issue, but I noticed a potential problem in pmci_flash_bulk_read() and pmci_flash_bulk_write() when handling unaligned sizes:

drivers/mfd/intel-m10-bmc-pmci.c:pmci_flash_bulk_read() {
    ...
    blk_size = min_t(u32, size, M10BMC_N6000_READ_BLOCK_SIZE);
    ...
    size -= blk_size;
    offset += blk_size;
    ...
    }

    /* Handle remainder (less than M10BMC_N6000_FIFO_WORD_SIZE bytes) */
    if (size) {
    ...
}

If the requested chunk size is unaligned (e.g., 5 bytes), blk_size becomes 5. Subtracting blk_size from size reduces size to 0 before breaking the loop. When the loop breaks, the remainder block is skipped because size is now 0, silently dropping the remaining bytes.

The same logic applies to pmci_flash_bulk_write():

drivers/mfd/intel-m10-bmc-pmci.c:pmci_flash_bulk_write() {
    ...
    while (size) {
        blk_size = min(pmci_get_write_space(pmci), size);
        ...
        if (size < M10BMC_N6000_FIFO_WORD_SIZE)
            break;
        ...
        size -= blk_size;
        offset += blk_size;
    }

    /* Handle remainder (less than M10BMC_N6000_FIFO_WORD_SIZE bytes) */
    if (size) {
    ...
}

Does this loop logic incorrectly handle unaligned sizes, dropping remainder bytes and potentially corrupting the FIFO state?

[Severity: High]
This isn't a bug introduced by this patch, but could this teardown sequence lead to a use-after-destroy on the flash_mutex?

drivers/mfd/intel-m10-bmc-pmci.c:m10bmc_pmci_remove() {
    ...
    static void m10bmc_pmci_remove(struct dfl_device *ddev)
    {
        struct intel_m10bmc *m10bmc = dev_get_drvdata(&ddev->dev);
        struct m10bmc_pmci_device *pmci = container_of(m10bmc,
                                          struct m10bmc_pmci_device,
                                          m10bmc);

        mutex_destroy(&pmci->flash_mutex);
    }
    ...
}

The core driver uses devm_mfd_add_devices() in m10bmc_dev_init() to register child devices, meaning they are dismantled by devres after the m10bmc_pmci_remove() callback returns.

Because mutex_destroy() is called here manually before devres cleanup, could a child device executing a firmware update or being accessed concurrently during device teardown attempt to lock the already destroyed flash_mutex?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=12
#57 lore raw

Re: [PATCH v2 22/23] mfd: Unify style of pci_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 10 lines

These arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Quoted 3 lines

Adapt the offenders accordingly.

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=22
#47 lore raw

Re: [PATCH v2 19/23] mfd: Unify style of dmi_system_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider:

Pre-existing issues:
- [High] Incorrect teardown ordering in cgbc_remove, dropping the session before child devices are removed.
- [High] Dynamic modification of static mfd_cell arrays and shared resource structs.
- [Low] Creating local copies of mfd_cells on the stack for dynamic amendments.
- [Low] Passing complex pointers via match data .driver_data.
- [Low] Use of hard-coded mfd_cell IDs instead of relying on PLATFORM_DEVID_AUTO.
- [Low] Parent MFD driver initializing private resources meant strictly for a specific child driver. --

--- Patch [19]: [PATCH v2 19/23] mfd: Unify style of dmi_system_id arrays --- commit 0d30ec6eab3e1567ae95f20c0dd011ea31a5ae52
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: Unify style of dmi_system_id arrays

These arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Only the list terminators didn't match this style as they didn't use a space.

drivers/mfd/cgbc-core.c

Quoted 4 lines
drivers/mfd/cgbc-core.c +0 -0
index 10bb4b414c34d..b568722cc8b76 100644

[Severity: High]
This isn't a bug introduced by this patch, but I noticed a potential incorrect teardown ordering in cgbc_remove() in this file. The parent releases the hardware session before safely removing its child devices:

cgbc_remove() {
    ...
    cgbc_session_release(cgbc);

    mfd_remove_devices(&pdev->dev);
    ...
}

Because the core session is released before the children are removed by the MFD core, will hardware accesses in the child drivers' (like cgbc-wdt) .remove() callbacks fail and cause hangs or noisy errors during module removal?

[Severity: Low]
This is also a pre-existing issue in this file, but does the hard-coding of .id values for I2C children in cgbc_devs (e.g., { .name = "cgbc-i2c", .id = 1 } and .id = 2) violate the MFD subsystem guidelines?

The guidelines require using PLATFORM_DEVID_AUTO for automatic cell indexing to avoid naming collisions in sysfs and driver load failures.

[ ... ]

drivers/mfd/intel_quark_i2c_gpio.c

Quoted 13 lines
drivers/mfd/cgbc-core.c +1 -1
@@ -393,7 +393,7 @@ static const struct dmi_system_id cgbc_dmi_table[] __initconst = {
 			DMI_MATCH(DMI_BOARD_NAME, "conga-SA8"),
 		},
 	},
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(dmi, cgbc_dmi_table);
 
drivers/mfd/intel_quark_i2c_gpio.c +0 -0
index 9b9c76bd067b8..87dbe1a94247e 100644

[Severity: High]
This is a pre-existing issue in this file, but does intel_quark_i2c_setup() dynamically modify shared static resources?

intel_quark_i2c_setup() {
    ...
    res[INTEL_QUARK_IORES_MEM].start = pci_resource_start(pdev, MFD_I2C_BAR);
    ...
}

Modifying global non-const static arrays (like intel_quark_mfd_cells or intel_quark_i2c_res) during device probe could lead to global data corruption and initialization races if multiple compatible devices are present in the system.

[Severity: Low]
This is a pre-existing issue in this file, but does the hard-coding of .id values in intel_quark_mfd_cells violate the MFD subsystem guidelines?

[MFD_I2C_BAR] = {
    .id = MFD_I2C_BAR,
    ...
}

The guidelines require using PLATFORM_DEVID_AUTO for automatic cell indexing, and state that if a specific device needs numbering starting from 0, the platform_device->id field should be used instead of the mfd_cell ID.

[Severity: Low]
This is a pre-existing issue in this file, but is it appropriate for the parent MFD driver to initialize private resources purely for a specific child driver?

intel_quark_register_i2c_clk() {
    ...
    i2c_clk = clk_register_fixed_rate(dev,
                                      INTEL_QUARK_I2C_CONTROLLER_CLK, NULL,
                                      0, INTEL_QUARK_I2C_CLK_HZ);
    ...
}

The MFD guidelines dictate that private resources like clock handles should be initialized directly in the child driver that consumes them, rather than in the parent, to avoid tight coupling.

[ ... ]

drivers/mfd/intel_quark_i2c_gpio.c static const struct dmi_system_id dmi_platform_info[] = { · line 81

Quoted 4 lines
drivers/mfd/intel_quark_i2c_gpio.c +0 -0
@@ -79,7 +79,7 @@ static const struct dmi_system_id dmi_platform_info[] = {
 		},
 		.driver_data = (void *)&intel_quark_i2c_controller_fast_node,
 	},

[Severity: Low]
This is a pre-existing issue, but is it safe to pass complex pointers via match data here?

Subsystem guidelines warn that passing complex platform data pointers via match tables can cause memory safety hazards, and recommend storing an enum or integer ID instead.

drivers/mfd/kempld-core.c

Quoted 8 lines
drivers/mfd/intel_quark_i2c_gpio.c +1 -1
-	{}
+	{ }
 };
 
drivers/mfd/kempld-core.c +0 -0
index 9b3a877f44fbf..83d912e824014 100644

[Severity: Low]
This isn't a bug introduced by this patch, but does kempld_register_cells_generic() incorrectly create local copies of mfd_cells on the stack for dynamic amendments?

kempld_register_cells_generic() {
    ...
    struct mfd_cell devs[KEMPLD_MAX_DEVS] = {};
    int i = 0;

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

The MFD guidelines state that for mfd_cells, drivers should not create local copies for dynamic amendments, but should always use static references to enforce immutable child device topologies.

[ ... ]

drivers/mfd/tqmx86.c

Quoted 13 lines
drivers/mfd/kempld-core.c +1 -1
@@ -766,7 +766,7 @@ static const struct dmi_system_id kempld_dmi_table[] __initconst = {
 			DMI_MATCH(DMI_BOARD_NAME, "Qseven-Q7AL"),
 		},
 	},
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
 
drivers/mfd/tqmx86.c +0 -0
index 1c2fe3f912389..16f47566cf3c8 100644

[Severity: High]
This isn't a bug introduced by this patch, but does tqmx86_probe() dynamically modify shared static resources?

tqmx86_probe() {
    ...
    tqmx_gpio_resources[TQMX86_GPIO_IRQ] = DEFINE_RES_IRQ(gpio_irq);
    ...
}

Modifying the underlying shared static resources that belong to the mfd_cell definitions during device probe could cause global data corruption and initialization races if multiple compatible devices are present. The guidelines dictate defining mfd_cell arrays as static const.

[ ... ]

Quoted 9 lines
drivers/mfd/tqmx86.c +1 -1
@@ -338,7 +338,7 @@ static const struct dmi_system_id tqmx86_dmi_table[] __initconst = {
 		},
 		.callback = tqmx86_create_platform_device,
 	},
-	{}
+	{ }
 };
 MODULE_DEVICE_TABLE(dmi, tqmx86_dmi_table);
 
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=19
#15 lore raw

Re: [PATCH v2 07/23] mfd: loongson-se: Drop unused assignment of acpi_device_id driver data

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 10 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 10 potential issue(s) to consider:

Pre-existing issues:
- [High] Uninitialized stack memory within struct loongson_se_controller_cmd is written directly to the hardware's MMIO registers.
- [High] Missing validation of the ACPI dmam_size property can cause out-of-bounds DMA buffer usage and memory corruption.
- [High] Ignoring devm_request_irq() errors allows the probe to proceed without IRQs, guaranteeing a future thread deadlock.
- [High] Missing reinit_completion() before issuing hardware commands will cause premature false-positive returns if a previous command was interrupted.
- [High] Unhandled hardware interrupt bits can crash the kernel via an out-of-bounds array access in the interrupt handler.
- [High] Hardware interrupts are fully enabled before the IRQ handler is registered and before se->engines is initialized, which can trigger an IRQ storm or kernel panic.
- [High] Hardware interrupts are left enabled if the probe function fails or upon module removal, potentially causing unhandled interrupt storms.
- [Medium] The driver implements bespoke accessors to share state with child devices, violating MFD subsystem guidelines.
- [Medium] Polling loop holds a spinlock with interrupts disabled for up to 10 milliseconds.
- [Medium] The return value of dma_set_mask_and_coherent() is ignored.
--

--- Patch [7]: [PATCH v2 07/23] mfd: loongson-se: Drop unused assignment of acpi_device_id driver data --- commit 55ba21633256767bd465fa88072d7b0a24283435
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: loongson-se: Drop unused assignment of acpi_device_id driver data

The driver explicitly set the .driver_data member of struct acpi_device_id to zero without relying on that value. Drop this unused assignment. This patch doesn't modify the compiled array, only its representation in source form benefits.

drivers/mfd/loongson-se.c static int loongson_se_probe(struct platform_device *pdev) · line 238

Quoted 12 lines
drivers/mfd/loongson-se.c +1 -1
index 3902ba377d690..4c668e2d22412 100644
@@ -233,7 +233,7 @@ static int loongson_se_probe(struct platform_device *pdev)
 }
 
 static const struct acpi_device_id loongson_se_acpi_match[] = {
-	{ "LOON0011", 0 },
+	{ "LOON0011" },
 	{ }
 };

While reviewing this patch, I noticed several pre-existing issues in this file.

drivers/mfd/loongson-se.c:loongson_se_init_engine() {
    ...
    struct loongson_se_engine *loongson_se_init_engine(struct device *dev, int id)
    ...
}
drivers/mfd/loongson-se.c:loongson_se_send_engine_cmd() {
    ...
    int loongson_se_send_engine_cmd(struct loongson_se_engine *engine)
    ...
}

[Severity: Medium]
This isn't a bug introduced by this patch, but does the driver implement bespoke accessors to share state with child devices?

According to MFD subsystem guidelines, child drivers should access shared resources directly through standard APIs instead of using custom exported accessors.

drivers/mfd/loongson-se.c:loongson_se_init() {
    ...
	struct loongson_se_controller_cmd cmd;
	int err;

	cmd.command_id = SE_CMD_START;
	err = loongson_se_send_controller_cmd(se, &cmd);
    ...
}
drivers/mfd/loongson-se.c:loongson_se_send_controller_cmd() {
    ...
	for (i = 0; i < SE_SEND_CMD_REG_LEN; i++)
		writel(send_cmd[i], se->base + SE_SEND_CMD_REG + i * 4);
    ...
}

[Severity: High]
This isn't a bug introduced by this patch, but is uninitialized stack memory leaked to the device's MMIO registers?

The cmd struct is declared on the stack, but only the command_id is set before the entire structure is copied to device registers via writel().

drivers/mfd/loongson-se.c:loongson_se_probe() {
    ...
	if (device_property_read_u32(dev, "dmam_size", &se->dmam_size))
		return -ENODEV;
    ...
}
drivers/mfd/loongson-se.c:loongson_se_init_engine() {
    ...
	engine->command = se->dmam_base + id * (2 * SE_ENGINE_CMD_SIZE);
    ...
}

[Severity: High]
This isn't a bug introduced by this patch, but can the missing validation of the dmam_size property cause out-of-bounds DMA buffer usage?

The dmam_size is retrieved with no lower-bound validation. A small or incorrect value could result in calculated engine command buffer offsets exceeding the allocated DMA bounds.

drivers/mfd/loongson-se.c:loongson_se_probe() {
    ...
		err = devm_request_irq(dev, irq, se_irq_handler, 0, "loongson-se", se);
		if (err)
			dev_err(dev, "failed to request IRQ: %d\n", irq);
    ...
}

[Severity: High]
This isn't a bug introduced by this patch, but does ignoring devm_request_irq() errors allow the probe to proceed without IRQs, guaranteeing a future thread deadlock?

If the IRQ request fails, the driver logs an error but continues initialization. Later, loongson_se_init() unconditionally blocks on wait_for_completion_interruptible(), which will wait indefinitely without an IRQ handler to signal it.

drivers/mfd/loongson-se.c:loongson_se_send_controller_cmd() {
    ...
	return wait_for_completion_interruptible(&se->cmd_completion);
    ...
}
drivers/mfd/loongson-se.c:loongson_se_send_engine_cmd() {
    ...
	return wait_for_completion_interruptible(&engine->completion);
    ...
}

[Severity: High]
This isn't a bug introduced by this patch, but are commands issued without calling reinit_completion() beforehand?

If a previous command was interrupted by a signal, the internal completion counter remains unconsumed, which could cause a subsequent command to return a premature false-positive success.

drivers/mfd/loongson-se.c:loongson_se_probe() {
    ...
	writel(SE_INT_ALL, se->base + SE_S2LINT_EN);
    ...
}
drivers/mfd/loongson-se.c:se_irq_handler() {
    ...
		id = __ffs(int_status);
		complete(&se->engines[id].completion);
    ...
}

[Severity: High]
This isn't a bug introduced by this patch, but can unhandled hardware interrupt bits crash the kernel via an out-of-bounds array access?

By enabling all 32 interrupt bits with SE_INT_ALL, an interrupt for a bit >= 16 could result in an id >= 16, which would exceed the fixed-size engines array.

drivers/mfd/loongson-se.c:loongson_se_probe() {
    ...
	writel(SE_INT_ALL, se->base + SE_S2LINT_EN);

	nr_irq = platform_irq_count(pdev);
    ...
}
drivers/mfd/loongson-se.c:se_irq_handler() {
    ...
		complete(&se->engines[id].completion);
    ...
}

[Severity: High]
This isn't a bug introduced by this patch, but are hardware interrupts fully enabled before the IRQ handler is registered and engine completions are initialized?

If an early interrupt fires upon being enabled, the handler will dereference an uninitialized completion struct, which could cause a kernel panic when locked.

drivers/mfd/loongson-se.c:loongson_se_probe() {
    ...
	err = loongson_se_init(se, paddr, se->dmam_size);
	if (err)
		return err;
    ...
}
drivers/mfd/loongson-se.c:loongson_se_driver {
    ...
static struct platform_driver loongson_se_driver = {
	.probe   = loongson_se_probe,
	.driver  = {
    ...
}

[Severity: High]
This isn't a bug introduced by this patch, but are hardware interrupts left enabled if the probe function fails or upon module removal?

The probe error paths exit directly without masking the previously enabled hardware interrupts, and the platform driver lacks a .remove callback entirely, which could lead to unhandled interrupt storms.

drivers/mfd/loongson-se.c:loongson_se_poll() {
    ...
	err = readl_relaxed_poll_timeout_atomic(se->base + SE_L2SINT_STAT, status,
						!(status & int_bit),
						1, LOONGSON_ENGINE_CMD_TIMEOUT_US);
    ...
}

[Severity: Medium]
This isn't a bug introduced by this patch, but does the polling loop hold a spinlock with interrupts disabled for up to 10 milliseconds?

Polling atomically for 10ms violates kernel guidelines for latency and can starve other critical tasks.

drivers/mfd/loongson-se.c:loongson_se_probe() {
    ...
	dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
    ...
}

[Severity: Medium]
This isn't a bug introduced by this patch, but is the return value of dma_set_mask_and_coherent() ignored?

If the platform does not support the requested 64-bit mask, the driver will proceed with allocation assuming success, which could lead to DMA failures or IOMMU faults.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
#52 lore raw

Re: [PATCH v2 21/23] mfd: Unify style of of_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Inconsistencies between the commit message's stated formatting rules and the actual modifications…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Inconsistencies between the commit message's stated formatting rules and the actual modifications in several files. --

--- Patch [21]: [PATCH v2 21/23] mfd: Unify style of of_device_id arrays --- commit 38160e259bf192b6d1cf5cbe5c20b7b81df1f0bc
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: Unify style of of_device_id arrays

This commit unifies the coding style of of_device_id arrays across multiple MFD drivers. It aims to ensure consistent spacing, comma placement, and terminator formatting as specified in the commit message.

Quoted 3 lines
drivers/mfd/stmpe-i2c.c +0 -0

[ ... ]

Quoted 1 line

static const struct of_device_id stmpe_of_match[] = {

[ ... ]

drivers/mfd/stmpe-i2c.c static struct stmpe_client_info i2c_ci = { · line 63

Quoted 6 lines
drivers/mfd/stmpe-i2c.c +2 -4
-	{ .compatible = "st,stmpe1801", .data = (void *)STMPE1801, },
-	{ .compatible = "st,stmpe2401", .data = (void *)STMPE2401, },
-	{ .compatible = "st,stmpe2403", .data = (void *)STMPE2403, },
-	{},
+	{ .compatible = "st,stmpe1801", .data = (void *)STMPE1801 },
+	{ .compatible = "st,stmpe2401", .data = (void *)STMPE2401},

[Severity: Low]
This isn't a bug, but does this entry miss the required space before the closing brace? The commit message mentions adding a space before a closing brace as part of the style unification.

Quoted 8 lines
drivers/mfd/stmpe-i2c.c +2 -0
+	{ .compatible = "st,stmpe2403", .data = (void *)STMPE2403 },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, stmpe_of_match);
drivers/mfd/tps6507x.c +0 -0

[ ... ]

drivers/mfd/tps6507x.c MODULE_DEVICE_TABLE(i2c, tps6507x_i2c_id); · line 114

Quoted 6 lines

#ifdef CONFIG_OF
static const struct of_device_id tps6507x_of_match[] = {

drivers/mfd/tps6507x.c +2 -2
-	{.compatible = "ti,tps6507x", },
-	{},
+	{ .compatible = "ti,tps6507x" },
+	{}

[Severity: Low]
This isn't a bug, but should this list terminator have a single space inside? The commit message notes a rule for using a single space in the list terminator.

Quoted 7 lines

};
MODULE_DEVICE_TABLE(of, tps6507x_of_match);
#endif

drivers/mfd/tps6594-i2c.c +0 -0

[ ... ]

drivers/mfd/tps6594-i2c.c static struct regmap_config tps6594_i2c_regmap_config = { · line 202

Quoted 10 lines

static const struct of_device_id tps6594_i2c_of_match_table[] = {

drivers/mfd/tps6594-i2c.c +3 -6
-	{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, },
-	{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, },
-	{ .compatible = "ti,lp8764-q1",  .data = (void *)LP8764,  },
-	{ .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, },
-	{ .compatible = "ti,tps652g1", .data = (void *)TPS652G1, },
-	{}
+	{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594 },
+	{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593 },
+	{ .compatible = "ti,lp8764-q1", .data = (void *)LP8764  },

[Severity: Low]
This isn't a bug, but are there two spaces before the closing brace on the lp8764-q1 line? It looks like this might have been missed during the cleanup to ensure a single space before the closing brace.

Quoted 8 lines
drivers/mfd/tps6594-i2c.c +3 -0
+	{ .compatible = "ti,tps65224-q1", .data = (void *)TPS65224 },
+	{ .compatible = "ti,tps652g1", .data = (void *)TPS652G1 },
+	{ }
 };
drivers/mfd/tps6594-spi.c +0 -0

[ ... ]

drivers/mfd/tps6594-spi.c

Quoted 10 lines

static const struct of_device_id tps6594_spi_of_match_table[] = {

drivers/mfd/tps6594-spi.c +3 -6
-	{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594, },
-	{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593, },
-	{ .compatible = "ti,lp8764-q1",  .data = (void *)LP8764,  },
-	{ .compatible = "ti,tps65224-q1", .data = (void *)TPS65224, },
-	{ .compatible = "ti,tps652g1", .data = (void *)TPS652G1, },
-	{}
+	{ .compatible = "ti,tps6594-q1", .data = (void *)TPS6594 },
+	{ .compatible = "ti,tps6593-q1", .data = (void *)TPS6593 },
+	{ .compatible = "ti,lp8764-q1", .data = (void *)LP8764  },

[Severity: Low]
This isn't a bug, but could we also reduce the double spacing before the closing brace on this line to match the intended single-space style?

Quoted 4 lines
drivers/mfd/tps6594-spi.c +3 -0
+	{ .compatible = "ti,tps65224-q1", .data = (void *)TPS65224 },
+	{ .compatible = "ti,tps652g1", .data = (void *)TPS652G1 },
+	{ }
 };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=21
#61 lore raw
In reply to Uwe Kleine-König (The Capable Hub)
Quoted 20 lines · Uwe Kleine-König (The Capable Hub)

Hello,

this series superseeds my previous patch "[PATCH v1] mfd: Use named initializers for arrays of i2c_device_data"
(https://lore.kernel.org/lkml/[email protected])
that Lee asked me to rebase and also the series "[PATCH v1 0/3] mfd:
Initialize spi_device_id arrays using member names"
(https://lore.kernel.org/lkml/[email protected]).

The objective for this series is to prepare mfd for changing of_device_id etc to make driver_data a union, see
https://lore.kernel.org/all/[email protected]/
for the idea behind it.

This series is based on yesterday's next/master and it does the restructuring not only for i2c and spi (as the two series mentioned above), but for all *_device_id structures that I intend to modify with a union that affect mfd. So (I hope) this is the only patch series affecting mfd for this quest.

Quoted 3 lines

I don't care much about the last few patches unifying the coding style. I think it's a good opportunity to do that, but if you don't like them, just don't apply these.

The patches bring inconsistency (or still leave it) with the terminator style in both I²C and ACPI ID tables. Can you revisit that?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#49 lore raw

Re: [PATCH v2 20/23] mfd: Unify style of i2c_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Thank you for your contribution! Sashiko AI review found 5 potential issue(s) to consider:

Thank you for your contribution! Sashiko AI review found 5 potential issue(s) to consider:

Pre-existing issues:
- [High] Shallow copying of the entire parent context via platform_data in wm8400_register_codec.
- [High] Potential NULL pointer dereference of I2C device ID during probe.
- [Medium] Local/stack-allocated mfd_cell structure in wm8400_register_codec.
- [Medium] Dynamic amendment of mfd_cell arrays in si476x_core_probe.
- [Medium] Manual cell ID mapping instead of using PLATFORM_DEVID_AUTO in si476x_core_probe. --

--- Patch [20]: [PATCH v2 20/23] mfd: Unify style of i2c_device_id arrays --- commit 6a5d15234f3fcc68bbda3db02225f521d1961fe2
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: Unify style of i2c_device_id arrays

Most of these arrays already mostly match the most used and generally recommended coding style. That is:
- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Quoted 4 lines
drivers/mfd/si476x-i2c.c +0 -0
index f25a4b60071bf..30e545cd08896 100644

[ ... ]

drivers/mfd/si476x-i2c.c static const struct i2c_device_id si476x_id[] = { · line 849

Quoted 8 lines
drivers/mfd/si476x-i2c.c +1 -1
@@ -844,7 +844,7 @@ static const struct i2c_device_id si476x_id[] = {
 	{ .name = "si4761", .driver_data = SI476X_CHIP_SI4761 },
 	{ .name = "si4764", .driver_data = SI476X_CHIP_SI4764 },
 	{ .name = "si4768", .driver_data = SI476X_CHIP_SI4768 },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(i2c, si476x_id);

[Severity: High]
This is a pre-existing issue, but since we are looking at this driver, could a user-space process force-binding the driver trigger a NULL dereference?

In si476x_core_probe(), the driver immediately dereferences the ID without checking if it is NULL:

si476x-i2c.c:si476x_core_probe() {
    ...
    const struct i2c_device_id *id = i2c_client_get_device_id(client);
    ...
    core->chip_id = id->driver_data;
    ...
}

If force-bound to a device using sysfs (e.g. driver_override), i2c_client_get_device_id() will return NULL, causing a panic.

[Severity: Medium]
This isn't a bug introduced by this patch, but does the dynamic amendment of the mfd_cell array in si476x_core_probe() violate MFD subsystem guidelines?

si476x-i2c.c:si476x_core_probe() {
    ...
    cell = &core->cells[SI476X_RADIO_CELL];
    cell->name = "si476x-radio";
    ...
}

The guidelines state: "Define mfd_cell arrays as static const. For mfd_cells, do not create local copies for dynamic amendments; always use static references."

[Severity: Medium]
This is also a pre-existing issue, but is it safe to use a manually calculated cell ID in si476x_core_probe()?

si476x-i2c.c:si476x_core_probe() {
    ...
    err = mfd_add_devices(&client->dev,
                          (client->adapter->nr << 8) + client->addr,
                          core->cells, cell_num,
                          ...);
    ...
}

The MFD guidelines recommend using PLATFORM_DEVID_AUTO instead of hard-coded or mathematically mapped IDs, as they can lead to device naming collisions in sysfs.

Quoted 4 lines
drivers/mfd/tps65910.c +0 -0
index b0dbee3e6ea2f..d19bd3643591e 100644

[ ... ]

drivers/mfd/tps65910.c static int tps65910_i2c_probe(struct i2c_client *i2c) · line 538

Quoted 11 lines
drivers/mfd/tps65910.c +3 -3
@@ -532,9 +532,9 @@ static int tps65910_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id tps65910_i2c_id[] = {
-       { .name = "tps65910", .driver_data = TPS65910 },
-       { .name = "tps65911", .driver_data = TPS65911 },
-       { }
+	{ .name = "tps65910", .driver_data = TPS65910 },
+	{ .name = "tps65911", .driver_data = TPS65911 },
+	{ }
 };

[Severity: High]
This is a pre-existing issue, but does tps65910_i2c_probe() have the same potential NULL pointer dereference risk?

tps65910.c:tps65910_i2c_probe() {
    ...
    const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
    ...
    unsigned long chip_id = id->driver_data;
    ...
}

If a privileged user force-binds the driver via sysfs, id will be NULL, which results in an immediate crash upon dereference.

Quoted 4 lines
drivers/mfd/wm8400-core.c +0 -0
index 1c0ba450ef9b6..d3180aa44e1a1 100644

[ ... ]

drivers/mfd/wm8400-core.c static int wm8400_i2c_probe(struct i2c_client *i2c) · line 140

Quoted 9 lines
drivers/mfd/wm8400-core.c +2 -2
@@ -135,8 +135,8 @@ static int wm8400_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct i2c_device_id wm8400_i2c_id[] = {
-       { .name = "wm8400" },
-       { }
+	{ .name = "wm8400" },
+	{ }
 };

[Severity: High]
This isn't a bug introduced by this patch, but does the shallow copying of the entire parent context via platform_data in wm8400_register_codec() pose a memory safety hazard?

wm8400-core.c:wm8400_register_codec() {
    ...
    const struct mfd_cell cell = {
        .name = "wm8400-codec",
        .platform_data = wm8400,
        .pdata_size = sizeof(*wm8400),
    };
    ...
}

By passing the entire parent struct wm8400 by value, mfd_add_devices() copies the embedded structures (like struct device, containing kobject and mutex). Duplicating embedded struct devices by value usually leads to duplicate locks and undefined behavior. MFD rules require child drivers to retrieve parent data using standard APIs like dev_get_drvdata(pdev->dev.parent) instead.

[Severity: Medium]
This is also a pre-existing issue, but does the stack-allocated local mfd_cell in wm8400_register_codec() violate MFD guidelines?

wm8400-core.c:wm8400_register_codec() {
    ...
    const struct mfd_cell cell = {
        .name = "wm8400-codec",
        ...
    };
    ...
}

The MFD guidelines require that mfd_cell arrays are defined as static const, and explicitly state not to create local copies for dynamic amendments.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=20
maintainer Reviewed-by on v2 11/23
#24 lore raw

Re: [PATCH v2 11/23] mfd: Use named initializers for acpi_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 8 lines · Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct acpi_device_id that replaces .driver_data by an anonymous union.

Quoted 6 lines

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

---
 drivers/mfd/cs42l43-i2c.c             |  4 +-

Thanks,
Charles

maintainer Reviewed-by on v2 13/23
#29 lore raw

Re: [PATCH v2 13/23] mfd: Use named initializers for arrays of i2c_device_id

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 12 lines · Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct i2c_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

Quoted 8 lines
---
 drivers/mfd/arizona-i2c.c        | 12 ++++++------
 drivers/mfd/cs40l50-i2c.c        |  2 +-
 drivers/mfd/madera-i2c.c         | 18 +++++++++---------
 drivers/mfd/wm831x-i2c.c         | 14 +++++++-------
 drivers/mfd/wm8350-i2c.c         |  6 +++---
 drivers/mfd/wm8400-core.c        |  2 +-
 drivers/mfd/wm8994-core.c        |  8 ++++----

Thanks,
Charles

maintainer Reviewed-by on v2 17/23
#41 lore raw

Re: [PATCH v2 17/23] mfd: Use named initializers for arrays of spi_device_id

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 11 lines · Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct spi_device_id that replaces .driver_data by an anonymous union.

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

Quoted 6 lines
---
 drivers/mfd/arizona-spi.c       | 10 +++++-----
 drivers/mfd/cs40l50-spi.c       |  2 +-
 drivers/mfd/madera-spi.c        | 18 +++++++++---------
 drivers/mfd/wm831x-spi.c        | 14 +++++++-------

Thanks,
Charles

maintainer Reviewed-by on v2 18/23
#45 lore raw

Re: [PATCH v2 18/23] mfd: Unify style of acpi_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 10 lines · Uwe Kleine-König (The Capable Hub)

Update the various acpi_device_id arrays to conform to the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Quoted 5 lines

Adapt the few offenders accordingly.

---
 drivers/mfd/cs42l43-i2c.c             | 2 +-

Thanks,
Charles

maintainer Reviewed-by on v2 20/23
#50 lore raw

Re: [PATCH v2 20/23] mfd: Unify style of i2c_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 10 lines · Uwe Kleine-König (The Capable Hub)

Most of these arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Quoted 7 lines

Adapt the few offenders accordingly and also use tabs for indention for two drivers.

---
 drivers/mfd/cs40l50-i2c.c   | 2 +-
 drivers/mfd/wm8400-core.c   | 4 ++--

Thanks,
Charles

maintainer Reviewed-by on v2 21/23
#53 lore raw

Re: [PATCH v2 21/23] mfd: Unify style of of_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 13 lines · Uwe Kleine-König (The Capable Hub)

These arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Adapt the offenders accordingly.

Quoted 9 lines
---
 drivers/mfd/arizona-i2c.c      |  2 +-
 drivers/mfd/arizona-spi.c      |  2 +-
 drivers/mfd/cs40l50-i2c.c      |  2 +-
 drivers/mfd/cs40l50-spi.c      |  2 +-
 drivers/mfd/cs42l43-i2c.c      |  2 +-
 drivers/mfd/lochnagar-i2c.c    |  2 +-
 drivers/mfd/madera-core.c      |  2 +-
 drivers/mfd/wm831x-core.c      |  2 +-

Thanks,
Charles

maintainer Reviewed-by on v2 23/23
#60 lore raw

Re: [PATCH v2 23/23] mfd: Unify style of spi_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 10 lines · Uwe Kleine-König (The Capable Hub)

These arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Quoted 7 lines

Adapt the offenders accordingly.

---
 drivers/mfd/arizona-spi.c     | 2 +-
 drivers/mfd/cs40l50-spi.c     | 2 +-
 drivers/mfd/wm831x-spi.c      | 2 +-

Thanks,
Charles

maintainer Reviewed-by on v2 13/23
#30 lore raw

Re: [PATCH v2 13/23] mfd: Use named initializers for arrays of i2c_device_id

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 8 lines · Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct i2c_device_id that replaces .driver_data by an anonymous union.

Quoted 6 lines

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

---
 drivers/mfd/max77759.c           |  2 +-

maintainer Reviewed-by on v2 21/23
#54 lore raw

Re: [PATCH v2 21/23] mfd: Unify style of of_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 10 lines · Uwe Kleine-König (The Capable Hub)

These arrays already mostly match the most used and generally recommended coding style. That is:

 - no comma after the list terminator;
 - a comma after an initializer if (and only if) the closing } is not directly following;
 - no explicit zeros in the list terminator;
 - a space after an opening { and before a closing }, a single space in the list terminator;

Quoted 5 lines

Adapt the offenders accordingly.

---
 drivers/mfd/max77759.c         |  2 +-

#35 lore raw

Re: [PATCH v2 15/23] mfd: Use PCI_DEVICE* macros to initialize pci_device_id arrays

In reply to [email protected]
Quoted 13 lines · On Wed, Jul 08, 2026 at 11:27:22AM +0000, [email protected] wrote:

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Non-standard commit message prefix omitting the driver name.
--

--- Patch [15]: [PATCH v2 15/23] mfd: Use PCI_DEVICE* macros to initialize pci_device_id arrays --- commit 01daeb728dc1ab5baf28174c28473f068ecb03ae
Author: Uwe Kleine-König (The Capable Hub) <[email protected]>

mfd: Use PCI_DEVICE* macros to initialize pci_device_id arrays

pci_device_id entries are usually initialized using these PCI_DEVICE* macros. Adapt to this more usual style.

Quoted 7 lines
Quoted 1 line

mfd: Use PCI_DEVICE* macros to initialize pci_device_id arrays

[Severity: Low]
This isn't a bug, but does this commit message subject violate the MFD subsystem guidelines? The guidelines require the prefix to follow the format "mfd: <Driver>: <Capitalized description>". The driver name appears to be missing from the subject line.

The patch adapts two drivers. I guess mentioning both in the shortlog isn't the right thing to do?

Best regards
Uwe

#62 lore raw
In reply to Andy Shevchenko

Hello,

Quoted 21 lines · Andy Shevchenko
Quoted 20 lines · Uwe Kleine-König (The Capable Hub)

Hello,

this series superseeds my previous patch "[PATCH v1] mfd: Use named initializers for arrays of i2c_device_data"
(https://lore.kernel.org/lkml/[email protected])
that Lee asked me to rebase and also the series "[PATCH v1 0/3] mfd:
Initialize spi_device_id arrays using member names"
(https://lore.kernel.org/lkml/[email protected]).

The objective for this series is to prepare mfd for changing of_device_id etc to make driver_data a union, see
https://lore.kernel.org/all/[email protected]/
for the idea behind it.

This series is based on yesterday's next/master and it does the restructuring not only for i2c and spi (as the two series mentioned above), but for all *_device_id structures that I intend to modify with a union that affect mfd. So (I hope) this is the only patch series affecting mfd for this quest.

Quoted 6 lines
Quoted 3 lines

I don't care much about the last few patches unifying the coding style. I think it's a good opportunity to do that, but if you don't like them, just don't apply these.

The patches bring inconsistency (or still leave it) with the terminator style in both I²C and ACPI ID tables. Can you revisit that?

I found a few inconstencies for of_device_id, but not for acpi and i2c. I have a script for the acpi and i2c (and now also for the of) changes and don't spot inconsistencys in the terminator style for acpi and i2c devices apart from comments.

(I looked at the output of:

	git grep -lE '(i2c|acpi)_device_id [a-z0-9_]*\[\]' drivers/mfd | xargs -r sed -rn '/(i2c|acpi)_device_id [a-zA-Z0-9_]*\[/,/^};/p' | grep -B1 ^\} | sort | uniq -c

)

Do you mean to unify the comments, too?

Best regards
Uwe

maintainer Reviewed-by on v2 16/23
#38 lore raw

Re: [PATCH v2 16/23] mfd: Use named initializers for platform_device_id array

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 8 lines · Uwe Kleine-König (The Capable Hub)

While being less compact, using named initializers allows to more easily see which members of the structs are assigned which value without having to lookup the declaration of the struct. And it's also more robust against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct platform_device_id that replaces .driver_data by an anonymous union.

Quoted 7 lines

This patch doesn't modify the compiled arrays, only their representation in source form benefits.

Also drop a tailing comma after a list terminator to match the common style for these device-id arrays.

Yours,
Linus Walleij

#3 lore raw

Re: [PATCH v2 01/23] mfd: bcm2835-pm: Remove member of struct bcm2835_pm that is only used locally

In reply to Uwe Kleine-König (The Capable Hub)

Hi Uwe,

Quoted 5 lines · Uwe Kleine-König (The Capable Hub)

struct bcm2835_pm::soc is only used in bcm2835_pm_probe() and thus can be replaced by a local variable.

With that change enum bcm2835_soc is only used in the mfd core driver and so the definition can move there.

The original idea was to re-use bcm2835_pm::soc field in bcm2835-power.c pmdomain driver where we implicitly decide which DOMAIN_GRAFX_V3D register to use (see commit d4aa5960025a "pmdomain: bcm: bcm2835-power:
Prepare to support BCM2712"). So, instead of !power->asb the intention is to use bcm2835_pm::soc == BCM2835_PM_SOC_BCM2712.

Please drop this patch from the series. I'll post a patch soon.

regards,
~Stan

maintainer Reviewed-by on v2 21/23
#55 lore raw

Re: [PATCH v2 21/23] mfd: Unify style of of_device_id arrays

In reply to Uwe Kleine-König (The Capable Hub)
Quoted 10 lines · Uwe Kleine-König (The Capable Hub)

These arrays already mostly match the most used and generally recommended coding style. That is:

- no comma after the list terminator;
- a comma after an initializer if (and only if) the closing } is not directly following;
- no explicit zeros in the list terminator;
- a space after an opening { and before a closing }, a single space in the list terminator;

Quoted 3 lines

Adapt the offenders accordingly.

Yours,
Linus Walleij