From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB76CC43217 for ; Wed, 12 Oct 2022 16:27:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230025AbiJLQ1U (ORCPT ); Wed, 12 Oct 2022 12:27:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbiJLQ1O (ORCPT ); Wed, 12 Oct 2022 12:27:14 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 202C0F87FC; Wed, 12 Oct 2022 09:27:08 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 29CGR5Ap081558; Wed, 12 Oct 2022 11:27:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1665592025; bh=eEflHbY1KhW3sZo2AHyNqzl4B6Y/mZETpmBCk/G9yGY=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=MLMfbwnQfXO7O0lfz9NY58tmwUQtsZnhkQuVASZBmQvQadbbP5+7vZ7/mvoGWNhzG yO1DmMfEqlyVppx3RQ0vcJ2bzjL0hxKRGgF8El0cJ67i4qRQkj4COP+gvMRfHXbdPg IFgCAbF5NgeGS31xLBT1yCkr/zXfniFgZ5OHeRIY= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 29CGR5Df015385 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 12 Oct 2022 11:27:05 -0500 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Wed, 12 Oct 2022 11:27:04 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Wed, 12 Oct 2022 11:27:05 -0500 Received: from [10.250.234.181] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 29CGR06C079753; Wed, 12 Oct 2022 11:27:01 -0500 Message-ID: Date: Wed, 12 Oct 2022 21:57:00 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH] counter: ti-ecap-capture: fix IS_ERR() vs NULL check Content-Language: en-US To: Dan Carpenter , Julien Panis CC: William Breathitt Gray , Greg Kroah-Hartman , , , References: From: Vignesh Raghavendra In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Hi, On 12/10/22 8:21 pm, Dan Carpenter wrote: > 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 Acked-by: Vignesh Raghavendra Thanks for the fix! > --- > 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;