From patchwork Tue Mar 7 19:33:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 65847 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2646346wrd; Tue, 7 Mar 2023 12:31:10 -0800 (PST) X-Google-Smtp-Source: AK7set/fUcUcHH1GtGoG09M0C2EMtECF+MNGzfPg/+DIsGBtsawHxae02NWRL1pDFgYQ21hQ7z16 X-Received: by 2002:a05:6a20:1447:b0:cd:87ef:3f33 with SMTP id a7-20020a056a20144700b000cd87ef3f33mr20498579pzi.29.1678221069991; Tue, 07 Mar 2023 12:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678221069; cv=none; d=google.com; s=arc-20160816; b=A/O5eff3/5/MXO7BO3CFvLeU9cSegIMrhAZ6NJTo/0mGIkYPHQZzN6pNNmSlEHelOK 5g6Lqq1gEpZaBIaVRNT3jmqQ4PhH7BzhEICn2GEbGJG/stwZ1Dn0cxZgzfaKHefQPWvu BMUy5SKasrILNGoGvU2mcNvTtEFqDMQgVQYy1P4TXbwB00C/KYwfP6yBvmLwtCzcen8l Wi4NWtMEcoKw6HQ3gPAcnVtp5j/cFHuqwECCrhqj07epIlZnPOLcTLt/pGDhSZIz/l31 herkgD5U2/rVaNGAXKh945yWESM8NCJbC8DnBJlOMzXm448jmIGKeRQezbx3ApZUjNUx c+kA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZZ2CX0VbEpPFPtwgXxUtM9c1eVceTlwlTZUDyoR3v1Y=; b=FaBchefMvGeFptBWsnjPDEJtxF5x5PGaeYv25YKAwa8ja4yww43DHwMfYZXev2K5ab PRaAGrAyyDKBRSY2sdEIVzfSI6UfHHdFcBBqJAqRvUKYKi9tqKFF3vCMF5DE5aV9JYJh tLXbV7KTsLvfVsBibH+qAbq1iF0R0Ql/BJIRgw9q5yGE3zIpdauFxpsfHZKVQ6KByl/K dwd8+0ntYwS612i+jIB/aadKrQjowROdaAVmnhb6nVDFRMh5k5/+f6j7TSIxuHFoRPmT S9Xl9L/dMl4qT6Cr+RWqBHH+9TrI3dv9asM3k2oFo2Kl4Yjq1X0JH3Yei5gjT/A3z8lA Kp9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=bNl9+8uq; 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 65-20020a630244000000b004fb64c27835si12245282pgc.524.2023.03.07.12.30.57; Tue, 07 Mar 2023 12:31:09 -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=bNl9+8uq; 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 S229890AbjCGTpw (ORCPT + 99 others); Tue, 7 Mar 2023 14:45:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231936AbjCGTod (ORCPT ); Tue, 7 Mar 2023 14:44:33 -0500 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3023984CD; Tue, 7 Mar 2023 11:33:51 -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 327JXlRV032057; Tue, 7 Mar 2023 13:33:47 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1678217627; bh=ZZ2CX0VbEpPFPtwgXxUtM9c1eVceTlwlTZUDyoR3v1Y=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=bNl9+8uqN53pjLIupqoy/oH95usAq5iHt1SAZA5xK/EAbqhQapiX/52A/0RBumICm XHfvxY305hPCuHu8+SqYaeLMQtb795U5YV1MREGR649P3KZY+/X3SAYfLCmUHGXBH/ LyHp8AQrbpS/IWw4tRphgftFtqj8RKymQGcv/l5s= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 327JXlGm022502 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Mar 2023 13:33:47 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE110.ent.ti.com (10.64.6.31) 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 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 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 327JXkWr026389; 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 6/6] gpio: tps65086: Use devm_gpiochip_add_data() to simplify remove path Date: Tue, 7 Mar 2023 13:33:46 -0600 Message-ID: <20230307193346.8718-6-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307193346.8718-1-afd@ti.com> References: <20230307193346.8718-1-afd@ti.com> 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?1759742336929455936?= X-GMAIL-MSGID: =?utf-8?q?1759742336929455936?= Use devm version of gpiochip add function to handle removal for us. While here update copyright and module author. Signed-off-by: Andrew Davis --- drivers/gpio/gpio-tps65086.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/gpio/gpio-tps65086.c b/drivers/gpio/gpio-tps65086.c index 1e9d8262d0ff..0b8b631441ae 100644 --- a/drivers/gpio/gpio-tps65086.c +++ b/drivers/gpio/gpio-tps65086.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ - * Andrew F. Davis + * Copyright (C) 2015-2023 Texas Instruments Incorporated - https://www.ti.com/ + * Andrew Davis * * Based on the TPS65912 driver */ @@ -86,13 +86,11 @@ static int tps65086_gpio_probe(struct platform_device *pdev) if (!gpio) return -ENOMEM; - platform_set_drvdata(pdev, gpio); - gpio->tps = dev_get_drvdata(pdev->dev.parent); gpio->chip = template_chip; gpio->chip.parent = gpio->tps->dev; - ret = gpiochip_add_data(&gpio->chip, gpio); + ret = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio); if (ret < 0) { dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret); return ret; @@ -101,15 +99,6 @@ static int tps65086_gpio_probe(struct platform_device *pdev) return 0; } -static int tps65086_gpio_remove(struct platform_device *pdev) -{ - struct tps65086_gpio *gpio = platform_get_drvdata(pdev); - - gpiochip_remove(&gpio->chip); - - return 0; -} - static const struct platform_device_id tps65086_gpio_id_table[] = { { "tps65086-gpio", }, { /* sentinel */ } @@ -121,11 +110,10 @@ static struct platform_driver tps65086_gpio_driver = { .name = "tps65086-gpio", }, .probe = tps65086_gpio_probe, - .remove = tps65086_gpio_remove, .id_table = tps65086_gpio_id_table, }; module_platform_driver(tps65086_gpio_driver); -MODULE_AUTHOR("Andrew F. Davis "); +MODULE_AUTHOR("Andrew Davis "); MODULE_DESCRIPTION("TPS65086 GPIO driver"); MODULE_LICENSE("GPL v2");