]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
hwrng: omap - Use of_device_get_match_data() helper
authorTian Tao <tiantao6@hisilicon.com>
Mon, 22 Mar 2021 06:51:51 +0000 (14:51 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 2 Apr 2021 07:28:12 +0000 (18:28 +1100)
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>
drivers/char/hw_random/omap-rng.c

index 4380c23587be15f651519a53baf6303eb3ef13f0..cede9f15910293752281e34df0dbc35b186bfe05 100644 (file)
@@ -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")) {