public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check
@ 2022-10-12 14:51 Dan Carpenter
  2022-10-12 15:43 ` Julien Panis
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2022-10-12 14:51 UTC (permalink / raw)
  To: Vignesh Raghavendra, Julien Panis
  Cc: William Breathitt Gray, Greg Kroah-Hartman, linux-iio, linux-omap,
	kernel-janitors

The devm_counter_alloc() function returns NULL on error.  It doesn't
return error pointers.

Fixes: 4e2f42aa00b6 ("counter: ti-ecap-capture: capture driver support for ECAP")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/counter/ti-ecap-capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/counter/ti-ecap-capture.c b/drivers/counter/ti-ecap-capture.c
index af10de30aba5..8104d02bb5a4 100644
--- a/drivers/counter/ti-ecap-capture.c
+++ b/drivers/counter/ti-ecap-capture.c
@@ -479,8 +479,8 @@ static int ecap_cnt_probe(struct platform_device *pdev)
 	int ret;
 
 	counter_dev = devm_counter_alloc(dev, sizeof(*ecap_dev));
-	if (IS_ERR(counter_dev))
-		return PTR_ERR(counter_dev);
+	if (!counter_dev)
+		return -ENOMEM;
 
 	counter_dev->name = ECAP_DRV_NAME;
 	counter_dev->parent = dev;
-- 
2.35.1


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

end of thread, other threads:[~2022-10-13 14:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-12 14:51 [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check Dan Carpenter
2022-10-12 15:43 ` Julien Panis
2022-10-12 16:27 ` Vignesh Raghavendra
2022-10-13  0:50 ` William Breathitt Gray

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