public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource()
@ 2014-07-16 13:19 George Cherian
  2014-07-16 13:19 ` [RESEND PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource " George Cherian
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: George Cherian @ 2014-07-16 13:19 UTC (permalink / raw)
  To: linux-watchdog, linux-kernel; +Cc: wim, 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>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
 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] 5+ messages in thread

* [RESEND PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource after platform_get_resource()
  2014-07-16 13:19 [RESEND PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource() George Cherian
@ 2014-07-16 13:19 ` George Cherian
  2014-07-16 13:19 ` [RESEND PATCH 3/3] watchdog: shwdt: Remove the unnecessary " George Cherian
  2014-07-16 13:26 ` [RESEND PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check " Guenter Roeck
  2 siblings, 0 replies; 5+ messages in thread
From: George Cherian @ 2014-07-16 13:19 UTC (permalink / raw)
  To: linux-watchdog, linux-kernel; +Cc: wim, 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>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
 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] 5+ messages in thread

* [RESEND PATCH 3/3] watchdog: shwdt: Remove the unnecessary check of resource after platform_get_resource()
  2014-07-16 13:19 [RESEND PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource() George Cherian
  2014-07-16 13:19 ` [RESEND PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource " George Cherian
@ 2014-07-16 13:19 ` George Cherian
  2014-07-16 13:26 ` [RESEND PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check " Guenter Roeck
  2 siblings, 0 replies; 5+ messages in thread
From: George Cherian @ 2014-07-16 13:19 UTC (permalink / raw)
  To: linux-watchdog, linux-kernel; +Cc: wim, 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>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
 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 061756e..fa89bb3 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] 5+ messages in thread

* Re: [RESEND PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource()
  2014-07-16 13:19 [RESEND PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource() George Cherian
  2014-07-16 13:19 ` [RESEND PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource " George Cherian
  2014-07-16 13:19 ` [RESEND PATCH 3/3] watchdog: shwdt: Remove the unnecessary " George Cherian
@ 2014-07-16 13:26 ` Guenter Roeck
  2014-07-16 13:34   ` George Cherian
  2 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2014-07-16 13:26 UTC (permalink / raw)
  To: George Cherian, linux-watchdog, linux-kernel; +Cc: wim

On 07/16/2014 06:19 AM, 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>

All three patches have my Reviewed-by: tag and are in my watchdog-next branch.
Of course that does not guarantee that Wim will pick them up, but it is quite
likely.

Guenter

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


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

* Re: [RESEND PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource()
  2014-07-16 13:26 ` [RESEND PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check " Guenter Roeck
@ 2014-07-16 13:34   ` George Cherian
  0 siblings, 0 replies; 5+ messages in thread
From: George Cherian @ 2014-07-16 13:34 UTC (permalink / raw)
  To: Guenter Roeck, linux-watchdog, linux-kernel; +Cc: wim

Hi Guenter,

On 7/16/2014 6:56 PM, Guenter Roeck wrote:
> On 07/16/2014 06:19 AM, 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>
>
> All three patches have my Reviewed-by: tag and are in my watchdog-next 
> branch.
> Of course that does not guarantee that Wim will pick them up, but it 
> is quite
> likely.
Thanks for the update.
>
> Guenter
>


-- 
-George


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

end of thread, other threads:[~2014-07-16 13:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-16 13:19 [RESEND PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check after platform_get_resource() George Cherian
2014-07-16 13:19 ` [RESEND PATCH 2/3] watchdog: lantiq_wdt: Remove the un-necessary check of resource " George Cherian
2014-07-16 13:19 ` [RESEND PATCH 3/3] watchdog: shwdt: Remove the unnecessary " George Cherian
2014-07-16 13:26 ` [RESEND PATCH 1/3] watchdog: dw_wdt: Remove the un-necessary check " Guenter Roeck
2014-07-16 13:34   ` George Cherian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox