Skip to content

Commit

Permalink
mfd: Convert to devm_ioremap_resource()
Browse files Browse the repository at this point in the history
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: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Thierry Reding authored and gregkh committed Jan 25, 2013
1 parent d65e8e4 commit 6c2db1c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/mfd/intel_msic.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* published by the Free Software Foundation.
*/

#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/io.h>
#include <linux/module.h>
Expand Down Expand Up @@ -424,11 +425,9 @@ static int intel_msic_probe(struct platform_device *pdev)
return -ENODEV;
}

msic->irq_base = devm_request_and_ioremap(&pdev->dev, res);
if (!msic->irq_base) {
dev_err(&pdev->dev, "failed to map SRAM memory\n");
return -ENOMEM;
}
msic->irq_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(msic->irq_base))
return PTR_ERR(msic->irq_base);

platform_set_drvdata(pdev, msic);

Expand Down

0 comments on commit 6c2db1c

Please sign in to comment.