linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: s3c2410 nand: Remove uncessary null check
@ 2011-07-21  6:33 jhbird.choi at samsung.com
  2011-07-21  6:54 ` Varun Wadekar
  2011-07-22  8:27 ` Artem Bityutskiy
  0 siblings, 2 replies; 4+ messages in thread
From: jhbird.choi at samsung.com @ 2011-07-21  6:33 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jonghwan Choi <jhbird.choi@samsung.com>

clk_get() return a pointer to the struct clk or an ERR_PTR().

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
---
 drivers/mtd/nand/s3c2410.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 4405468..18ff2f5 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -723,7 +723,7 @@ static int s3c24xx_nand_remove(struct platform_device *pdev)
 
 	/* free the common resources */
 
-	if (info->clk != NULL && !IS_ERR(info->clk)) {
+	if (!IS_ERR(info->clk)) {
 		s3c2410_nand_clk_set_state(info, CLOCK_DISABLE);
 		clk_put(info->clk);
 	}
-- 
1.7.0

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

* [PATCH] mtd: s3c2410 nand: Remove uncessary null check
  2011-07-21  6:33 [PATCH] mtd: s3c2410 nand: Remove uncessary null check jhbird.choi at samsung.com
@ 2011-07-21  6:54 ` Varun Wadekar
  2011-07-21 17:10   ` Russell King - ARM Linux
  2011-07-22  8:27 ` Artem Bityutskiy
  1 sibling, 1 reply; 4+ messages in thread
From: Varun Wadekar @ 2011-07-21  6:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday 21 July 2011 12:03 PM, jhbird.choi at samsung.com wrote:
> From: Jonghwan Choi <jhbird.choi@samsung.com>
>
> clk_get() return a pointer to the struct clk or an ERR_PTR().
>
> Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
> ---
>  drivers/mtd/nand/s3c2410.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
> index 4405468..18ff2f5 100644
> --- a/drivers/mtd/nand/s3c2410.c
> +++ b/drivers/mtd/nand/s3c2410.c
> @@ -723,7 +723,7 @@ static int s3c24xx_nand_remove(struct platform_device *pdev)
>  
>  	/* free the common resources */
>  
> -	if (info->clk != NULL && !IS_ERR(info->clk)) {
> +	if (!IS_ERR(info->clk)) {

I think you should use IS_ERR_OR_NULL instead.
>  		s3c2410_nand_clk_set_state(info, CLOCK_DISABLE);
>  		clk_put(info->clk);
>  	}

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

* [PATCH] mtd: s3c2410 nand: Remove uncessary null check
  2011-07-21  6:54 ` Varun Wadekar
@ 2011-07-21 17:10   ` Russell King - ARM Linux
  0 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2011-07-21 17:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 21, 2011 at 12:24:12PM +0530, Varun Wadekar wrote:
> On Thursday 21 July 2011 12:03 PM, jhbird.choi at samsung.com wrote:
> > From: Jonghwan Choi <jhbird.choi@samsung.com>
> >
> > clk_get() return a pointer to the struct clk or an ERR_PTR().
> >
> > Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
> > ---
> >  drivers/mtd/nand/s3c2410.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
> > index 4405468..18ff2f5 100644
> > --- a/drivers/mtd/nand/s3c2410.c
> > +++ b/drivers/mtd/nand/s3c2410.c
> > @@ -723,7 +723,7 @@ static int s3c24xx_nand_remove(struct platform_device *pdev)
> >  
> >  	/* free the common resources */
> >  
> > -	if (info->clk != NULL && !IS_ERR(info->clk)) {
> > +	if (!IS_ERR(info->clk)) {
> 
> I think you should use IS_ERR_OR_NULL instead.

No.  Jonghwan Choi's patch is correct.

As per the patch description, the only error value which a driver can
attribute any problem with is something which passes IS_ERR().  Everything
else the driver must treat as a _valid_ struct clk - and the clk API
implementation must accept non-IS_ERR() clk_get() values.

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

* [PATCH] mtd: s3c2410 nand: Remove uncessary null check
  2011-07-21  6:33 [PATCH] mtd: s3c2410 nand: Remove uncessary null check jhbird.choi at samsung.com
  2011-07-21  6:54 ` Varun Wadekar
@ 2011-07-22  8:27 ` Artem Bityutskiy
  1 sibling, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2011-07-22  8:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2011-07-21 at 15:33 +0900, jhbird.choi at samsung.com wrote:
> From: Jonghwan Choi <jhbird.choi@samsung.com>
> 
> clk_get() return a pointer to the struct clk or an ERR_PTR().
> 
> Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>

Pushed to l2-mtd-2.6.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

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

end of thread, other threads:[~2011-07-22  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-21  6:33 [PATCH] mtd: s3c2410 nand: Remove uncessary null check jhbird.choi at samsung.com
2011-07-21  6:54 ` Varun Wadekar
2011-07-21 17:10   ` Russell King - ARM Linux
2011-07-22  8:27 ` Artem Bityutskiy

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