Skip to contentSkip to conversation

counter: microchip-tcb-capture: check the correct variable

PATCH In review Dan Carpenter 3 participants 3 messages Jul 27, 2020 – Sep 19, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 counter: microchip-tcb-capture: check the correct variable

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

---
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(-)
drivers/counter/microchip-tcb-capture.c +2 -2
index f7b7743ddb94..b7b252c5addf 100644
@@ -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");
Signature · 1 line
2.27.0
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

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")
Quoted 28 lines

---
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(-)
drivers/counter/microchip-tcb-capture.c +2 -2
index f7b7743ddb94..b7b252c5addf 100644
@@ -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");
Signature · 1 line
2.27.0
#2 lore raw
Quoted 8 lines · On Mon, 27 Jul 2020 08:28:25 -0400 William Breathitt Gray…
Quoted 5 lines · Dan Carpenter

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

Seems I applied this one a while back but never replied to this thread. Sorry about that!

Jonathan

Quoted 29 lines
Quoted 29 lines

---
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(-)
drivers/counter/microchip-tcb-capture.c +2 -2
index f7b7743ddb94..b7b252c5addf 100644
@@ -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");
Signature · 1 line
2.27.0