linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH gpio v2 0/3] cleanup on resource check
@ 2014-10-28  6:37 Varka Bhadram
  2014-10-28  6:37 ` [PATCH gpio v2 1/3] gpio: gpio-davinci: remove duplicate check on resource Varka Bhadram
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Varka Bhadram @ 2014-10-28  6:37 UTC (permalink / raw)
  To: linux-gpio; +Cc: gnurou, linus.walleij, Varka Bhadram

This series removes the duplication of sanity check for
platform_get_resource() return resource. It will be checked 
with devm_ioremap_resource()

Series based on devel branch of [1].

[1]: https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-gpio.git

Varka Bhadram (3):
  gpio: gpio-davinci: remove duplicate check on resource
  gpio: gpio-stp-xway: remove duplicate check on resource
  gpio: gpio-tb10x: remove duplicate check on resource

 drivers/gpio/gpio-davinci.c  |    5 -----
 drivers/gpio/gpio-stp-xway.c |    8 ++------
 drivers/gpio/gpio-tb10x.c    |    7 +------
 3 files changed, 3 insertions(+), 17 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH gpio v2 1/3] gpio: gpio-davinci: remove duplicate check on resource
  2014-10-28  6:37 [PATCH gpio v2 0/3] cleanup on resource check Varka Bhadram
@ 2014-10-28  6:37 ` Varka Bhadram
  2014-10-31  8:03   ` Linus Walleij
  2014-10-28  6:37 ` [PATCH gpio v2 2/3] gpio: gpio-stp-xway: " Varka Bhadram
  2014-10-28  6:37 ` [PATCH gpio v2 3/3] gpio: gpio-tb10x: " Varka Bhadram
  2 siblings, 1 reply; 7+ messages in thread
From: Varka Bhadram @ 2014-10-28  6:37 UTC (permalink / raw)
  To: linux-gpio; +Cc: gnurou, linus.walleij, Varka Bhadram

Sanity check on resource happening with devm_ioremap_resource().

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpio/gpio-davinci.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index 9f06825..3faf5f9 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -234,11 +234,6 @@ static int davinci_gpio_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(dev, "Invalid memory resource\n");
-		return -EBUSY;
-	}
-
 	gpio_base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(gpio_base))
 		return PTR_ERR(gpio_base);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH gpio v2 2/3] gpio: gpio-stp-xway: remove duplicate check on resource
  2014-10-28  6:37 [PATCH gpio v2 0/3] cleanup on resource check Varka Bhadram
  2014-10-28  6:37 ` [PATCH gpio v2 1/3] gpio: gpio-davinci: remove duplicate check on resource Varka Bhadram
@ 2014-10-28  6:37 ` Varka Bhadram
  2014-10-31  8:05   ` Linus Walleij
  2014-10-28  6:37 ` [PATCH gpio v2 3/3] gpio: gpio-tb10x: " Varka Bhadram
  2 siblings, 1 reply; 7+ messages in thread
From: Varka Bhadram @ 2014-10-28  6:37 UTC (permalink / raw)
  To: linux-gpio; +Cc: gnurou, linus.walleij, Varka Bhadram

Sanity check on resource happening with devm_ioremap_resource().

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpio/gpio-stp-xway.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-stp-xway.c b/drivers/gpio/gpio-stp-xway.c
index 7e359b7..7892e0f 100644
--- a/drivers/gpio/gpio-stp-xway.c
+++ b/drivers/gpio/gpio-stp-xway.c
@@ -199,21 +199,17 @@ static int xway_stp_hw_init(struct xway_stp *chip)
 
 static int xway_stp_probe(struct platform_device *pdev)
 {
-	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	struct resource *res;
 	const __be32 *shadow, *groups, *dsl, *phy;
 	struct xway_stp *chip;
 	struct clk *clk;
 	int ret = 0;
 
-	if (!res) {
-		dev_err(&pdev->dev, "failed to request STP resource\n");
-		return -ENOENT;
-	}
-
 	chip = devm_kzalloc(&pdev->dev, sizeof(*chip), GFP_KERNEL);
 	if (!chip)
 		return -ENOMEM;
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	chip->virt = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(chip->virt))
 		return PTR_ERR(chip->virt);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH gpio v2 3/3] gpio: gpio-tb10x: remove duplicate check on resource
  2014-10-28  6:37 [PATCH gpio v2 0/3] cleanup on resource check Varka Bhadram
  2014-10-28  6:37 ` [PATCH gpio v2 1/3] gpio: gpio-davinci: remove duplicate check on resource Varka Bhadram
  2014-10-28  6:37 ` [PATCH gpio v2 2/3] gpio: gpio-stp-xway: " Varka Bhadram
@ 2014-10-28  6:37 ` Varka Bhadram
  2014-10-31  8:05   ` Linus Walleij
  2 siblings, 1 reply; 7+ messages in thread
From: Varka Bhadram @ 2014-10-28  6:37 UTC (permalink / raw)
  To: linux-gpio; +Cc: gnurou, linus.walleij, Varka Bhadram

Sanity check on resource happening with devm_ioremap_resource().

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Acked-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/gpio/gpio-tb10x.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c
index 9e615be..8b1e8c0 100644
--- a/drivers/gpio/gpio-tb10x.c
+++ b/drivers/gpio/gpio-tb10x.c
@@ -195,18 +195,13 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
 	if (of_property_read_u32(dn, "abilis,ngpio", &ngpio))
 		return -EINVAL;
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!mem) {
-		dev_err(&pdev->dev, "No memory resource defined.\n");
-		return -EINVAL;
-	}
-
 	tb10x_gpio = devm_kzalloc(&pdev->dev, sizeof(*tb10x_gpio), GFP_KERNEL);
 	if (tb10x_gpio == NULL)
 		return -ENOMEM;
 
 	spin_lock_init(&tb10x_gpio->spinlock);
 
+	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	tb10x_gpio->base = devm_ioremap_resource(&pdev->dev, mem);
 	if (IS_ERR(tb10x_gpio->base))
 		return PTR_ERR(tb10x_gpio->base);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH gpio v2 1/3] gpio: gpio-davinci: remove duplicate check on resource
  2014-10-28  6:37 ` [PATCH gpio v2 1/3] gpio: gpio-davinci: remove duplicate check on resource Varka Bhadram
@ 2014-10-31  8:03   ` Linus Walleij
  0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2014-10-31  8:03 UTC (permalink / raw)
  To: Varka Bhadram
  Cc: linux-gpio@vger.kernel.org, Alexandre Courbot, Varka Bhadram

On Tue, Oct 28, 2014 at 7:37 AM, Varka Bhadram <varkabhadram@gmail.com> wrote:

> Sanity check on resource happening with devm_ioremap_resource().
>
> Signed-off-by: Varka Bhadram <varkab@cdac.in>
> Acked-by: Alexandre Courbot <acourbot@nvidia.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH gpio v2 2/3] gpio: gpio-stp-xway: remove duplicate check on resource
  2014-10-28  6:37 ` [PATCH gpio v2 2/3] gpio: gpio-stp-xway: " Varka Bhadram
@ 2014-10-31  8:05   ` Linus Walleij
  0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2014-10-31  8:05 UTC (permalink / raw)
  To: Varka Bhadram
  Cc: linux-gpio@vger.kernel.org, Alexandre Courbot, Varka Bhadram

On Tue, Oct 28, 2014 at 7:37 AM, Varka Bhadram <varkabhadram@gmail.com> wrote:

> Sanity check on resource happening with devm_ioremap_resource().
>
> Signed-off-by: Varka Bhadram <varkab@cdac.in>
> Acked-by: Alexandre Courbot <acourbot@nvidia.com>

I've already applied a version of this patch.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH gpio v2 3/3] gpio: gpio-tb10x: remove duplicate check on resource
  2014-10-28  6:37 ` [PATCH gpio v2 3/3] gpio: gpio-tb10x: " Varka Bhadram
@ 2014-10-31  8:05   ` Linus Walleij
  0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2014-10-31  8:05 UTC (permalink / raw)
  To: Varka Bhadram
  Cc: linux-gpio@vger.kernel.org, Alexandre Courbot, Varka Bhadram

On Tue, Oct 28, 2014 at 7:37 AM, Varka Bhadram <varkabhadram@gmail.com> wrote:

> Sanity check on resource happening with devm_ioremap_resource().
>
> Signed-off-by: Varka Bhadram <varkab@cdac.in>
> Acked-by: Alexandre Courbot <acourbot@nvidia.com>

Already applied a version of this patch.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-31  8:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-28  6:37 [PATCH gpio v2 0/3] cleanup on resource check Varka Bhadram
2014-10-28  6:37 ` [PATCH gpio v2 1/3] gpio: gpio-davinci: remove duplicate check on resource Varka Bhadram
2014-10-31  8:03   ` Linus Walleij
2014-10-28  6:37 ` [PATCH gpio v2 2/3] gpio: gpio-stp-xway: " Varka Bhadram
2014-10-31  8:05   ` Linus Walleij
2014-10-28  6:37 ` [PATCH gpio v2 3/3] gpio: gpio-tb10x: " Varka Bhadram
2014-10-31  8:05   ` 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).