Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tian Tao and committed by
Herbert Xu
1015f19b 118a4417

+4 -7
+4 -7
drivers/char/hw_random/omap-rng.c
··· 377 377 static int of_get_omap_rng_device_details(struct omap_rng_dev *priv, 378 378 struct platform_device *pdev) 379 379 { 380 - const struct of_device_id *match; 381 380 struct device *dev = &pdev->dev; 382 381 int irq, err; 383 382 384 - match = of_match_device(of_match_ptr(omap_rng_of_match), dev); 385 - if (!match) { 386 - dev_err(dev, "no compatible OF match\n"); 387 - return -EINVAL; 388 - } 389 - priv->pdata = match->data; 383 + priv->pdata = of_device_get_match_data(dev); 384 + if (!priv->pdata) 385 + return -ENODEV; 386 + 390 387 391 388 if (of_device_is_compatible(dev->of_node, "ti,omap4-rng") || 392 389 of_device_is_compatible(dev->of_node, "inside-secure,safexcel-eip76")) {