Re: [PATCH] memory: ti-emif-pm: Drop of_match_ptr from of_device_id table

From: Nathan Chancellor
Date: Sat Feb 06 2021 - 17:18:09 EST


On Sat, Feb 06, 2021 at 12:13:43PM +0100, Krzysztof Kozlowski wrote:
> The driver can match only via the DT table so the table should be always
> used and the of_match_ptr does not have any sense (this also allows ACPI
> matching via PRP0001, even though it might be not relevant here). This
> fixes compile warning (!CONFIG_OF with clang):
>
> drivers/memory/ti-emif-pm.c:238:34: warning:
> unused variable 'ti_emif_of_match' [-Wunused-const-variable]
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Signed-off-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx>

Yes, this seems to be how everyone is dealing with this warning:

Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx>

> ---
> drivers/memory/ti-emif-pm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/memory/ti-emif-pm.c b/drivers/memory/ti-emif-pm.c
> index 6c747c1e98cb..179fec2da56d 100644
> --- a/drivers/memory/ti-emif-pm.c
> +++ b/drivers/memory/ti-emif-pm.c
> @@ -340,7 +340,7 @@ static struct platform_driver ti_emif_driver = {
> .remove = ti_emif_remove,
> .driver = {
> .name = KBUILD_MODNAME,
> - .of_match_table = of_match_ptr(ti_emif_of_match),
> + .of_match_table = ti_emif_of_match,
> .pm = &ti_emif_pm_ops,
> },
> };
> --
> 2.25.1
>