Re: [PATCH 2/4] gpio: pxa: convert to devm_ioremap
On Sat, Nov 28, 2015 at 10:37 PM, Robert Jarzmik wrote: > Use the device managed ioremap to simplify the probe function. > > Signed-off-by: Robert Jarzmik Patch applied. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/4] gpio: pxa: convert to devm_ioremap
On Sat, Nov 28, 2015 at 10:37 PM, Robert Jarzmikwrote: > Use the device managed ioremap to simplify the probe function. > > Signed-off-by: Robert Jarzmik Patch applied. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/4] gpio: pxa: convert to devm_ioremap
Use the device managed ioremap to simplify the probe function. Signed-off-by: Robert Jarzmik --- drivers/gpio/gpio-pxa.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index de2cfbeccaa1..8558abf98204 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -614,9 +614,8 @@ static int pxa_gpio_probe(struct platform_device *pdev) || (irq_mux <= 0)) return -EINVAL; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -EINVAL; - gpio_reg_base = ioremap(res->start, resource_size(res)); + gpio_reg_base = devm_ioremap(>dev, res->start, +resource_size(res)); if (!gpio_reg_base) return -EINVAL; @@ -627,13 +626,11 @@ static int pxa_gpio_probe(struct platform_device *pdev) if (IS_ERR(clk)) { dev_err(>dev, "Error %ld to get gpio clock\n", PTR_ERR(clk)); - iounmap(gpio_reg_base); return PTR_ERR(clk); } ret = clk_prepare_enable(clk); if (ret) { clk_put(clk); - iounmap(gpio_reg_base); return ret; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/4] gpio: pxa: convert to devm_ioremap
Use the device managed ioremap to simplify the probe function. Signed-off-by: Robert Jarzmik--- drivers/gpio/gpio-pxa.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index de2cfbeccaa1..8558abf98204 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -614,9 +614,8 @@ static int pxa_gpio_probe(struct platform_device *pdev) || (irq_mux <= 0)) return -EINVAL; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -EINVAL; - gpio_reg_base = ioremap(res->start, resource_size(res)); + gpio_reg_base = devm_ioremap(>dev, res->start, +resource_size(res)); if (!gpio_reg_base) return -EINVAL; @@ -627,13 +626,11 @@ static int pxa_gpio_probe(struct platform_device *pdev) if (IS_ERR(clk)) { dev_err(>dev, "Error %ld to get gpio clock\n", PTR_ERR(clk)); - iounmap(gpio_reg_base); return PTR_ERR(clk); } ret = clk_prepare_enable(clk); if (ret) { clk_put(clk); - iounmap(gpio_reg_base); return ret; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/