* [PATCH 1/2] gpio: octeon: Convert to use devm_ioremap_resource
@ 2016-03-18 13:05 Axel Lin
2016-03-18 13:06 ` [PATCH 2/2] gpio: octeon: Constify octeon_gpio_match table Axel Lin
2016-03-22 13:35 ` [PATCH 1/2] gpio: octeon: Convert to use devm_ioremap_resource Linus Walleij
0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2016-03-18 13:05 UTC (permalink / raw)
To: Linus Walleij; +Cc: David Daney, Alexandre Courbot, linux-gpio, linux-mips
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/gpio/gpio-octeon.c | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/drivers/gpio/gpio-octeon.c b/drivers/gpio/gpio-octeon.c
index 47aead1..9373d4e 100644
--- a/drivers/gpio/gpio-octeon.c
+++ b/drivers/gpio/gpio-octeon.c
@@ -83,6 +83,7 @@ static int octeon_gpio_probe(struct platform_device *pdev)
struct octeon_gpio *gpio;
struct gpio_chip *chip;
struct resource *res_mem;
+ void __iomem *reg_base;
int err = 0;
gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
@@ -91,21 +92,11 @@ static int octeon_gpio_probe(struct platform_device *pdev)
chip = &gpio->chip;
res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (res_mem == NULL) {
- dev_err(&pdev->dev, "found no memory resource\n");
- err = -ENXIO;
- goto out;
- }
- if (!devm_request_mem_region(&pdev->dev, res_mem->start,
- resource_size(res_mem),
- res_mem->name)) {
- dev_err(&pdev->dev, "request_mem_region failed\n");
- err = -ENXIO;
- goto out;
- }
- gpio->register_base = (u64)devm_ioremap(&pdev->dev, res_mem->start,
- resource_size(res_mem));
+ reg_base = devm_ioremap_resource(&pdev->dev, res_mem);
+ if (IS_ERR(reg_base))
+ return PTR_ERR(reg_base);
+ gpio->register_base = (u64)reg_base;
pdev->dev.platform_data = chip;
chip->label = "octeon-gpio";
chip->parent = &pdev->dev;
@@ -119,11 +110,10 @@ static int octeon_gpio_probe(struct platform_device *pdev)
chip->set = octeon_gpio_set;
err = devm_gpiochip_add_data(&pdev->dev, chip, gpio);
if (err)
- goto out;
+ return err;
dev_info(&pdev->dev, "OCTEON GPIO driver probed.\n");
-out:
- return err;
+ return 0;
}
static struct of_device_id octeon_gpio_match[] = {
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] gpio: octeon: Constify octeon_gpio_match table
2016-03-18 13:05 [PATCH 1/2] gpio: octeon: Convert to use devm_ioremap_resource Axel Lin
@ 2016-03-18 13:06 ` Axel Lin
2016-03-22 13:36 ` Linus Walleij
2016-03-22 13:35 ` [PATCH 1/2] gpio: octeon: Convert to use devm_ioremap_resource Linus Walleij
1 sibling, 1 reply; 4+ messages in thread
From: Axel Lin @ 2016-03-18 13:06 UTC (permalink / raw)
To: Linus Walleij; +Cc: David Daney, Alexandre Courbot, linux-gpio, linux-mips
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/gpio/gpio-octeon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-octeon.c b/drivers/gpio/gpio-octeon.c
index 9373d4e..96a8a8c 100644
--- a/drivers/gpio/gpio-octeon.c
+++ b/drivers/gpio/gpio-octeon.c
@@ -116,7 +116,7 @@ static int octeon_gpio_probe(struct platform_device *pdev)
return 0;
}
-static struct of_device_id octeon_gpio_match[] = {
+static const struct of_device_id octeon_gpio_match[] = {
{
.compatible = "cavium,octeon-3860-gpio",
},
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] gpio: octeon: Convert to use devm_ioremap_resource
2016-03-18 13:05 [PATCH 1/2] gpio: octeon: Convert to use devm_ioremap_resource Axel Lin
2016-03-18 13:06 ` [PATCH 2/2] gpio: octeon: Constify octeon_gpio_match table Axel Lin
@ 2016-03-22 13:35 ` Linus Walleij
1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-03-22 13:35 UTC (permalink / raw)
To: Axel Lin
Cc: David Daney, Alexandre Courbot, linux-gpio@vger.kernel.org,
Linux MIPS
On Fri, Mar 18, 2016 at 2:05 PM, Axel Lin <axel.lin@ingics.com> wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Patch applied for v4.7.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] gpio: octeon: Constify octeon_gpio_match table
2016-03-18 13:06 ` [PATCH 2/2] gpio: octeon: Constify octeon_gpio_match table Axel Lin
@ 2016-03-22 13:36 ` Linus Walleij
0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-03-22 13:36 UTC (permalink / raw)
To: Axel Lin
Cc: David Daney, Alexandre Courbot, linux-gpio@vger.kernel.org,
Linux MIPS
On Fri, Mar 18, 2016 at 2:06 PM, Axel Lin <axel.lin@ingics.com> wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Patch applied for v4.7.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-03-22 13:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-18 13:05 [PATCH 1/2] gpio: octeon: Convert to use devm_ioremap_resource Axel Lin
2016-03-18 13:06 ` [PATCH 2/2] gpio: octeon: Constify octeon_gpio_match table Axel Lin
2016-03-22 13:36 ` Linus Walleij
2016-03-22 13:35 ` [PATCH 1/2] gpio: octeon: Convert to use devm_ioremap_resource Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).