Re: [PATCH] ALSA: Consistently define pci_device_ids using named initializers
From: Takashi Iwai
Date: Mon May 04 2026 - 07:24:22 EST
On Thu, 30 Apr 2026 15:52:53 +0200,
Uwe Kleine-König (The Capable Hub) wrote:
>
> ... and PCI device helpers.
>
> The various struct pci_device_id arrays were initialized mostly by list
> expressions, some of them using the PCI_DEVICE macros. This isn't easily
> readable if you're not into PCI. Using named initializers is more
> explicit and thus easier to parse. Also use PCI_DEVICE* helper macros to
> assign .vendor, .device, .subvendor and .subdevice where appropriate and
> skip explicit assignments of 0 (which the compiler takes care of).
>
> The secret plan is to make struct pci_device_id::driver_data an
> anonymous union (similar to
> https://lore.kernel.org/all/cover.1776579304.git.u.kleine-koenig@xxxxxxxxxxxx/)
> and that requires named initializers. But it's also a nice cleanup on
> its own.
>
> This change doesn't introduce changes to the compiled pci_device_id
> array. Tested on x86 and arm64.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>
> ---
> Hello,
>
> the mentioned follow-up quest allows to do
>
> PCI_DEVICE_SUB(HPI_PCI_VENDOR_ID_TI, HPI_PCI_DEV_ID_DSP6205,
> HPI_PCI_VENDOR_ID_AUDIOSCIENCE, PCI_ANY_ID),
> - .driver_data = (kernel_ulong_t)HPI_6205,
> + .driver_data_ptr = HPI_6205,
>
> which gets rid of a bunch of casts and so brings a little bit more type
> safety. This patch is a preparation for that.
>
> I assume a single patch for all of sound is fine. If not please instruct how I
> should split the patch. (per driver?)
As it's a systematic change and no conflict is found, I took to
for-next branch as is now.
thanks,
Takashi