From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 052C833BBBA for ; Tue, 19 May 2026 15:54:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779206048; cv=none; b=kF89/fQ0X/HKgUlacuIh4hYgIW6tml+7YGr3ST3a1WblFXiqvzXoRLdO3ObgV4HoyEZUzj6rwVly7pxvtnnGWiC/CJWFFv1VJSyP0/72YIEMdECvUWb2yqFpV5VbTArdWwlIBjVLutG/JPORRgHU9WyZrhk9FFs8oIvWnsCD/Qw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779206048; c=relaxed/simple; bh=OVioMqoIu+9ktI4bVQpNMxvUoCyEeEFsFhAP4FJ5Edw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=naillNQ7paWmLhXClwkKuvGYkQ6AkAO3AWgUGBz+PSuE5ehqLbX2JrrxiExONsVTZjabB54asATvN/zxZfgXYdFZjn+lllnjjUom7cXIY3WUxQVx0zqi38gvZHyvUeNc89CCW0eAnroozIvAQraNAb5Z3JcD+iLc2iMpswc8tQ4= 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=gclc7VPX; arc=none smtp.client-ip=209.85.128.54 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="gclc7VPX" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-48fde648a71so27653745e9.0 for ; Tue, 19 May 2026 08:54:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1779206043; x=1779810843; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=PPI0LbBQbs0i1qcRKAFHdtQON78QLzqTLAB/hEHcKJE=; b=gclc7VPXiXvpNRYY8VYWNpkknf4Z7ldYX/HJ5uiurHCiPvBYUW8CJtiSrLbgHsG52L ke3BPhkr1vXyZMt78Zj/zbmzcw7YfaJDKGvazDjc15vGZTGpUWPL/7mMevHsa8+TVxKG ciOckXcxXvtUZW7HIfbZefO6FkV5F6PVpx5oGU1ktMZDY6Kbvp4ZfP4xbx/wCGUmF6fc v1U9+bcqApzn1aLls1YsRpXG7O+c+by4MLNzbDkFY/+vymlSG+KQ/pGxMfGXF3nx5z9v nMLt4yQSTMGhqrqVj2nT8c0zNs53CL66k4kj4ZxTo9X84rH2Bh7T9/wioXR8YG7+5UTz kfFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779206043; x=1779810843; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PPI0LbBQbs0i1qcRKAFHdtQON78QLzqTLAB/hEHcKJE=; b=jS8W7c8pTOBWTHrQrrCHCr+fqRWSsuEWT/+lSQrK725LVDzIo0i46nLuo9v8d4UDZL 061MN58bJ59q35Xx809gqcUGikojQioWuAO5BwNq3caX4C8m/sqQ+w+0zN7u+UnJd5rU +86XGmaLaVifPKOOXLgLJ+ZQRNM3kJOnZP8ABy1HUChIKiox2Mej0Q7Q9N9qw5MuD6UR d32jrAcKEKk/ilPZf6aTPb33+XJZAUoTCtF1Rr4l3FBgGhxv3D9XezPtFMWwpGciPfd0 WNsDF2K7I22bdSoHwtMeLZ6IcPL3IRtTpYp4HTyusOgOHwD50RTgY4Z5YWHj0YIccEcv WyRw== X-Forwarded-Encrypted: i=1; AFNElJ9G7qg/juWGhtFVImacRL887vqaBesYNbYH2K+g2VdF916SX8x1mL4ZiUHHtuvQZEELuh/OZkquojLMxx4=@vger.kernel.org X-Gm-Message-State: AOJu0YwT8VWoIeQzaIM938qiVc521t2niU8SppbXX398EVasLJcX67S9 Xu53i0WeO9zN0p4p2LNrw9+6TPsQgy9gu4v22CbMXaDQero16M1amzoSxflEDGN9BZRuNSn5usd Qc00IzsM= X-Gm-Gg: Acq92OE1PmrtqpRcgzN7hEtmgL3Ccx9BsFWHx6fSmPRHi1/NrNnbYCS7oPYlLZ0SKnA 0StBuHplvemm/bxZuPuotRXAyjr/U4gXX6hDtM7MCsQkwZOudxaF8kRxtt7JDndfoDlhTbB2x2k 8F87eQB/5mYk6kOD0J1kz88K5Z8EQ5C7sZEqbcS03QcidmaISbySLGg2QRAAExZFvrhV0KmzE7s Nt0KNL8VsqsOpn+ObAv6pKxBiGF3Ts0U+79iDaiYfkaPBdCp4mqhswgqfniRJjVIqafy+7LxhY2 FNzytkx6IviUvyNdfHOJ3s8vWXcxT8XjblSONbWzLHqjn92HpSlHo8KD0FazRrcnAIUq6SJnKHi DWOXEMzG98RgD05p80Jd0yjXpSkdLAUm0HArR9HK4XbSv+dkg2Wp6heAUp2hMBPkmsjjdoXMJBY CyW3ZGvAxNdamUb+Ou1084T4gDOU1ntYf2i3j7aMgRLmO8BhXEtSmoPTUJnd8dSQkrs8HFx9OEe hOkI9ETXIaV2gkCV+R88ua88w== X-Received: by 2002:a05:600c:3493:b0:48a:534a:eed8 with SMTP id 5b1f17b1804b1-48fe4cae12dmr311374705e9.1.1779206043209; Tue, 19 May 2026 08:54:03 -0700 (PDT) Received: from localhost (p200300f65f47db048a8dfcf61053817f.dip0.t-ipconnect.de. [2003:f6:5f47:db04:8a8d:fcf6:1053:817f]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-48fe57944c1sm366642375e9.7.2026.05.19.08.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 08:54:02 -0700 (PDT) Date: Tue, 19 May 2026 17:54:01 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig_=28The_Capable_Hub=29?= To: Bartosz Golaszewski , Linus Walleij Cc: Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] gpio: Initialize i2c_device_id arrays using member names Message-ID: References: <20260512152125.924433-2-u.kleine-koenig@baylibre.com> <177909044656.4685.10308837875925010657.b4-ty@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6qtykroarc34juu2" Content-Disposition: inline In-Reply-To: <177909044656.4685.10308837875925010657.b4-ty@oss.qualcomm.com> --6qtykroarc34juu2 Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] gpio: Initialize i2c_device_id arrays using member names MIME-Version: 1.0 Hello Bartosz, On Mon, May 18, 2026 at 09:47:45AM +0200, Bartosz Golaszewski wrote: >=20 > On Tue, 12 May 2026 17:21:25 +0200, Uwe Kleine-K=F6nig (The Capable Hub) = wrote: > > 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. > >=20 > > The mentioned robustness is relevant for a planned change to struct > > i2c_device_id that replaces .driver_data by an anonymous union. > >=20 > > [...] >=20 > Applied, thanks! >=20 > [1/1] gpio: Initialize i2c_device_id arrays using member names > https://git.kernel.org/brgl/c/553e26a45e0e66698c1e0043b705933102ac3= edc in the meantime I improved my workflow to also adapt i2c_device_id arrays that don't make use of .driver_data. For drivers/gpio that would be: diff --git a/drivers/gpio/gpio-adnp.c b/drivers/gpio/gpio-adnp.c index e5ac2d211013..27a80d1143a1 100644 --- a/drivers/gpio/gpio-adnp.c +++ b/drivers/gpio/gpio-adnp.c @@ -499,8 +499,8 @@ static int adnp_i2c_probe(struct i2c_client *client) } =20 static const struct i2c_device_id adnp_i2c_id[] =3D { - { "gpio-adnp" }, - { }, + { .name =3D "gpio-adnp" }, + { } }; MODULE_DEVICE_TABLE(i2c, adnp_i2c_id); =20 diff --git a/drivers/gpio/gpio-ds4520.c b/drivers/gpio/gpio-ds4520.c index f52ecae382a4..5add662a7ef5 100644 --- a/drivers/gpio/gpio-ds4520.c +++ b/drivers/gpio/gpio-ds4520.c @@ -54,7 +54,7 @@ static const struct of_device_id ds4520_gpio_of_match_tab= le[] =3D { MODULE_DEVICE_TABLE(of, ds4520_gpio_of_match_table); =20 static const struct i2c_device_id ds4520_gpio_id_table[] =3D { - { "ds4520-gpio" }, + { .name =3D "ds4520-gpio" }, { } }; MODULE_DEVICE_TABLE(i2c, ds4520_gpio_id_table); diff --git a/drivers/gpio/gpio-fxl6408.c b/drivers/gpio/gpio-fxl6408.c index afc1b8461dab..45b02d36e66f 100644 --- a/drivers/gpio/gpio-fxl6408.c +++ b/drivers/gpio/gpio-fxl6408.c @@ -150,7 +150,7 @@ static const __maybe_unused struct of_device_id fxl6408= _dt_ids[] =3D { MODULE_DEVICE_TABLE(of, fxl6408_dt_ids); =20 static const struct i2c_device_id fxl6408_id[] =3D { - { "fxl6408" }, + { .name =3D "fxl6408" }, { } }; MODULE_DEVICE_TABLE(i2c, fxl6408_id); diff --git a/drivers/gpio/gpio-gw-pld.c b/drivers/gpio/gpio-gw-pld.c index 2e5d97b7363f..bf1f91c3c4a8 100644 --- a/drivers/gpio/gpio-gw-pld.c +++ b/drivers/gpio/gpio-gw-pld.c @@ -109,7 +109,7 @@ static int gw_pld_probe(struct i2c_client *client) } =20 static const struct i2c_device_id gw_pld_id[] =3D { - { "gw-pld", }, + { .name =3D "gw-pld" }, { } }; MODULE_DEVICE_TABLE(i2c, gw_pld_id); diff --git a/drivers/gpio/gpio-max7300.c b/drivers/gpio/gpio-max7300.c index 621d609ece90..62f2434c0d79 100644 --- a/drivers/gpio/gpio-max7300.c +++ b/drivers/gpio/gpio-max7300.c @@ -53,7 +53,7 @@ static void max7300_remove(struct i2c_client *client) } =20 static const struct i2c_device_id max7300_id[] =3D { - { "max7300" }, + { .name =3D "max7300" }, { } }; MODULE_DEVICE_TABLE(i2c, max7300_id); diff --git a/drivers/gpio/gpio-tpic2810.c b/drivers/gpio/gpio-tpic2810.c index 866ff2d436d5..c38538653e99 100644 --- a/drivers/gpio/gpio-tpic2810.c +++ b/drivers/gpio/gpio-tpic2810.c @@ -112,7 +112,7 @@ static int tpic2810_probe(struct i2c_client *client) } =20 static const struct i2c_device_id tpic2810_id_table[] =3D { - { "tpic2810", }, + { .name =3D "tpic2810" }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(i2c, tpic2810_id_table); diff --git a/drivers/gpio/gpio-ts4900.c b/drivers/gpio/gpio-ts4900.c index d9ee8fc77ccd..b46b48e56c56 100644 --- a/drivers/gpio/gpio-ts4900.c +++ b/drivers/gpio/gpio-ts4900.c @@ -175,7 +175,7 @@ static int ts4900_gpio_probe(struct i2c_client *client) } =20 static const struct i2c_device_id ts4900_gpio_id_table[] =3D { - { "ts4900-gpio", }, + { .name =3D "ts4900-gpio" }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(i2c, ts4900_gpio_id_table); These changes would fit to be squashed into the patch you merged. Would you prefer to do that, or should I put these changes into a separate patch? Best regards Uwe --6qtykroarc34juu2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmoMh5YACgkQj4D7WH0S /k5HRAgAolkiR9L95K14sbCkovNCj73B9FMS8CDt8TEjwT0W0wq5b08NGyV25qw2 vc0EthjicU8EaAoJq3Il6PhmfH3acJPjptOlYLKGpcgE10VwpWnPXC4oMbpueqQ2 Pfo/Bzb1cq/KeXMtBA0zUWP8gGl+dmJxuEwjNGerxPcWDTyT7JUlaYm3LNpW5St0 ShkX1CG872yCm8H8V+gZHXoUHcCczRzqlEzF2UhxLw2KfILC1lUv6zi2gxV2Y0cU ca1ls4bpgtVYnMO7jmyl47Kst31d4RxU5D7Y2IL5FKVG3YNLHXS+2udhLzmb0kxU UFz5YPjCkiUUgARC6AmfFuwcL51W0w== =zNAv -----END PGP SIGNATURE----- --6qtykroarc34juu2--