summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-03-22 07:51:51 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2021-04-02 09:28:12 +0200
commit1015f19b2151acff211cba9162c103d588d8faad (patch)
treeb8771c336ce7521d18a7a3d21814b9e70593bdfd
parentrandom: remove dead code left over from blocking pool (diff)
downloadlinux-1015f19b2151acff211cba9162c103d588d8faad.tar.xz
linux-1015f19b2151acff211cba9162c103d588d8faad.zip
hwrng: omap - Use of_device_get_match_data() helper
Use the of_device_get_match_data() helper instead of open coding. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/char/hw_random/omap-rng.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 4380c23587be..cede9f159102 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")) {