* [PATCH] hwrng: omap - Use of_device_get_match_data() helper
@ 2021-03-22 6:51 Tian Tao
2021-04-02 9:47 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2021-03-22 6:51 UTC (permalink / raw)
To: herbert; +Cc: linux-crypto
Use the of_device_get_match_data() helper instead of open coding.
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
drivers/char/hw_random/omap-rng.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 4380c23..cede9f1 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -377,16 +377,13 @@ MODULE_DEVICE_TABLE(of, omap_rng_of_match);
static int of_get_omap_rng_device_details(struct omap_rng_dev *priv,
struct platform_device *pdev)
{
- const struct of_device_id *match;
struct device *dev = &pdev->dev;
int irq, err;
- match = of_match_device(of_match_ptr(omap_rng_of_match), dev);
- if (!match) {
- dev_err(dev, "no compatible OF match\n");
- return -EINVAL;
- }
- priv->pdata = match->data;
+ priv->pdata = of_device_get_match_data(dev);
+ if (!priv->pdata)
+ return -ENODEV;
+
if (of_device_is_compatible(dev->of_node, "ti,omap4-rng") ||
of_device_is_compatible(dev->of_node, "inside-secure,safexcel-eip76")) {
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwrng: omap - Use of_device_get_match_data() helper
2021-03-22 6:51 [PATCH] hwrng: omap - Use of_device_get_match_data() helper Tian Tao
@ 2021-04-02 9:47 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2021-04-02 9:47 UTC (permalink / raw)
To: Tian Tao; +Cc: linux-crypto
On Mon, Mar 22, 2021 at 02:51:51PM +0800, Tian Tao wrote:
> Use the of_device_get_match_data() helper instead of open coding.
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
> drivers/char/hw_random/omap-rng.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-02 9:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 6:51 [PATCH] hwrng: omap - Use of_device_get_match_data() helper Tian Tao
2021-04-02 9:47 ` Herbert Xu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.