Re: [PATCH v2] gpio: mxc: Remove unused .id_table support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 16, 2020 at 7:53 PM Fabio Estevam <festevam@xxxxxxxxx> wrote:
>
> Since 5.10-rc1 i.MX is a devicetree-only platform and the existing
> .id_table support in this driver was only useful for old non-devicetree
> platforms.
>
> Get rid of the .id_table since it is no longer used.

...

Actually I would rather add IMX_UNKNOWN_GPIO as 0 for enum and...

>         const struct of_device_id *of_id =
>                         of_match_device(mxc_gpio_dt_ids, &pdev->dev);

...use of_device_get_match_data() here.

> +       enum mxc_gpio_hwtype hwtype = (enum mxc_gpio_hwtype)of_id->data;

...

Another (and I think better variant) is to switch .data to be a
pointer to the corresponding struct, then you may drop enum and hwtype
completely.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux