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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0FA52CA0EFC for ; Fri, 30 Aug 2024 10:34:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:CC:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=w4Jzaq0Y7/xiEjF91drQYyJ41nHthb2pShJ9sOCFt0I=; b=WSepA5+cXTH5ZLnZRWOnFv9+3S We84cZrSh1KvS2MCCurEr20y79RMGrBa0M0d3TGvBTBV4ELLESJX9CjihjNEY8Zwk4PAZi0DzKTmR fzH86JI7iR4IndrPRqppgF5S5yTAfym4qI7e722aMWN0O2iarkcloWQT+hvfX5DjhLrJfG61kox3+ k/EJvd5B6LTQc5IM7crW3wSlrauf6dxVGkkTiSRHU5rHREi3ElK22odUJqjq9LDeIoECrknE8ht/t zraeJI1WXKnOiq/VFU5He2tp8ky+vw/z/7tyoc9JvCSIntM5kCP6iazh5VO8/kvzKKT/nHnRfxuR2 2jgglMAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjywx-00000005qhQ-3I3J; Fri, 30 Aug 2024 10:33:51 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjyvE-00000005qKZ-21xK for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2024 10:32:05 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47UAVuu3060179; Fri, 30 Aug 2024 05:31:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1725013916; bh=w4Jzaq0Y7/xiEjF91drQYyJ41nHthb2pShJ9sOCFt0I=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=PT4RcJEE65NDkJrya4c9jfSR8fxM7HxzF757dvi8J5N2NdZotmhGddsdeo8skRxYw vpVCIbe5DnIp2qNmqxGbNYI7xbdUplGTDw3Dt2eutcOKz9l/MseOJC/PQ8I4VM/lO0 Tu2ZrOfYiqvg45fD7tcApFRdEwi7X0oGJMFxyc9M= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47UAVuvu032558 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 30 Aug 2024 05:31:56 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 30 Aug 2024 05:31:55 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 30 Aug 2024 05:31:55 -0500 Received: from localhost (uda0133052.dhcp.ti.com [128.247.81.232]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47UAVtJ4116324; Fri, 30 Aug 2024 05:31:55 -0500 Date: Fri, 30 Aug 2024 05:31:55 -0500 From: Nishanth Menon To: Jinjie Ruan CC: , , , , Subject: Re: [PATCH -next v2 2/4] soc: ti: knav_dma: Use dev_err_probe() to simplfy code Message-ID: <20240830103155.5vs2hdokw6yysq47@finance> References: <20240830063228.3519385-1-ruanjinjie@huawei.com> <20240830063228.3519385-3-ruanjinjie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240830063228.3519385-3-ruanjinjie@huawei.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240830_033204_673157_C6E302BF X-CRM114-Status: GOOD ( 18.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 14:32-20240830, Jinjie Ruan wrote: > Use the dev_err_probe() helper to simplify error handling > during probe. > > Signed-off-by: Jinjie Ruan > --- > v2: > - Split into 2 patches. > --- > drivers/soc/ti/knav_dma.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/drivers/soc/ti/knav_dma.c b/drivers/soc/ti/knav_dma.c > index 15e41d3a5e22..eeec422a46f0 100644 > --- a/drivers/soc/ti/knav_dma.c > +++ b/drivers/soc/ti/knav_dma.c > @@ -708,17 +708,13 @@ static int knav_dma_probe(struct platform_device *pdev) > struct device_node *node = pdev->dev.of_node; > int ret = 0; > > - if (!node) { > - dev_err(&pdev->dev, "could not find device info\n"); > - return -EINVAL; > - } > + if (!node) > + return dev_err_probe(&pdev->dev, -EINVAL, "could not find device info\n"); > > kdev = devm_kzalloc(dev, > sizeof(struct knav_dma_pool_device), GFP_KERNEL); > - if (!kdev) { > - dev_err(dev, "could not allocate driver mem\n"); > - return -ENOMEM; > - } > + if (!kdev) > + return dev_err_probe(dev, -ENOMEM, "could not allocate driver mem\n"); These make no sense to me :( -> just using dev_err_probe when there is no chance of -EPROBE_DEFER ? > > kdev->dev = dev; > INIT_LIST_HEAD(&kdev->list); > -- > 2.34.1 > -- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D