Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Thierry Reding and committed by
Greg Kroah-Hartman
eb612fa0 97f4be60

+4 -4
+4 -4
drivers/tty/serial/sccnxp.c
··· 15 15 #define SUPPORT_SYSRQ 16 16 #endif 17 17 18 + #include <linux/err.h> 18 19 #include <linux/module.h> 19 20 #include <linux/device.h> 20 21 #include <linux/console.h> ··· 876 875 goto err_out; 877 876 } 878 877 879 - membase = devm_request_and_ioremap(&pdev->dev, res); 880 - if (!membase) { 881 - dev_err(&pdev->dev, "Failed to ioremap\n"); 882 - ret = -EIO; 878 + membase = devm_ioremap_resource(&pdev->dev, res); 879 + if (IS_ERR(membase)) { 880 + ret = PTR_ERR(membase); 883 881 goto err_out; 884 882 } 885 883