From patchwork Tue Mar 7 19:33:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 65839 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2643751wrd; Tue, 7 Mar 2023 12:25:24 -0800 (PST) X-Google-Smtp-Source: AK7set8E9aJEkMBlXI3+cfO2J3iPgyALHcdkAfd5/cYh5ze3rVfV2MohNtKeUbjmaApW/F0IY4+k X-Received: by 2002:aa7:d910:0:b0:4ad:7c44:35fc with SMTP id a16-20020aa7d910000000b004ad7c4435fcmr13513913edr.6.1678220724723; Tue, 07 Mar 2023 12:25:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678220724; cv=none; d=google.com; s=arc-20160816; b=jjD9w4X7npY7/FHg0+mRu/OYAXMc5qgJ6CL9BsvjQa+KM8BwRn25giAhVuJW6/zQHP Cw9lJc1d8pZlQ3wbCJZCcUqN+gbi8BqKmHWbI6BaFUH0VokQTsuD7y24BgTr8tSitryk +gOHe9K5LqFtN4C4NSJxzh+ytBOUJEDhtZ6baTkXzqNvg30qgv37IFWK2njPDgg7utsm ggxF+XrpdI2+S3kFZUXBUhMxCpFQ7SGAmdbiIlKn+92D4jyRf1cb2NNKudqo9a95pNeH kCBDVaJkysj2VzxhBtBIObJHzU9w7gc44mgssUACUAm63tnoI88mP2s9J+0KuiHuSHgz ckqQ== 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=VZPQo90BF4za+2DxTnTfA4rqN5o7cRlXJuablQTN0vI=; b=dL/5HAjKc5YT8BYKbzdph/mO51MzgFYl4KpSHSTD4aS9jcQzf8NNBmU8W+pC7WNJK2 YkgZuab+z0fgJVqLsaeFischPkEBa0ds6b1b8aKAzwxbvkVYAmF0O5PLamWw3L1/Mj1v qzESui1iyn5oNkMuE/Nebf0tHu6WcQbrtku4B/MLYW8+ULosI8LOcGslmDSYJmoJNLjE QSftssJVlyU3O6u/1etzqmptisdUT0eO/lIeIqr1/HigvNeXvIv/Pulgr5ptgiYWrmT1 pLwLn7hti/qReZtnsKnGLnF6hFGznMkfRgSzzWp4yW0wnzO9y+qDtQB7hrJEXUgfS/HM xONw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=s3h3WlDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020a056402060800b004c180fc7861si2843815edv.357.2023.03.07.12.25.00; Tue, 07 Mar 2023 12:25:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=s3h3WlDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231700AbjCGTqI (ORCPT + 99 others); Tue, 7 Mar 2023 14:46:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232512AbjCGToe (ORCPT ); Tue, 7 Mar 2023 14:44:34 -0500 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 959DA9AFD2; Tue, 7 Mar 2023 11:33:52 -0800 (PST) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 327JXkLV129393; Tue, 7 Mar 2023 13:33:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678217626; bh=VZPQo90BF4za+2DxTnTfA4rqN5o7cRlXJuablQTN0vI=; h=From:To:CC:Subject:Date; b=s3h3WlDG9pUBA/NUm3vq1MQtBXYjRR+DzoctbMy4B8PC61IQOiCU/fPY5XNNRTeO/ d1AFt1+ue4ol9FOC3OOvhDZ36iWhgp9Q/6OYduT030cUjRuioM3ts4AZTxXcNXcsai DlhLlBXU/rA5ZvB/bWXhNqw2Zkcwf8/aMMYBOAXE= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 327JXkEA123433 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Mar 2023 13:33:46 -0600 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 7 Mar 2023 13:33:46 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 7 Mar 2023 13:33:46 -0600 Received: from ula0226330.dal.design.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 327JXkWm026389; Tue, 7 Mar 2023 13:33:46 -0600 From: Andrew Davis To: Peter Tyser , Andy Shevchenko , Linus Walleij , Bartosz Golaszewski CC: , , Andrew Davis Subject: [PATCH v2 1/6] gpio: ich: Use devm_gpiochip_add_data() to simplify remove path Date: Tue, 7 Mar 2023 13:33:41 -0600 Message-ID: <20230307193346.8718-1-afd@ti.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759741974376930210?= X-GMAIL-MSGID: =?utf-8?q?1759741974376930210?= Use devm version of gpiochip add function to handle removal for us. Signed-off-by: Andrew Davis --- drivers/gpio/gpio-ich.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c index 3b31f5e9bf40..0be9285efebc 100644 --- a/drivers/gpio/gpio-ich.c +++ b/drivers/gpio/gpio-ich.c @@ -457,7 +457,7 @@ static int ichx_gpio_probe(struct platform_device *pdev) init: ichx_gpiolib_setup(&ichx_priv.chip); - err = gpiochip_add_data(&ichx_priv.chip, NULL); + err = devm_gpiochip_add_data(dev, &ichx_priv.chip, NULL); if (err) { dev_err(dev, "Failed to register GPIOs\n"); return err; @@ -469,19 +469,11 @@ static int ichx_gpio_probe(struct platform_device *pdev) return 0; } -static int ichx_gpio_remove(struct platform_device *pdev) -{ - gpiochip_remove(&ichx_priv.chip); - - return 0; -} - static struct platform_driver ichx_gpio_driver = { .driver = { .name = DRV_NAME, }, .probe = ichx_gpio_probe, - .remove = ichx_gpio_remove, }; module_platform_driver(ichx_gpio_driver);