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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
75096579c3
commit
c7c9e1c372
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user