Re: [PATCH v1 1/2] mfd: intel-lpss: Switch to generalized quirk table

From: Andy Shevchenko
Date: Wed Dec 20 2023 - 10:08:31 EST


On Wed, Dec 20, 2023 at 08:31:47AM +0100, Aleksandrs Vinarskis wrote:
> Introduce generic quirk table, and port existing walkaround for select
> Microsoft devices to it. This is a preparation for
> QUIRK_CLOCK_DIVIDER_UNITY.

...

> + quirk_pci_info = pci_match_id(quirk_ids, pdev);
> + if (quirk_pci_info) {
> + quirk_lpss_info = (void *)quirk_pci_info->driver_data;
> + info->quirks = quirk_lpss_info->quirks;
> + }

Just use driver_data as the quirks. No need to have an intermediate data
structure. This will become as simple as

quirk_pci_info = pci_match_id(quirk_ids, pdev);
if (quirk_pci_info)
info->quirks = quirk_pci_info->driver_data;

No ugly castings is a good side effect of the change.

...

>

+ bits.h as you used BIT() below.

> #include <linux/pm.h>
>
> +#define QUIRK_IGNORE_RESOURCE_CONFLICTS BIT(0)

--
With Best Regards,
Andy Shevchenko