diff options
author | Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn> | 2022-03-07 06:37:36 +0300 |
---|---|---|
committer | Nishanth Menon <nm@ti.com> | 2022-04-15 22:31:03 +0300 |
commit | cabfa5b46573b4e5ded52b4296a831745c6d32b5 (patch) | |
tree | 2e5312f2b38a1d5615ee3844d85ad43b11a90bcb /drivers/soc/ti | |
parent | f25d2b2b554133b935e72c61deb40d82287a6f75 (diff) | |
download | linux-cabfa5b46573b4e5ded52b4296a831745c6d32b5.tar.xz |
soc: ti: omap_prm: Use of_device_get_match_data()
Since omap_prm_id_table all have (and expected to have) data entries,
use of_device_get_match_data() to simplify the code.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20220307033736.2075221-1-chi.minghao@zte.com.cn
Diffstat (limited to 'drivers/soc/ti')
-rw-r--r-- | drivers/soc/ti/omap_prm.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c index f32e1cbbe8c5..913b964374a4 100644 --- a/drivers/soc/ti/omap_prm.c +++ b/drivers/soc/ti/omap_prm.c @@ -941,23 +941,20 @@ static int omap_prm_probe(struct platform_device *pdev) struct resource *res; const struct omap_prm_data *data; struct omap_prm *prm; - const struct of_device_id *match; int ret; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -ENODEV; - match = of_match_device(omap_prm_id_table, &pdev->dev); - if (!match) + data = of_device_get_match_data(&pdev->dev); + if (!data) return -ENOTSUPP; prm = devm_kzalloc(&pdev->dev, sizeof(*prm), GFP_KERNEL); if (!prm) return -ENOMEM; - data = match->data; - while (data->base != res->start) { if (!data->base) return -EINVAL; |