提交 eb612fa0 编写于 作者: T Thierry Reding 提交者: Greg Kroah-Hartman

serial: 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: NThierry Reding <thierry.reding@avionic-design.de>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 97f4be60
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define SUPPORT_SYSRQ #define SUPPORT_SYSRQ
#endif #endif
#include <linux/err.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/console.h> #include <linux/console.h>
...@@ -875,10 +876,9 @@ static int sccnxp_probe(struct platform_device *pdev) ...@@ -875,10 +876,9 @@ static int sccnxp_probe(struct platform_device *pdev)
goto err_out; goto err_out;
} }
membase = devm_request_and_ioremap(&pdev->dev, res); membase = devm_ioremap_resource(&pdev->dev, res);
if (!membase) { if (IS_ERR(membase)) {
dev_err(&pdev->dev, "Failed to ioremap\n"); ret = PTR_ERR(membase);
ret = -EIO;
goto err_out; goto err_out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册