From: Sudeep Holla <sudeep.holla@arm.com>
To: Aditya Pakki <pakki001@umn.edu>
Cc: kjlu@umn.edu, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Sudeep Holla <sudeep.holla@arm.com>
Subject: Re: [PATCH v2] firmware: arm_scmi: Fix to replace of_match_device
Date: Wed, 10 Apr 2019 17:10:11 +0100 [thread overview]
Message-ID: <20190410161011.GE3952@e107155-lin> (raw)
In-Reply-To: <20190322215503.13434-1-pakki001@umn.edu>
On Fri, Mar 22, 2019 at 04:55:03PM -0500, 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@umn.edu>
>
> ---
> 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;
probe won't be called be there's no match. And we mandate data in the
driver, so this should never happen.
> + desc = of_device_get_match_data(dev);
Having said that, I am happy to use the above function.
> + if (!desc)
> + return -EINVAL;
>
NULL check seems totally unnecessary, but it's in probe so I am fine.
Applied with updates to subject and commit message.
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-04-10 16:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-22 21:55 [PATCH v2] firmware: arm_scmi: Fix to replace of_match_device Aditya Pakki
2019-03-25 11:08 ` Steven Price
2019-04-10 16:10 ` Sudeep Holla [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190410161011.GE3952@e107155-lin \
--to=sudeep.holla@arm.com \
--cc=kjlu@umn.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pakki001@umn.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox