diff options
author | Thierry Reding <thierry.reding@avionic-design.de> | 2013-01-21 11:08:59 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-22 11:41:56 -0800 |
commit | c7c9e1c372452688f0ef2af794789bbd00f9fa51 (patch) | |
tree | 24f46d6b8a6393db716fda9fd94916c2faafd427 /drivers/char/hw_random/exynos-rng.c | |
parent | 75096579c3ac39ddc2f8b0d9a8924eba31f4d920 (diff) | |
download | lwn-c7c9e1c372452688f0ef2af794789bbd00f9fa51.tar.gz lwn-c7c9e1c372452688f0ef2af794789bbd00f9fa51.zip |
char: Convert to devm_ioremap_resource()
Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char/hw_random/exynos-rng.c')
-rw-r--r-- | drivers/char/hw_random/exynos-rng.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos-rng.c index 48bbfeca4b5d..4673fc4ad931 100644 --- a/drivers/char/hw_random/exynos-rng.c +++ b/drivers/char/hw_random/exynos-rng.c @@ -104,6 +104,7 @@ static int exynos_read(struct hwrng *rng, void *buf, static int exynos_rng_probe(struct platform_device *pdev) { struct exynos_rng *exynos_rng; + struct resource *res; exynos_rng = devm_kzalloc(&pdev->dev, sizeof(struct exynos_rng), GFP_KERNEL); @@ -120,10 +121,10 @@ static int exynos_rng_probe(struct platform_device *pdev) return -ENOENT; } - exynos_rng->mem = devm_request_and_ioremap(&pdev->dev, - platform_get_resource(pdev, IORESOURCE_MEM, 0)); - if (!exynos_rng->mem) - return -EBUSY; + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + exynos_rng->mem = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(exynos_rng->mem)) + return PTR_ERR(exynos_rng->mem); platform_set_drvdata(pdev, exynos_rng); |