Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp142918rdb; Thu, 16 Nov 2023 14:31:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4GTeaNInW+qksUA0CudbRhiQrB8jaDaeWVOFpJNpoHtQaH366kZCTxLpv/36A6Nfr5+SR X-Received: by 2002:a05:6a21:1a0:b0:187:dadd:7e9d with SMTP id le32-20020a056a2101a000b00187dadd7e9dmr2508062pzb.10.1700173897345; Thu, 16 Nov 2023 14:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700173897; cv=none; d=google.com; s=arc-20160816; b=SobODHqwMnJPtoY4mM0dUrSWEns0T6V6CrsmRtigXidlKfxt59/f5s500FdMDZ3mpH WUoozbE9HGjgS9YNuXwLkA30TCsB5tjm0KFXGYxz05q3X4BwZLCMjS4zpArJU481Pn25 xtFYd/wHM21F8NLf/Jrkb22RupHRG3Taid8ZquC//4IatL1JNq5zjS0S6TfQAKy4YJMi gDjcFfteDg4b/j3CHUSPw6nmKLnI0tgfBkz0CvGEEkarYf7XuCk4WKv/9vsIYGIeOcvw XgMiCiw+3ece5iniNHYQchPHsJI85tWVy3Uew1GNVqhATLLlnckmFNvmiNk/FcusIGh3 uveg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=53MWMbTaJs5GbSNSY78WEVCLzsf+daLjAhhWbSNVocM=; fh=oN8far74St4uI1dghv7FLXx5//4s0YYcqKYb17on5hQ=; b=1C42zJzDJ6pAYxq22To+ghT2F8viarob6Kb4nqV/gXIaAGD8YiiCfbKDMwyeKcwRlx KPtmE6BIilCNC/kVI75WykzCxjJKBnpHXLFdPJ2aG6ThN+iatusDo9pan2yPYy1/V9u0 0sIY1a5V1G8pSzgjQ8PhRZlCsIzRBK2jT1hr24ddyJpGK/SKObcLtSRbQDvE3+ts89YD LcYELG/KvtWnc4kmxVKWkZ7hCxgDRxLfpUOg3QrgMyK7lNN0hY6paIlj2hp3/EGCkdjH 9NQ1a3ofnZqH2UobJBJhn2rCkQeZkaAvUvpLRrCNv4xGBoXIr3KbqUAgrpxpppEOZv9D 1QsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kGXPTGI9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id f2-20020a631f02000000b005b96af23fe6si380459pgf.284.2023.11.16.14.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 14:31:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kGXPTGI9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 464F3809C1A2; Thu, 16 Nov 2023 14:31:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229745AbjKPWa6 (ORCPT + 99 others); Thu, 16 Nov 2023 17:30:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbjKPWa5 (ORCPT ); Thu, 16 Nov 2023 17:30:57 -0500 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86262C5; Thu, 16 Nov 2023 14:30:52 -0800 (PST) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3AGMUlIm030689; Thu, 16 Nov 2023 16:30:47 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1700173847; bh=53MWMbTaJs5GbSNSY78WEVCLzsf+daLjAhhWbSNVocM=; h=From:To:CC:Subject:Date; b=kGXPTGI9rs5bdB3z9sDKVC3MaspMLYpptZh/nSvxh5rT4vUiRSHbDb+6GMMJpfvpl w3/QtO8uSgpa4CNUf6FTu3Zp/16VcswwB69V64CtamRud01cXM6Njc6YIleqblXEus rD633DWzwbxyCOfAz+ePQMbjjMezo1R2E6Kn+2uU= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3AGMUlRO049401 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 16 Nov 2023 16:30:47 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 16 Nov 2023 16:30:47 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE100.ent.ti.com (10.64.6.21) 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; Thu, 16 Nov 2023 16:30:47 -0600 Received: from lelv0327.itg.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3AGMUkKq024789; Thu, 16 Nov 2023 16:30:46 -0600 From: Andrew Davis To: Andy Shevchenko , Linus Walleij , Bartosz Golaszewski CC: , , Andrew Davis Subject: [PATCH] pinctrl: as3722: Use devm_gpiochip_add_data() to simplify remove path Date: Thu, 16 Nov 2023 16:30:45 -0600 Message-ID: <20231116223045.274211-1-afd@ti.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 16 Nov 2023 14:31:11 -0800 (PST) Use devm version of gpiochip add function to handle removal for us. Signed-off-by: Andrew Davis --- drivers/pinctrl/pinctrl-as3722.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c index 6a5f23cf7a2a2..0d8c75ce20eda 100644 --- a/drivers/pinctrl/pinctrl-as3722.c +++ b/drivers/pinctrl/pinctrl-as3722.c @@ -542,7 +542,6 @@ static int as3722_pinctrl_probe(struct platform_device *pdev) as_pci->dev = &pdev->dev; as_pci->as3722 = dev_get_drvdata(pdev->dev.parent); - platform_set_drvdata(pdev, as_pci); as_pci->pins = as3722_pins_desc; as_pci->num_pins = ARRAY_SIZE(as3722_pins_desc); @@ -562,7 +561,7 @@ static int as3722_pinctrl_probe(struct platform_device *pdev) as_pci->gpio_chip = as3722_gpio_chip; as_pci->gpio_chip.parent = &pdev->dev; - ret = gpiochip_add_data(&as_pci->gpio_chip, as_pci); + ret = devm_gpiochip_add_data(&pdev->dev, &as_pci->gpio_chip, as_pci); if (ret < 0) { dev_err(&pdev->dev, "Couldn't register gpiochip, %d\n", ret); return ret; @@ -572,21 +571,10 @@ static int as3722_pinctrl_probe(struct platform_device *pdev) 0, 0, AS3722_PIN_NUM); if (ret < 0) { dev_err(&pdev->dev, "Couldn't add pin range, %d\n", ret); - goto fail_range_add; + return ret; } return 0; - -fail_range_add: - gpiochip_remove(&as_pci->gpio_chip); - return ret; -} - -static void as3722_pinctrl_remove(struct platform_device *pdev) -{ - struct as3722_pctrl_info *as_pci = platform_get_drvdata(pdev); - - gpiochip_remove(&as_pci->gpio_chip); } static const struct of_device_id as3722_pinctrl_of_match[] = { @@ -601,7 +589,6 @@ static struct platform_driver as3722_pinctrl_driver = { .of_match_table = as3722_pinctrl_of_match, }, .probe = as3722_pinctrl_probe, - .remove_new = as3722_pinctrl_remove, }; module_platform_driver(as3722_pinctrl_driver); -- 2.39.2