[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <59855f4f-9099-a8a9-c8dd-918b5fc637ea@arm.com>
Date: Mon, 25 Mar 2019 11:08:28 +0000
From: Steven Price <steven.price@....com>
To: Aditya Pakki <pakki001@....edu>
Cc: kjlu@....edu, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Sudeep Holla <sudeep.holla@....com>
Subject: Re: [PATCH v2] firmware: arm_scmi: Fix to replace of_match_device
On 22/03/2019 21:55, Aditya Pakki wrote:
> of_match_device can return NULL if no matching device is found.
> This patch replaces the function with of_device_get_match_data.
> and returns -EINVAL in such a scenario.
>
> Signed-off-by: Aditya Pakki <pakki001@....edu>
Reviewed-by: Steven Price <steven.price@....com>
>
> ---
> v1: Replace of_match_device with of_device_get_match_data
> ---
> drivers/firmware/arm_scmi/driver.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c
> index 8f952f2f1a29..a44852a1d5bc 100644
> --- a/drivers/firmware/arm_scmi/driver.c
> +++ b/drivers/firmware/arm_scmi/driver.c
> @@ -798,7 +798,9 @@ static int scmi_probe(struct platform_device *pdev)
> return -EINVAL;
> }
>
> - desc = of_match_device(scmi_of_match, dev)->data;
> + desc = of_device_get_match_data(dev);
> + if (!desc)
> + return -EINVAL;
>
> info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
> if (!info)
>
Powered by blists - more mailing lists