mtd: 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. devm_ioremap_resource() provides its own error messages so all explicit error messages can be removed from the failure code paths. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
a3e2cd7f24
commit
b0de774c63
@@ -949,10 +949,9 @@ static int spear_smi_probe(struct platform_device *pdev)
|
||||
|
||||
smi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
|
||||
dev->io_base = devm_request_and_ioremap(&pdev->dev, smi_base);
|
||||
if (!dev->io_base) {
|
||||
ret = -EIO;
|
||||
dev_err(&pdev->dev, "devm_request_and_ioremap fail\n");
|
||||
dev->io_base = devm_ioremap_resource(&pdev->dev, smi_base);
|
||||
if (IS_ERR(dev->io_base)) {
|
||||
ret = PTR_ERR(dev->io_base);
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user