linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource()
@ 2014-06-10  4:40 George Cherian
  2014-06-10  4:40 ` [PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource " George Cherian
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: George Cherian @ 2014-06-10  4:40 UTC (permalink / raw)
  To: wim; +Cc: linux-watchdog, linux-kernel, George Cherian

devm_ioremap_resource() checks for valid resource.
Remove the un-necessary check after platform_get_resource().

Signed-off-by: George Cherian <george.cherian@ti.com>
---
 drivers/watchdog/dw_wdt.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
index ee4f86b..9f21029 100644
--- a/drivers/watchdog/dw_wdt.c
+++ b/drivers/watchdog/dw_wdt.c
@@ -296,9 +296,6 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
 	int ret;
 	struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
-	if (!mem)
-		return -EINVAL;
-
 	dw_wdt.regs = devm_ioremap_resource(&pdev->dev, mem);
 	if (IS_ERR(dw_wdt.regs))
 		return PTR_ERR(dw_wdt.regs);
-- 
1.8.3.1


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

* [PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource after platform_get_resource()
  2014-06-10  4:40 [PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource() George Cherian
@ 2014-06-10  4:40 ` George Cherian
  2014-06-10 19:23   ` Guenter Roeck
  2014-06-10  4:40 ` [PATCH 3/3] watchdog: shwdt: Remove the unnecessary " George Cherian
  2014-06-10 19:23 ` [PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check " Guenter Roeck
  2 siblings, 1 reply; 6+ messages in thread
From: George Cherian @ 2014-06-10  4:40 UTC (permalink / raw)
  To: wim; +Cc: linux-watchdog, linux-kernel, George Cherian

devm_ioremap_resource() checks for valid resource.
Remove the un-necessary check after platform_get_resource().

Signed-off-by: George Cherian <george.cherian@ti.com>
---
 drivers/watchdog/lantiq_wdt.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/watchdog/lantiq_wdt.c b/drivers/watchdog/lantiq_wdt.c
index 3b3148c..021e84e 100644
--- a/drivers/watchdog/lantiq_wdt.c
+++ b/drivers/watchdog/lantiq_wdt.c
@@ -192,11 +192,6 @@ ltq_wdt_probe(struct platform_device *pdev)
 	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	struct clk *clk;
 
-	if (!res) {
-		dev_err(&pdev->dev, "cannot obtain I/O memory region");
-		return -ENOENT;
-	}
-
 	ltq_wdt_membase = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(ltq_wdt_membase))
 		return PTR_ERR(ltq_wdt_membase);
-- 
1.8.3.1


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

* [PATCH 3/3] watchdog: shwdt: Remove the unnecessary check of resource after platform_get_resource()
  2014-06-10  4:40 [PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource() George Cherian
  2014-06-10  4:40 ` [PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource " George Cherian
@ 2014-06-10  4:40 ` George Cherian
  2014-06-10 19:24   ` Guenter Roeck
  2014-06-10 19:23 ` [PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check " Guenter Roeck
  2 siblings, 1 reply; 6+ messages in thread
From: George Cherian @ 2014-06-10  4:40 UTC (permalink / raw)
  To: wim; +Cc: linux-watchdog, linux-kernel, George Cherian

devm_ioremap_resource check for a valid resource. Remove the unnecessary check.
Also group platform_get_resource and devm_ioremap_resource together for better
readability.

Signed-off-by: George Cherian <george.cherian@ti.com>
---
 drivers/watchdog/shwdt.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c
index d04d02b..08205d7 100644
--- a/drivers/watchdog/shwdt.c
+++ b/drivers/watchdog/shwdt.c
@@ -230,10 +230,6 @@ static int sh_wdt_probe(struct platform_device *pdev)
 	if (pdev->id != -1)
 		return -EINVAL;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (unlikely(!res))
-		return -EINVAL;
-
 	wdt = devm_kzalloc(&pdev->dev, sizeof(struct sh_wdt), GFP_KERNEL);
 	if (unlikely(!wdt))
 		return -ENOMEM;
@@ -249,6 +245,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
 		wdt->clk = NULL;
 	}
 
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	wdt->base = devm_ioremap_resource(wdt->dev, res);
 	if (IS_ERR(wdt->base))
 		return PTR_ERR(wdt->base);
-- 
1.8.3.1


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

* Re: [PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource()
  2014-06-10  4:40 [PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource() George Cherian
  2014-06-10  4:40 ` [PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource " George Cherian
  2014-06-10  4:40 ` [PATCH 3/3] watchdog: shwdt: Remove the unnecessary " George Cherian
@ 2014-06-10 19:23 ` Guenter Roeck
  2 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2014-06-10 19:23 UTC (permalink / raw)
  To: George Cherian; +Cc: wim, linux-watchdog, linux-kernel

On Tue, Jun 10, 2014 at 10:10:06AM +0530, George Cherian wrote:
> devm_ioremap_resource() checks for valid resource.
> Remove the un-necessary check after platform_get_resource().
> 
> Signed-off-by: George Cherian <george.cherian@ti.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

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

* Re: [PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource after platform_get_resource()
  2014-06-10  4:40 ` [PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource " George Cherian
@ 2014-06-10 19:23   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2014-06-10 19:23 UTC (permalink / raw)
  To: George Cherian; +Cc: wim, linux-watchdog, linux-kernel

On Tue, Jun 10, 2014 at 10:10:07AM +0530, George Cherian wrote:
> devm_ioremap_resource() checks for valid resource.
> Remove the un-necessary check after platform_get_resource().
> 
> Signed-off-by: George Cherian <george.cherian@ti.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

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

* Re: [PATCH 3/3] watchdog: shwdt: Remove the unnecessary check of resource after platform_get_resource()
  2014-06-10  4:40 ` [PATCH 3/3] watchdog: shwdt: Remove the unnecessary " George Cherian
@ 2014-06-10 19:24   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2014-06-10 19:24 UTC (permalink / raw)
  To: George Cherian; +Cc: wim, linux-watchdog, linux-kernel

On Tue, Jun 10, 2014 at 10:10:08AM +0530, George Cherian wrote:
> devm_ioremap_resource check for a valid resource. Remove the unnecessary check.
> Also group platform_get_resource and devm_ioremap_resource together for better
> readability.
> 
> Signed-off-by: George Cherian <george.cherian@ti.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

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

end of thread, other threads:[~2014-06-10 19:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-10  4:40 [PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource() George Cherian
2014-06-10  4:40 ` [PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource " George Cherian
2014-06-10 19:23   ` Guenter Roeck
2014-06-10  4:40 ` [PATCH 3/3] watchdog: shwdt: Remove the unnecessary " George Cherian
2014-06-10 19:24   ` Guenter Roeck
2014-06-10 19:23 ` [PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check " Guenter Roeck

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).