Message ID | 20230307193346.8718-3-afd@ti.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2633110wrd; Tue, 7 Mar 2023 12:02:09 -0800 (PST) X-Google-Smtp-Source: AK7set+j0DGBL1zDhEE/IojdkY461lA/95QnT+EvT7d4HrYyKYYEmpUC7Gx9ZRKwyfqMj4jyHIgf X-Received: by 2002:a17:906:3197:b0:8b1:3293:ead2 with SMTP id 23-20020a170906319700b008b13293ead2mr16608909ejy.25.1678219329727; Tue, 07 Mar 2023 12:02:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678219329; cv=none; d=google.com; s=arc-20160816; b=U5azw9Rf0zmje3kfiD40CXrU8zpGzesIi2XEvBJFCYwpz8yiibV0HnrZoOWnDIe98d eT/hZeViNmyFtLhKN2VsvH7nBHQMZFAnufkLr/+u9/194Q8ah6v8O/pzshWTHJmI8SRk 8sTqcF6SaXa7UjdpHQ3ZHAmTDm2mvTdgzoyapLBHNKAzdEW5dtg5+0IqLmdgfjxS2ujt b4JCHsblNoThvi1tGLNMXFRHeohLGsxiUCKQWlCwtqjlD8HH3pvCxGmOvKC+uZhpiAOz EfoTOF+dMi7AVHC6oZuibEbaTIj9pmYIYZYNP7Qs6BWFPQcuA8ColSCHrV7DOe5NNTlu C/PA== 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=2QKk8MDasC9TQp6Y/MGWR5Z7h/GdVQwRLQTrVMYwwAU=; b=0+/19syKTYLczsKT+XagESGQXrcJ5xFcbYznw+UIkTXqfqs4ujwLHgfr0A9dgU3wR+ RT94XHiW16VETn8oHFeUMmLhEGZz1oqazWG+261yxSBRBN8Lp7itvkEvY8dXb104yR/y g/r8hL1SeL6CWltiC8mFH9hMsQawWIRYoTDYCMYwKX5WML6Wf9K2hUt3wapBSB9qhZN9 VDWgrwRAYae5bwuU4zycZlYrkBZZmFuxPzcNgDazJaxoHBhtGCfqyTAQ0yN7wzvE9BmD zHdfsFGOvjTb8WmVYidCYB8NqYxmIzS47rBmpqDEghf7Vv7ZyCsc45uaIjZVUUofjfHl MOfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qIJxhOmy; 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 n24-20020a05640206d800b004accb663177si12879185edy.330.2023.03.07.12.01.45; Tue, 07 Mar 2023 12:02: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=qIJxhOmy; 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 S231752AbjCGTqO (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 7 Mar 2023 14:46:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbjCGToe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); 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 3D4E498EAE; Tue, 7 Mar 2023 11:33:51 -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 327JXkUo129397; 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=2QKk8MDasC9TQp6Y/MGWR5Z7h/GdVQwRLQTrVMYwwAU=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qIJxhOmytpNBGTwFVkqA6fcECG1b/POelKbKOD7gzUYobfwP6yqjhwazWtY0IlN8s b3ic42MCYEY11U6NA3I+KWuLGgYl3JjiE0U3o78kGYRdKROUXaoOu0vxIWwxvFYZ0V sxQetdKFVL54LdUgTCpAM0qZC97FGguXm7N43KMg= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 327JXkOC123439 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 7 Mar 2023 13:33:46 -0600 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE112.ent.ti.com (157.170.170.23) 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 DLEE112.ent.ti.com (157.170.170.23) 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 327JXkWo026389; Tue, 7 Mar 2023 13:33:46 -0600 From: Andrew Davis <afd@ti.com> To: Peter Tyser <ptyser@xes-inc.com>, Andy Shevchenko <andy@kernel.org>, Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <brgl@bgdev.pl> CC: <linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Andrew Davis <afd@ti.com> Subject: [PATCH v2 3/6] gpio: sch311x: Use devm_gpiochip_add_data() to simplify remove path Date: Tue, 7 Mar 2023 13:33:43 -0600 Message-ID: <20230307193346.8718-3-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 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759740511820895570?= X-GMAIL-MSGID: =?utf-8?q?1759740511820895570?= |
Series |
[v2,1/6] gpio: ich: Use devm_gpiochip_add_data() to simplify remove path
|
|
Commit Message
Andrew Davis
March 7, 2023, 7:33 p.m. UTC
Use devm version of gpiochip add function to handle removal for us.
Signed-off-by: Andrew Davis <afd@ti.com>
---
drivers/gpio/gpio-sch311x.c | 25 ++-----------------------
1 file changed, 2 insertions(+), 23 deletions(-)
Comments
Hi Andrew,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on brgl/gpio/for-next]
[also build test ERROR on linus/master v6.3-rc1 next-20230308]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Andrew-Davis/gpio-twl4030-Use-devm_gpiochip_add_data-to-simplify-remove-path/20230308-034717
base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link: https://lore.kernel.org/r/20230307193346.8718-3-afd%40ti.com
patch subject: [PATCH v2 3/6] gpio: sch311x: Use devm_gpiochip_add_data() to simplify remove path
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230308/202303081607.a3gt8vdz-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/fcfc10c6817ac3ea88ced58cce2ae8568b0f2030
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andrew-Davis/gpio-twl4030-Use-devm_gpiochip_add_data-to-simplify-remove-path/20230308-034717
git checkout fcfc10c6817ac3ea88ced58cce2ae8568b0f2030
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303081607.a3gt8vdz-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/gpio/gpio-sch311x.c:322:27: error: 'sch311x_gpio_remove' undeclared here (not in a function); did you mean 'sch311x_gpio_probe'?
322 | .remove = sch311x_gpio_remove,
| ^~~~~~~~~~~~~~~~~~~
| sch311x_gpio_probe
vim +322 drivers/gpio/gpio-sch311x.c
12262bef8f4614 Bruno Randolf 2013-12-04 318
12262bef8f4614 Bruno Randolf 2013-12-04 319 static struct platform_driver sch311x_gpio_driver = {
12262bef8f4614 Bruno Randolf 2013-12-04 320 .driver.name = DRV_NAME,
12262bef8f4614 Bruno Randolf 2013-12-04 321 .probe = sch311x_gpio_probe,
12262bef8f4614 Bruno Randolf 2013-12-04 @322 .remove = sch311x_gpio_remove,
12262bef8f4614 Bruno Randolf 2013-12-04 323 };
12262bef8f4614 Bruno Randolf 2013-12-04 324
12262bef8f4614 Bruno Randolf 2013-12-04 325
Hi Andrew,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on brgl/gpio/for-next]
[also build test ERROR on linus/master v6.3-rc1 next-20230309]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Andrew-Davis/gpio-twl4030-Use-devm_gpiochip_add_data-to-simplify-remove-path/20230308-034717
base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link: https://lore.kernel.org/r/20230307193346.8718-3-afd%40ti.com
patch subject: [PATCH v2 3/6] gpio: sch311x: Use devm_gpiochip_add_data() to simplify remove path
config: x86_64-randconfig-a001 (https://download.01.org/0day-ci/archive/20230309/202303091640.6XjHNouG-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/fcfc10c6817ac3ea88ced58cce2ae8568b0f2030
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andrew-Davis/gpio-twl4030-Use-devm_gpiochip_add_data-to-simplify-remove-path/20230308-034717
git checkout fcfc10c6817ac3ea88ced58cce2ae8568b0f2030
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpio/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303091640.6XjHNouG-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/gpio/gpio-sch311x.c:322:13: error: use of undeclared identifier 'sch311x_gpio_remove'
.remove = sch311x_gpio_remove,
^
1 error generated.
vim +/sch311x_gpio_remove +322 drivers/gpio/gpio-sch311x.c
12262bef8f4614 Bruno Randolf 2013-12-04 318
12262bef8f4614 Bruno Randolf 2013-12-04 319 static struct platform_driver sch311x_gpio_driver = {
12262bef8f4614 Bruno Randolf 2013-12-04 320 .driver.name = DRV_NAME,
12262bef8f4614 Bruno Randolf 2013-12-04 321 .probe = sch311x_gpio_probe,
12262bef8f4614 Bruno Randolf 2013-12-04 @322 .remove = sch311x_gpio_remove,
12262bef8f4614 Bruno Randolf 2013-12-04 323 };
12262bef8f4614 Bruno Randolf 2013-12-04 324
12262bef8f4614 Bruno Randolf 2013-12-04 325
diff --git a/drivers/gpio/gpio-sch311x.c b/drivers/gpio/gpio-sch311x.c index da01e1cad7cb..ba7c300511a5 100644 --- a/drivers/gpio/gpio-sch311x.c +++ b/drivers/gpio/gpio-sch311x.c @@ -281,8 +281,6 @@ static int sch311x_gpio_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - platform_set_drvdata(pdev, priv); - for (i = 0; i < ARRAY_SIZE(priv->blocks); i++) { block = &priv->blocks[i]; @@ -305,36 +303,17 @@ static int sch311x_gpio_probe(struct platform_device *pdev) block->data_reg = sch311x_gpio_blocks[i].data_reg; block->runtime_reg = pdata->runtime_reg; - err = gpiochip_add_data(&block->chip, block); + 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; } dev_info(&pdev->dev, "SMSC SCH311x GPIO block %d registered.\n", i); } return 0; - -exit_err: - /* release already registered chips */ - for (--i; i >= 0; i--) - gpiochip_remove(&priv->blocks[i].chip); - return err; -} - -static int sch311x_gpio_remove(struct platform_device *pdev) -{ - struct sch311x_gpio_priv *priv = platform_get_drvdata(pdev); - int i; - - for (i = 0; i < ARRAY_SIZE(priv->blocks); i++) { - gpiochip_remove(&priv->blocks[i].chip); - dev_info(&pdev->dev, - "SMSC SCH311x GPIO block %d unregistered.\n", i); - } - return 0; } static struct platform_driver sch311x_gpio_driver = {