summaryrefslogtreecommitdiffstats
path: root/drivers/counter
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-07-27 14:23:16 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-08-22 11:38:42 +0100
commitab3300deff6a81cc10887437383fc8a63884c3f9 (patch)
treea4ffcfc49a82aa512deb53d9324262456b42cd45 /drivers/counter
parent336306790b2bbf7ce837625fa3b24ba724d05838 (diff)
downloadlinux-stable-ab3300deff6a81cc10887437383fc8a63884c3f9.tar.gz
linux-stable-ab3300deff6a81cc10887437383fc8a63884c3f9.tar.bz2
linux-stable-ab3300deff6a81cc10887437383fc8a63884c3f9.zip
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") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/counter')
-rw-r--r--drivers/counter/microchip-tcb-capture.c4
1 files 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");