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 211C8C7EE25 for ; Tue, 16 May 2023 15:20:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232434AbjEPPUD (ORCPT ); Tue, 16 May 2023 11:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233883AbjEPPT6 (ORCPT ); Tue, 16 May 2023 11:19:58 -0400 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C07875FCF; Tue, 16 May 2023 08:19:56 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 34GFJqWt046666; Tue, 16 May 2023 10:19:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1684250392; bh=ZtK7bitluym8dquTleK8XBZNEctGa+MQrAshFu2wJYI=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=BKTo913v/xrQIY6Yw5sihWIYeFGfe6UhhcpA6GTesCI0tlROadOWA4f1APxz7sgQW 1VqOQr7NByKaaxkbBu9fheyqoYp51rpgPn/fgsjSWDWW5qGWJ4ngsVePIrzwtLu9ps /cd0gxOpxhdx8/DrCGI5yQks5tHhSOHQ1V/YT9do= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 34GFJqrn103503 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 16 May 2023 10:19:52 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 16 May 2023 10:19:52 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE101.ent.ti.com (157.170.170.31) 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; Tue, 16 May 2023 10:19:52 -0500 Received: from [10.250.35.184] (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 34GFJpk4059866; Tue, 16 May 2023 10:19:52 -0500 Message-ID: Date: Tue, 16 May 2023 10:19:51 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v3] gpio: sch311x: Use devm_gpiochip_add_data() to simplify remove path Content-Language: en-US To: Andy Shevchenko CC: Peter Tyser , Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , , References: <20230515174224.494631-1-afd@ti.com> From: Andrew Davis In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On 5/15/23 4:08 PM, Andy Shevchenko wrote: > On Mon, May 15, 2023 at 8:42 PM Andrew Davis wrote: >> >> Use devm version of gpiochip add function to handle removal for us. > > ...version of gpiochip_add() function... > > ... > >> + err = devm_gpiochip_add_data(&pdev->dev, &block->chip, block); >> if (err < 0) { >> dev_err(&pdev->dev, >> "Could not register gpiochip, %d\n", err); >> - goto exit_err; >> + return err; > > With this applied you can consider a followup to have this be converted to use > > return dev_err_probe(...); > > here and in other ->probe() related pieces. > Sure, I can add that cleanup to my list. Or maybe Coccinelle can help do this everywhere, will have to look into that. Andrew >> } >