From nobody Mon Jun 8 07:29:46 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A860B3DC87B for ; Thu, 4 Jun 2026 20:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780606539; cv=none; b=kJqsA9yabJpl1LN+sxfPyZmXcNB9se5fnRGnTF93yOqbR7s4wSgsFlqDZ2jOSVTDP832MxcEq+kSTQ0jRBtqupIb83ZHpEepEmrTFi68QBGX0PvqwNSe9y0LgGyy9vuQkOo5wY+YBKGvlEaMFl4Zu/uZE/Y17u6NY5fPHELWgdU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780606539; c=relaxed/simple; bh=ea7cuzjVH8l4WaNc0d4fbb0kmTQLbO6kPFR9OFprAfk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=F+YuRle5sW7QnsP953KsD3C3Eqrn+lBYZ4ixfkOq+Rt/9SpvEylTXIDEbQ9EWZb/xgNS8jE+VEelTyItys0HDlgozowT7Iqhb43TuTYtfM2iJ1ArKiyElNrCOcwmSAwaUdpKIU8ZIyckcnR3ZYyEQRy+gODJeiyYgc5nFQsgAyI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=lVLAylAy; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="lVLAylAy" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-490be29c1c5so14869735e9.2 for ; Thu, 04 Jun 2026 13:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1780606535; x=1781211335; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+NJl+VOtJmF26AH7Q6wbNKM2etWMSqxxrEhElEZ90kc=; b=lVLAylAyaUuctwWwXM7IxqzBTSZ9VAsUppIvBLn5lK+m1KKmirK1ZXhHjk3esUF8zv JQ7YxFbiMuJuY5c9n+0H4G0+H4FWONRJh4h66ePYi+kpxzDj0LgqrDIekF9dPieZDjDe dKLLVs+1X6kRgoFanWNJpT9y2BHtIxF8DC+zjE+ezbnROGhg1g94pRdhI61YzozJMaVP sVRNQpoJpd8BbdEdbkrAkFjESeGdyH5yfAbDPlVTe9H6RlAIRNZLIPl5947iVgdeD2Er eK586pkpWIjJP5zKVH5+lO3VPFzTTswg0PD2blRoz7jDMP1Pxgpf1PeesrPQBrOD3heB IGCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780606535; x=1781211335; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+NJl+VOtJmF26AH7Q6wbNKM2etWMSqxxrEhElEZ90kc=; b=TofZFwLJSID6mjcX9Zpc+/BCuwlAqUDk9XHj7fEyp1/QgBLXDp2juKeWwVQaInhaNm UWs75hJjHGnv4UF+9AWXc47QIxpnF15CSb5/AaTKI39VI++eGnA8bCP47gK9DQB+PRUi rgLPv8n1akFLi4LvISrOzvoF2ZL24S8cXVNjrcq4lK+LaRxFv8fjy6GmIpde8mBJ4DDF QdcgNEZy1lm60c9oQG3X3vkB7op3h+NHcBZJaVHto+lZAs//z+siZcambdFUvXJTlM0C XNTCmOiR+K4/Xeh91nE/XZDC2CgBE8t5KRd9KalDIWPsbJkBc54eu6CCxmQFX+rYOeyC NvFQ== X-Forwarded-Encrypted: i=1; AFNElJ+TyvKG+Ve8oYPRonRRgAfHHetX1/Uvl4w+2TOuy6rlZ3dLIOpJIY0qxppz97LOCo5NFOPlpLuyxbF2DQA=@vger.kernel.org X-Gm-Message-State: AOJu0YzjKB4etKvTSMowcLdOyhOmdBPoeJbfXlFsGQZ2VAJleJS2yKL+ 9BQSnGBsk3P49l4Jsa7iW8anxZNX4jBVJQQuwbLY6UXejwIJKePwI5w1rfPyvMCG4Rs= X-Gm-Gg: Acq92OG15XTh+ctY1ZtGs1NkQ9QmNB1O4pzcmizHfLB8UfbYi/5OBErQyRYNsd+5wUB xfYP360jch0sGy9dzwmrhPO3NgraN1ts/1M4WeW+wxUPyO+LoWwB4lbPwCDXtq1kggaxEw9/sCD gRs1YH+p2Sbu8qPhqc3mEm/0JfSQKkUXQJ9lOYnt5GL/c1qsDDUBZkVSD9EOEA8hduzYbWRnhTI KG8YxsCbTZ1P9Bbgdp713dNg1sYUvbafzlnObrCJpOkJGAlcaEe7knwRJcZXjVEMUnPHyc7On/W Gv85HbMlrpPgox/Yx4dTBMbHaTxIX5eIxNTLsnZ7V9eWdwINL830Ph4P4qtqJMv5+C+TTdcEJ24 e4WheMrk6zYQJatozmJEBq947qBzg/Be9xH9c3eui0c46S8FvPxQgHRANwZv5/1kfQVmXu4BjYL BiKcHv7uagpLG05c8/WNG4DyQnYZ/eNTFDYDZ4olft3HLMo3+mcHgTAPoi2L/eKtrUe/MuWRt2+ QbQDMIrYrA= X-Received: by 2002:a05:600c:8b83:b0:490:b106:4fe8 with SMTP id 5b1f17b1804b1-490c25e268dmr4427955e9.33.1780606534635; Thu, 04 Jun 2026 13:55:34 -0700 (PDT) Received: from localhost (cust-east-par-46-193-69-147.cust.wifirst.net. [46.193.69.147]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-4601f345209sm19050059f8f.17.2026.06.04.13.55.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2026 13:55:34 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Mark Brown Cc: Jonas Gorski , David Rhodes , Richard Fitzgerald , Andi Shyti , Tudor Ambarus , Krzysztof Kozlowski , Peter Griffin , Alim Akhtar , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1] spi: Use named initializers for platform_device_id arrays Date: Thu, 4 Jun 2026 22:55:26 +0200 Message-ID: <3fcd432a505bb1bb7f8ef0fba9162243200b3347.1780606153.git.u.kleine-koenig@baylibre.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=4127; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=ea7cuzjVH8l4WaNc0d4fbb0kmTQLbO6kPFR9OFprAfk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqIeY+OnML+6BoYUWkNCcBW4CCesKWtAUwtH7M1 CmI8V/tdnuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCaiHmPgAKCRCPgPtYfRL+ ToUeB/9Ds3iuojuAku3iJ0znnvPHYZeMZmNwhkINjPq7CaINJ7JSSTyEpswyNm8rlz0f3IVltgG X9FN32hGno1eod3IWEdXziUvimgNDfm+qys7MJ19RMbC6O9cM0qWH6C9itsGBh65JGITdDOy1BT rq/uQnuBCGD3Jtmj40WqMfGiAyWwFXPTlg6bKMl6D50jYoQRL6GtCnS7jwJiF3jazUVHOmWkbKR aOUfXFLmbLIUxNMXk7A1eK9qDN7j6YP1DwbM8tPr7aDcibwnH4SQtyO/44gnPf9NNktZivcxQMu RDWOo7FyPzJwfsbv35FnUs3qqloZfoa2bHv7I7dqpjHrMANr X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable Named initializers are better readable and more robust to changes of the struct definition. This robustness is relevant for a planned change to struct platform_device_id replacing .driver_data by an anonymous union. While touching these arrays unify spacing and usage of commas. Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) --- Hello, see e.g. https://lore.kernel.org/all/cover.1779893336.git.u.kleine-koenig@baylibre.c= om/ for details about my quest to modify platform_device_id. Best regards Uwe drivers/spi/spi-altera-platform.c | 4 ++-- drivers/spi/spi-bcm63xx.c | 3 +-- drivers/spi/spi-cs42l43.c | 4 ++-- drivers/spi/spi-rspi.c | 4 ++-- drivers/spi/spi-s3c64xx.c | 6 +++--- drivers/spi/spi-sh-msiof.c | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/spi/spi-altera-platform.c b/drivers/spi/spi-altera-pla= tform.c index 3ee5d3480bb4..3de7df73f216 100644 --- a/drivers/spi/spi-altera-platform.c +++ b/drivers/spi/spi-altera-platform.c @@ -139,8 +139,8 @@ MODULE_DEVICE_TABLE(of, altera_spi_match); #endif /* CONFIG_OF */ =20 static const struct platform_device_id altera_spi_ids[] =3D { - { DRV_NAME, ALTERA_SPI_TYPE_UNKNOWN }, - { "subdev_spi_altera", ALTERA_SPI_TYPE_SUBDEV }, + { .name =3D DRV_NAME, .driver_data =3D ALTERA_SPI_TYPE_UNKNOWN }, + { .name =3D "subdev_spi_altera", .driver_data =3D ALTERA_SPI_TYPE_SUBDEV = }, { } }; MODULE_DEVICE_TABLE(platform, altera_spi_ids); diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index f8cfe535b2a3..43d7b54e3ae8 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c @@ -477,8 +477,7 @@ static const struct platform_device_id bcm63xx_spi_dev_= match[] =3D { .name =3D "bcm6358-spi", .driver_data =3D (unsigned long)bcm6358_spi_reg_offsets, }, - { - }, + { } }; MODULE_DEVICE_TABLE(platform, bcm63xx_spi_dev_match); =20 diff --git a/drivers/spi/spi-cs42l43.c b/drivers/spi/spi-cs42l43.c index 68f208ef1e01..6961e36b89d1 100644 --- a/drivers/spi/spi-cs42l43.c +++ b/drivers/spi/spi-cs42l43.c @@ -438,8 +438,8 @@ static int cs42l43_spi_probe(struct platform_device *pd= ev) } =20 static const struct platform_device_id cs42l43_spi_id_table[] =3D { - { "cs42l43-spi", }, - {} + { .name =3D "cs42l43-spi" }, + { } }; MODULE_DEVICE_TABLE(platform, cs42l43_spi_id_table); =20 diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index a0c77e02bc90..38df676774ee 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -1377,8 +1377,8 @@ static int rspi_probe(struct platform_device *pdev) } =20 static const struct platform_device_id spi_driver_ids[] =3D { - { "rspi", (kernel_ulong_t)&rspi_ops }, - {}, + { .name =3D "rspi", .driver_data =3D (kernel_ulong_t)&rspi_ops }, + { } }; =20 MODULE_DEVICE_TABLE(platform, spi_driver_ids); diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 37176e557099..28c56b06fa99 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1613,10 +1613,10 @@ static const struct s3c64xx_spi_port_config gs101_s= pi_port_config =3D { =20 static const struct platform_device_id s3c64xx_spi_driver_ids[] =3D { { - .name =3D "s3c6410-spi", - .driver_data =3D (kernel_ulong_t)&s3c6410_spi_port_config, + .name =3D "s3c6410-spi", + .driver_data =3D (kernel_ulong_t)&s3c6410_spi_port_config, }, - { }, + { } }; MODULE_DEVICE_TABLE(platform, s3c64xx_spi_driver_ids); =20 diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c index 070e16bc764f..f23db85a1889 100644 --- a/drivers/spi/spi-sh-msiof.c +++ b/drivers/spi/spi-sh-msiof.c @@ -1310,8 +1310,8 @@ static void sh_msiof_spi_remove(struct platform_devic= e *pdev) } =20 static const struct platform_device_id spi_driver_ids[] =3D { - { "spi_sh_msiof", (kernel_ulong_t)&sh_data }, - {}, + { .name =3D "spi_sh_msiof", .driver_data =3D (kernel_ulong_t)&sh_data }, + { } }; MODULE_DEVICE_TABLE(platform, spi_driver_ids); =20 base-commit: a225caacc36546a09586e3ece36c0313146e7da9 --=20 2.47.3