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:
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)
|
static int exynos_rng_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct exynos_rng *exynos_rng;
|
struct exynos_rng *exynos_rng;
|
||||||
|
struct resource *res;
|
||||||
|
|
||||||
exynos_rng = devm_kzalloc(&pdev->dev, sizeof(struct exynos_rng),
|
exynos_rng = devm_kzalloc(&pdev->dev, sizeof(struct exynos_rng),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
|
@ -120,10 +121,10 @@ static int exynos_rng_probe(struct platform_device *pdev)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
exynos_rng->mem = devm_request_and_ioremap(&pdev->dev,
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
platform_get_resource(pdev, IORESOURCE_MEM, 0));
|
exynos_rng->mem = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (!exynos_rng->mem)
|
if (IS_ERR(exynos_rng->mem))
|
||||||
return -EBUSY;
|
return PTR_ERR(exynos_rng->mem);
|
||||||
|
|
||||||
platform_set_drvdata(pdev, exynos_rng);
|
platform_set_drvdata(pdev, exynos_rng);
|
||||||
|
|
||||||
|
|
|
@ -124,9 +124,9 @@ static int omap_rng_probe(struct platform_device *pdev)
|
||||||
goto err_ioremap;
|
goto err_ioremap;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->base = devm_request_and_ioremap(&pdev->dev, priv->mem_res);
|
priv->base = devm_ioremap_resource(&pdev->dev, priv->mem_res);
|
||||||
if (!priv->base) {
|
if (IS_ERR(priv->base)) {
|
||||||
ret = -ENOMEM;
|
ret = PTR_ERR(priv->base);
|
||||||
goto err_ioremap;
|
goto err_ioremap;
|
||||||
}
|
}
|
||||||
dev_set_drvdata(&pdev->dev, priv);
|
dev_set_drvdata(&pdev->dev, priv);
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
* License. See the file "COPYING" in the main directory of this archive
|
* License. See the file "COPYING" in the main directory of this archive
|
||||||
* for more details.
|
* for more details.
|
||||||
*/
|
*/
|
||||||
|
#include <linux/err.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
@ -115,9 +116,9 @@ static int __init tx4939_rng_probe(struct platform_device *dev)
|
||||||
rngdev = devm_kzalloc(&dev->dev, sizeof(*rngdev), GFP_KERNEL);
|
rngdev = devm_kzalloc(&dev->dev, sizeof(*rngdev), GFP_KERNEL);
|
||||||
if (!rngdev)
|
if (!rngdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
rngdev->base = devm_request_and_ioremap(&dev->dev, r);
|
rngdev->base = devm_ioremap_resource(&dev->dev, r);
|
||||||
if (!rngdev->base)
|
if (IS_ERR(rngdev->base))
|
||||||
return -EBUSY;
|
return PTR_ERR(rngdev->base);
|
||||||
|
|
||||||
rngdev->rng.name = dev_name(&dev->dev);
|
rngdev->rng.name = dev_name(&dev->dev);
|
||||||
rngdev->rng.data_present = tx4939_rng_data_present;
|
rngdev->rng.data_present = tx4939_rng_data_present;
|
||||||
|
|
Loading…
Reference in New Issue