From patchwork Tue Mar 7 16:54:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 65737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2549318wrd; Tue, 7 Mar 2023 09:11:52 -0800 (PST) X-Google-Smtp-Source: AK7set9PjE21OeZPdj7a1l9GzIRI6Ef+9R7EaVI4kPP/XrQ10RaHzorwgPy8v9y+H9FfCXp1qF+Q X-Received: by 2002:a05:6a20:244d:b0:cc:e39e:3f64 with SMTP id t13-20020a056a20244d00b000cce39e3f64mr14496435pzc.24.1678209112064; Tue, 07 Mar 2023 09:11:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678209112; cv=none; d=google.com; s=arc-20160816; b=bXzWDgN9CGqf4j+WrGN0CjNFwEDqUs6g0MRuibo20UAXj8H0gAvRnt3hvsufmzU1EI blhWxGmXDY0y9Bl7kTdP/WwLV4bawAtTccWiq6uWTPqBAJnChFW0pulQSTI8ez3tQUJP /fsGettXSO7wipXYkVWNLuTjJiLD4YBaq8c8QsaScZuSlyWCrSavRiI0SvaB+29XEPH1 xUM1MrAasUgvbyziG9J5uK+oz0qOOk7VfrK6e88t4EMJbdrRZxmafkXuAAxzGjwwZ7Zb dzz770IH0x1U5zPxmvZpvOIcnBzP98p39J/CNU7GRicRHgov4djxvzUlz3gjCWwHJYEq 3a3g== 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=D01harnL6V0RgYvUQtiBS98fge5GZHYNx2aNecDTp0A6jpEqfqauc1U1Ydrp+T+pBz Jhn9fNoqHZMTgN8taL2lytQEUnd0f6rh/Wp6S6yF5kF4hrXsLGXrskyOfi1zk7nRjSAu EmC08H4DnBZphHgbODRHDDg9C06BbCYORpA/rdV68vKls3TbJIFKfSLx97dYxsH/KFoc 2Dr0ZkVJ7/WBN58DSdLRig1JVQ20FGWzkoed0jew4eolCudWVvSncR80YsDYTAw839lS YMgpza90biI4zTMYDr/9MwcKJRwl7fz2EuZ3dd0Qo7RfkY/sBJsVeyD0xph2iLhu9pA8 YSFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=U+Jmhvfm; 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 e4-20020a630f04000000b00502f0d2abc5si11998225pgl.725.2023.03.07.09.11.38; Tue, 07 Mar 2023 09:11:52 -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=U+Jmhvfm; 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 S230054AbjCGQ7Y (ORCPT + 99 others); Tue, 7 Mar 2023 11:59:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229646AbjCGQ6J (ORCPT ); Tue, 7 Mar 2023 11:58:09 -0500 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F0B2943A1; Tue, 7 Mar 2023 08:54:38 -0800 (PST) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 327GsXD5127685; Tue, 7 Mar 2023 10:54:33 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678208073; bh=VZPQo90BF4za+2DxTnTfA4rqN5o7cRlXJuablQTN0vI=; h=From:To:CC:Subject:Date; b=U+Jmhvfm3a02KUH7GhfTKexvlwiZYJxz1U9AY25GLVhaisG+AEjBMaZ4DFCnNh6TH LiVdbkVvknuwVRjyuB9YqMWJq1AsJn6JtslAZXLrgj4yJc2SFcvXBXF8Llapj/BYpu uWkFMgzA76cIWaNGHr6G1FITuYNuBaFLcbWh68Yg= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 327GsXaw073156 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Mar 2023 10:54:33 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE109.ent.ti.com (10.64.6.30) 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 10:54:32 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE103.ent.ti.com (10.64.6.24) 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 10:54:32 -0600 Received: from ula0226330.dal.design.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 327GsWdS084852; Tue, 7 Mar 2023 10:54:32 -0600 From: Andrew Davis To: Peter Tyser , Andy Shevchenko , Linus Walleij , Bartosz Golaszewski CC: , , Andrew Davis Subject: [PATCH 1/6] gpio: ich: Use devm_gpiochip_add_data() to simplify remove path Date: Tue, 7 Mar 2023 10:54:27 -0600 Message-ID: <20230307165432.25484-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?1759729797819539357?= X-GMAIL-MSGID: =?utf-8?q?1759729797819539357?= 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);