Skip to content

Commit

Permalink
serial: 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: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Thierry Reding authored and Greg Kroah-Hartman committed Jan 22, 2013
1 parent 97f4be6 commit eb612fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/tty/serial/sccnxp.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define SUPPORT_SYSRQ
#endif

#include <linux/err.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/console.h>
Expand Down Expand Up @@ -875,10 +876,9 @@ static int sccnxp_probe(struct platform_device *pdev)
goto err_out;
}

membase = devm_request_and_ioremap(&pdev->dev, res);
if (!membase) {
dev_err(&pdev->dev, "Failed to ioremap\n");
ret = -EIO;
membase = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(membase)) {
ret = PTR_ERR(membase);
goto err_out;
}

Expand Down

0 comments on commit eb612fa

Please sign in to comment.