From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: Andi Shyti <andi.shyti@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Jan Dabros <jsd@semihalf.com>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Markus Schneider-Pargmann <msp@baylibre.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>
Subject: Re: [PATCH] i2c: Consistently define pci_device_ids using named initializers
Date: Mon, 4 May 2026 17:50:28 +0300 [thread overview]
Message-ID: <afiyNKhJTD__jAYF@ashevche-desk.local> (raw)
In-Reply-To: <20260504142639.2119645-2-u.kleine-koenig@baylibre.com>
On Mon, May 04, 2026 at 04:26:39PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
>
> The .driver_data member of the various struct pci_device_id arrays were
> initialized by list expressions. This isn't easily readable if you're
> not into PCI. Using named initializers is more explicit and thus easier
> to parse. Also skip explicit assignments of 0 (which the compiler then
> takes care of).
>
> This change doesn't introduce changes to the compiled pci_device_id
> arrays. Tested on x86 and arm64.
Split by driver, please.
...
> static const struct pci_device_id pch_pcidev_id[] = {
> - { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PCH_I2C), 1, },
> - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_I2C), 2, },
> - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_I2C), 1, },
> - { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_I2C), 1, },
> - {0,}
> + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PCH_I2C), .driver_data = 1 },
> + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_I2C), .driver_data = 2 },
> + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_I2C), .driver_data = 1 },
> + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7831_I2C), .driver_data = 1 },
> + { }
This may gain with PCI_DEVICE_DATA().
> };
...
The second driver is fine to me.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-05-04 14:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 14:26 [PATCH] i2c: Consistently define pci_device_ids using named initializers Uwe Kleine-König (The Capable Hub)
2026-05-04 14:50 ` Andy Shevchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=afiyNKhJTD__jAYF@ashevche-desk.local \
--to=andriy.shevchenko@linux.intel.com \
--cc=andi.shyti@kernel.org \
--cc=jsd@semihalf.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=msp@baylibre.com \
--cc=u.kleine-koenig@baylibre.com \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox