linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] counter: microchip-tcb-capture: check the correct variable
@ 2020-07-27 11:23 Dan Carpenter
  2020-07-27 12:28 ` William Breathitt Gray
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2020-07-27 11:23 UTC (permalink / raw)
  To: William Breathitt Gray, Kamel Bouhara
  Cc: Jonathan Cameron, linux-iio, linux-kernel, kernel-janitors

This should be testing "regmap" instead of "priv->regmap".  The
"priv->regmap" variable is always zero so it's not an error pointer.

Fixes: 106b104137fd ("counter: Add microchip TCB capture counter")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
The commit 106b104137fd ("counter: Add microchip TCB capture counter")
doesn't use the correct patch prefix.  This is a common mistake for the
the first commit which adds the driver.  There is no kernel wide
standard for patch prefixes so it's difficult for people sending fixes
to know the correct prefix should be.

 drivers/counter/microchip-tcb-capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
index f7b7743ddb94..b7b252c5addf 100644
--- a/drivers/counter/microchip-tcb-capture.c
+++ b/drivers/counter/microchip-tcb-capture.c
@@ -320,8 +320,8 @@ static int mchp_tc_probe(struct platform_device *pdev)
 	}
 
 	regmap = syscon_node_to_regmap(np->parent);
-	if (IS_ERR(priv->regmap))
-		return PTR_ERR(priv->regmap);
+	if (IS_ERR(regmap))
+		return PTR_ERR(regmap);
 
 	/* max. channels number is 2 when in QDEC mode */
 	priv->num_channels = of_property_count_u32_elems(np, "reg");
-- 
2.27.0


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

* Re: [PATCH] counter: microchip-tcb-capture: check the correct variable
  2020-07-27 11:23 [PATCH] counter: microchip-tcb-capture: check the correct variable Dan Carpenter
@ 2020-07-27 12:28 ` William Breathitt Gray
  2020-09-19 15:36   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: William Breathitt Gray @ 2020-07-27 12:28 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Dan Carpenter, Kamel Bouhara, linux-iio, linux-kernel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1498 bytes --]

On Mon, Jul 27, 2020 at 02:23:16PM +0300, Dan Carpenter wrote:
> This should be testing "regmap" instead of "priv->regmap".  The
> "priv->regmap" variable is always zero so it's not an error pointer.
> 
> Fixes: 106b104137fd ("counter: Add microchip TCB capture counter")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>

> ---
> The commit 106b104137fd ("counter: Add microchip TCB capture counter")
> doesn't use the correct patch prefix.  This is a common mistake for the
> the first commit which adds the driver.  There is no kernel wide
> standard for patch prefixes so it's difficult for people sending fixes
> to know the correct prefix should be.
> 
>  drivers/counter/microchip-tcb-capture.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
> index f7b7743ddb94..b7b252c5addf 100644
> --- a/drivers/counter/microchip-tcb-capture.c
> +++ b/drivers/counter/microchip-tcb-capture.c
> @@ -320,8 +320,8 @@ static int mchp_tc_probe(struct platform_device *pdev)
>  	}
>  
>  	regmap = syscon_node_to_regmap(np->parent);
> -	if (IS_ERR(priv->regmap))
> -		return PTR_ERR(priv->regmap);
> +	if (IS_ERR(regmap))
> +		return PTR_ERR(regmap);
>  
>  	/* max. channels number is 2 when in QDEC mode */
>  	priv->num_channels = of_property_count_u32_elems(np, "reg");
> -- 
> 2.27.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] counter: microchip-tcb-capture: check the correct variable
  2020-07-27 12:28 ` William Breathitt Gray
@ 2020-09-19 15:36   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2020-09-19 15:36 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: Jonathan Cameron, Dan Carpenter, Kamel Bouhara, linux-iio,
	linux-kernel, kernel-janitors

On Mon, 27 Jul 2020 08:28:25 -0400
William Breathitt Gray <vilhelm.gray@gmail.com> wrote:

> On Mon, Jul 27, 2020 at 02:23:16PM +0300, Dan Carpenter wrote:
> > This should be testing "regmap" instead of "priv->regmap".  The
> > "priv->regmap" variable is always zero so it's not an error pointer.
> > 
> > Fixes: 106b104137fd ("counter: Add microchip TCB capture counter")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>  
> 
> Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Seems I applied this one a while back but never replied to this thread.
Sorry about that!

Jonathan

> 
> > ---
> > The commit 106b104137fd ("counter: Add microchip TCB capture counter")
> > doesn't use the correct patch prefix.  This is a common mistake for the
> > the first commit which adds the driver.  There is no kernel wide
> > standard for patch prefixes so it's difficult for people sending fixes
> > to know the correct prefix should be.
> > 
> >  drivers/counter/microchip-tcb-capture.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
> > index f7b7743ddb94..b7b252c5addf 100644
> > --- a/drivers/counter/microchip-tcb-capture.c
> > +++ b/drivers/counter/microchip-tcb-capture.c
> > @@ -320,8 +320,8 @@ static int mchp_tc_probe(struct platform_device *pdev)
> >  	}
> >  
> >  	regmap = syscon_node_to_regmap(np->parent);
> > -	if (IS_ERR(priv->regmap))
> > -		return PTR_ERR(priv->regmap);
> > +	if (IS_ERR(regmap))
> > +		return PTR_ERR(regmap);
> >  
> >  	/* max. channels number is 2 when in QDEC mode */
> >  	priv->num_channels = of_property_count_u32_elems(np, "reg");
> > -- 
> > 2.27.0
> >   


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

end of thread, other threads:[~2020-09-19 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 11:23 [PATCH] counter: microchip-tcb-capture: check the correct variable Dan Carpenter
2020-07-27 12:28 ` William Breathitt Gray
2020-09-19 15:36   ` Jonathan Cameron

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