Message ID | 20230112163920.73102-2-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4001604wrt; Thu, 12 Jan 2023 09:15:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXt/cukgeN+qqurfk1mmWJP7c3d/GO+C38ScECOtAo45D979Qo7PVsWF38EnLRvcZTjAyx+p X-Received: by 2002:aa7:c989:0:b0:499:bdd8:f8 with SMTP id c9-20020aa7c989000000b00499bdd800f8mr11721338edt.5.1673543739432; Thu, 12 Jan 2023 09:15:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673543739; cv=none; d=google.com; s=arc-20160816; b=RLKSqKkLpRF3kxJqu4W/QzFjHiax7Z5OyWv1lQTQmShnI+nwymzPrjK3R0w5GnpBAl A2k8bXc+KRp2D+ah9hvB4jTgvb1KL3+OpfxratpraZhR0rkBOOmvhxeQCmZRk8dbBYQL xnApLSQhgYfvQvdNW29j7mr+PBYRK4KQSbdqpZWze3RUTGFJXLZWQNsXBHqFEgPKGuSP ghNunIzXLc1OT/59iHkhR4qNou7D97t0EEmxvD4qGXwnFvY+ku+QIRokNF2gFOmTticG SS8cAv10Zxup+G0SP7nd0Htc1OlzNcGhigZFkHQStZiC3VmGv5JTgJ8tQ0kMwdTYu26/ +lFQ== 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=XCtQagJ+7+QvMlxtgwwWFaSY2gasnNBrhWiR6SOjLrM=; b=VelHQTY3hxCmn5U/LGGVf5B2XgzYi1yeoE3IuCpdxK333vWJGD3kspYNW7PO4tOf7f 6sqJDxNxrJ+EYqigSrIeC41kg7GBGA2EA8efKnSkE/h8RI/cj6A+ULXM0EI+7m2riius eLXXWHm3TmcCvNfW4yvLMieNTo/SPF6VN9jXTGTc9HfLBSf3YPmVOpyUo6f7qODfgBR8 MbMNiYDf8GrOOXY6Bfjwr0siFywbApKpcVS9pzgPJQY7z15Y5OxNqTxkgBewaCI/XJ2U Dm6pHNLPWBKVwSp0NfTN2RMoQWmZxblZvQqIY/dJBt/wvMIUkUoWAVFvkoMHdKz+KcyD r9fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RWaEbQPG; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k11-20020a50ce4b000000b0048017a9576bsi16097550edj.543.2023.01.12.09.15.15; Thu, 12 Jan 2023 09:15:39 -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=@intel.com header.s=Intel header.b=RWaEbQPG; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240910AbjALQxH (ORCPT <rfc822;zhuangel570@gmail.com> + 99 others); Thu, 12 Jan 2023 11:53:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241490AbjALQu1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 12 Jan 2023 11:50:27 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A4735F91E; Thu, 12 Jan 2023 08:39:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673541565; x=1705077565; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fVWXQlK37xmphsZHTjVPbnx5CD+Mvd7qdaqifrAOEdQ=; b=RWaEbQPGCblTqH7MEVnFhCXiyWq52amsFuTZ7dFUovOWDdJZmHPJGOAH MD5hmVtztlSrrAtNv/sQ8sOhmK/w+ZJCwCF1P/+d71B6+4PdVnVnYY4ho 9hDtiZtrApsQsE2j0BMkp4c7DUhFyY8uE5Lrq53egwlyEAR33OIC+tZlm FamH2RwMwtqRICkwgOwjNVvmxRXpfjBYxqBLk4ucT2+us4cRSFJdt7XrK p7SHNs97InZaqsJVeAH3IQA4SwCboH/t3DlhL6OOBKm+ZEtP1gzmRZlEf T5ZqLKV89Gg4WaniTfeNY5wF2/HWxTnyvyq0Y8vU/7kA2BcZcNtnV7Qc/ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="304132775" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="304132775" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 08:39:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="635447461" X-IronPort-AV: E=Sophos;i="5.97,211,1669104000"; d="scan'208";a="635447461" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 12 Jan 2023 08:39:01 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7536B7C; Thu, 12 Jan 2023 18:39:35 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <brgl@bgdev.pl> Subject: [PATCH v1 2/2] gpio: wcd934x: Use proper headers and drop OF_GPIO dependency Date: Thu, 12 Jan 2023 18:39:20 +0200 Message-Id: <20230112163920.73102-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112163920.73102-1-andriy.shevchenko@linux.intel.com> References: <20230112163920.73102-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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?1754837800430126173?= X-GMAIL-MSGID: =?utf-8?q?1754837800430126173?= |
Series |
[v1,1/2] gpio: wcd934x: Remove duplicate assignment of of_gpio_n_cells
|
|
Commit Message
Andy Shevchenko
Jan. 12, 2023, 4:39 p.m. UTC
The driver doesn't depend on the OF_GPIO to be complied. Hence
the proper header to use is mod_devicetable.h. Replace of*.h with
the above mentioned and drop redundant dependency.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/gpio/Kconfig | 2 +-
drivers/gpio/gpio-wcd934x.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
Comments
Hi Andy, I love your patch! Yet something to improve: [auto build test ERROR on brgl/gpio/for-next] [also build test ERROR on linus/master v6.2-rc3 next-20230112] [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/Andy-Shevchenko/gpio-wcd934x-Use-proper-headers-and-drop-OF_GPIO-dependency/20230113-005747 base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next patch link: https://lore.kernel.org/r/20230112163920.73102-2-andriy.shevchenko%40linux.intel.com patch subject: [PATCH v1 2/2] gpio: wcd934x: Use proper headers and drop OF_GPIO dependency config: m68k-allmodconfig compiler: m68k-linux-gcc (GCC) 12.1.0 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/7f9eb073b194585975007c28b381b96cd89b5c7a git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Andy-Shevchenko/gpio-wcd934x-Use-proper-headers-and-drop-OF_GPIO-dependency/20230113-005747 git checkout 7f9eb073b194585975007c28b381b96cd89b5c7a # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All error/warnings (new ones prefixed by >>): >> drivers/gpio/gpio-wcd934x.c:76:34: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration 76 | static int wcd_gpio_probe(struct platform_device *pdev) | ^~~~~~~~~~~~~~~ drivers/gpio/gpio-wcd934x.c: In function 'wcd_gpio_probe': >> drivers/gpio/gpio-wcd934x.c:78:35: error: invalid use of undefined type 'struct platform_device' 78 | struct device *dev = &pdev->dev; | ^~ drivers/gpio/gpio-wcd934x.c: At top level: >> drivers/gpio/gpio-wcd934x.c:114:15: error: variable 'wcd_gpio_driver' has initializer but incomplete type 114 | static struct platform_driver wcd_gpio_driver = { | ^~~~~~~~~~~~~~~ >> drivers/gpio/gpio-wcd934x.c:115:10: error: 'struct platform_driver' has no member named 'driver' 115 | .driver = { | ^~~~~~ >> drivers/gpio/gpio-wcd934x.c:115:19: error: extra brace group at end of initializer 115 | .driver = { | ^ drivers/gpio/gpio-wcd934x.c:115:19: note: (near initialization for 'wcd_gpio_driver') >> drivers/gpio/gpio-wcd934x.c:115:19: warning: excess elements in struct initializer drivers/gpio/gpio-wcd934x.c:115:19: note: (near initialization for 'wcd_gpio_driver') >> drivers/gpio/gpio-wcd934x.c:119:10: error: 'struct platform_driver' has no member named 'probe' 119 | .probe = wcd_gpio_probe, | ^~~~~ drivers/gpio/gpio-wcd934x.c:119:18: warning: excess elements in struct initializer 119 | .probe = wcd_gpio_probe, | ^~~~~~~~~~~~~~ drivers/gpio/gpio-wcd934x.c:119:18: note: (near initialization for 'wcd_gpio_driver') >> drivers/gpio/gpio-wcd934x.c:122:1: warning: data definition has no type or storage class 122 | module_platform_driver(wcd_gpio_driver); | ^~~~~~~~~~~~~~~~~~~~~~ >> drivers/gpio/gpio-wcd934x.c:122:1: error: type defaults to 'int' in declaration of 'module_platform_driver' [-Werror=implicit-int] >> drivers/gpio/gpio-wcd934x.c:122:1: warning: parameter names (without types) in function declaration >> drivers/gpio/gpio-wcd934x.c:114:31: error: storage size of 'wcd_gpio_driver' isn't known 114 | static struct platform_driver wcd_gpio_driver = { | ^~~~~~~~~~~~~~~ drivers/gpio/gpio-wcd934x.c:114:31: warning: 'wcd_gpio_driver' defined but not used [-Wunused-variable] cc1: some warnings being treated as errors vim +78 drivers/gpio/gpio-wcd934x.c 59c324683400b4 Srinivas Kandagatla 2020-01-07 75 59c324683400b4 Srinivas Kandagatla 2020-01-07 @76 static int wcd_gpio_probe(struct platform_device *pdev) 59c324683400b4 Srinivas Kandagatla 2020-01-07 77 { 59c324683400b4 Srinivas Kandagatla 2020-01-07 @78 struct device *dev = &pdev->dev; 59c324683400b4 Srinivas Kandagatla 2020-01-07 79 struct wcd_gpio_data *data; 59c324683400b4 Srinivas Kandagatla 2020-01-07 80 struct gpio_chip *chip; 59c324683400b4 Srinivas Kandagatla 2020-01-07 81 59c324683400b4 Srinivas Kandagatla 2020-01-07 82 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); 59c324683400b4 Srinivas Kandagatla 2020-01-07 83 if (!data) 59c324683400b4 Srinivas Kandagatla 2020-01-07 84 return -ENOMEM; 59c324683400b4 Srinivas Kandagatla 2020-01-07 85 59c324683400b4 Srinivas Kandagatla 2020-01-07 86 data->map = dev_get_regmap(dev->parent, NULL); 59c324683400b4 Srinivas Kandagatla 2020-01-07 87 if (!data->map) { 59c324683400b4 Srinivas Kandagatla 2020-01-07 88 dev_err(dev, "%s: failed to get regmap\n", __func__); 59c324683400b4 Srinivas Kandagatla 2020-01-07 89 return -EINVAL; 59c324683400b4 Srinivas Kandagatla 2020-01-07 90 } 59c324683400b4 Srinivas Kandagatla 2020-01-07 91 59c324683400b4 Srinivas Kandagatla 2020-01-07 92 chip = &data->chip; 59c324683400b4 Srinivas Kandagatla 2020-01-07 93 chip->direction_input = wcd_gpio_direction_input; 59c324683400b4 Srinivas Kandagatla 2020-01-07 94 chip->direction_output = wcd_gpio_direction_output; 59c324683400b4 Srinivas Kandagatla 2020-01-07 95 chip->get_direction = wcd_gpio_get_direction; 59c324683400b4 Srinivas Kandagatla 2020-01-07 96 chip->get = wcd_gpio_get; 59c324683400b4 Srinivas Kandagatla 2020-01-07 97 chip->set = wcd_gpio_set; 59c324683400b4 Srinivas Kandagatla 2020-01-07 98 chip->parent = dev; 59c324683400b4 Srinivas Kandagatla 2020-01-07 99 chip->base = -1; 59c324683400b4 Srinivas Kandagatla 2020-01-07 100 chip->ngpio = WCD934X_NPINS; 59c324683400b4 Srinivas Kandagatla 2020-01-07 101 chip->label = dev_name(dev); 59c324683400b4 Srinivas Kandagatla 2020-01-07 102 chip->can_sleep = false; 59c324683400b4 Srinivas Kandagatla 2020-01-07 103 59c324683400b4 Srinivas Kandagatla 2020-01-07 104 return devm_gpiochip_add_data(dev, chip, data); 59c324683400b4 Srinivas Kandagatla 2020-01-07 105 } 59c324683400b4 Srinivas Kandagatla 2020-01-07 106 59c324683400b4 Srinivas Kandagatla 2020-01-07 107 static const struct of_device_id wcd_gpio_of_match[] = { 59c324683400b4 Srinivas Kandagatla 2020-01-07 108 { .compatible = "qcom,wcd9340-gpio" }, 59c324683400b4 Srinivas Kandagatla 2020-01-07 109 { .compatible = "qcom,wcd9341-gpio" }, 59c324683400b4 Srinivas Kandagatla 2020-01-07 110 { } 59c324683400b4 Srinivas Kandagatla 2020-01-07 111 }; 59c324683400b4 Srinivas Kandagatla 2020-01-07 112 MODULE_DEVICE_TABLE(of, wcd_gpio_of_match); 59c324683400b4 Srinivas Kandagatla 2020-01-07 113 59c324683400b4 Srinivas Kandagatla 2020-01-07 @114 static struct platform_driver wcd_gpio_driver = { 59c324683400b4 Srinivas Kandagatla 2020-01-07 @115 .driver = { 59c324683400b4 Srinivas Kandagatla 2020-01-07 116 .name = "wcd934x-gpio", 59c324683400b4 Srinivas Kandagatla 2020-01-07 117 .of_match_table = wcd_gpio_of_match, 59c324683400b4 Srinivas Kandagatla 2020-01-07 118 }, 59c324683400b4 Srinivas Kandagatla 2020-01-07 @119 .probe = wcd_gpio_probe, 59c324683400b4 Srinivas Kandagatla 2020-01-07 120 }; 59c324683400b4 Srinivas Kandagatla 2020-01-07 121 59c324683400b4 Srinivas Kandagatla 2020-01-07 @122 module_platform_driver(wcd_gpio_driver);
Hi Andy,
I love your patch! Perhaps something to improve:
[auto build test WARNING on brgl/gpio/for-next]
[also build test WARNING on linus/master v6.2-rc3 next-20230112]
[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/Andy-Shevchenko/gpio-wcd934x-Use-proper-headers-and-drop-OF_GPIO-dependency/20230113-005747
base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link: https://lore.kernel.org/r/20230112163920.73102-2-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 2/2] gpio: wcd934x: Use proper headers and drop OF_GPIO dependency
config: x86_64-randconfig-a016
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/7f9eb073b194585975007c28b381b96cd89b5c7a
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andy-Shevchenko/gpio-wcd934x-Use-proper-headers-and-drop-OF_GPIO-dependency/20230113-005747
git checkout 7f9eb073b194585975007c28b381b96cd89b5c7a
# 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>
All warnings (new ones prefixed by >>):
>> drivers/gpio/gpio-wcd934x.c:76:34: warning: declaration of 'struct platform_device' will not be visible outside of this function [-Wvisibility]
static int wcd_gpio_probe(struct platform_device *pdev)
^
drivers/gpio/gpio-wcd934x.c:78:28: error: incomplete definition of type 'struct platform_device'
struct device *dev = &pdev->dev;
~~~~^
drivers/gpio/gpio-wcd934x.c:76:34: note: forward declaration of 'struct platform_device'
static int wcd_gpio_probe(struct platform_device *pdev)
^
drivers/gpio/gpio-wcd934x.c:114:31: error: variable has incomplete type 'struct platform_driver'
static struct platform_driver wcd_gpio_driver = {
^
drivers/gpio/gpio-wcd934x.c:114:15: note: forward declaration of 'struct platform_driver'
static struct platform_driver wcd_gpio_driver = {
^
drivers/gpio/gpio-wcd934x.c:122:1: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int]
module_platform_driver(wcd_gpio_driver);
^
drivers/gpio/gpio-wcd934x.c:122:24: error: a parameter list without types is only allowed in a function definition
module_platform_driver(wcd_gpio_driver);
^
1 warning and 4 errors generated.
vim +76 drivers/gpio/gpio-wcd934x.c
59c324683400b4 Srinivas Kandagatla 2020-01-07 75
59c324683400b4 Srinivas Kandagatla 2020-01-07 @76 static int wcd_gpio_probe(struct platform_device *pdev)
59c324683400b4 Srinivas Kandagatla 2020-01-07 77 {
59c324683400b4 Srinivas Kandagatla 2020-01-07 78 struct device *dev = &pdev->dev;
59c324683400b4 Srinivas Kandagatla 2020-01-07 79 struct wcd_gpio_data *data;
59c324683400b4 Srinivas Kandagatla 2020-01-07 80 struct gpio_chip *chip;
59c324683400b4 Srinivas Kandagatla 2020-01-07 81
59c324683400b4 Srinivas Kandagatla 2020-01-07 82 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
59c324683400b4 Srinivas Kandagatla 2020-01-07 83 if (!data)
59c324683400b4 Srinivas Kandagatla 2020-01-07 84 return -ENOMEM;
59c324683400b4 Srinivas Kandagatla 2020-01-07 85
59c324683400b4 Srinivas Kandagatla 2020-01-07 86 data->map = dev_get_regmap(dev->parent, NULL);
59c324683400b4 Srinivas Kandagatla 2020-01-07 87 if (!data->map) {
59c324683400b4 Srinivas Kandagatla 2020-01-07 88 dev_err(dev, "%s: failed to get regmap\n", __func__);
59c324683400b4 Srinivas Kandagatla 2020-01-07 89 return -EINVAL;
59c324683400b4 Srinivas Kandagatla 2020-01-07 90 }
59c324683400b4 Srinivas Kandagatla 2020-01-07 91
59c324683400b4 Srinivas Kandagatla 2020-01-07 92 chip = &data->chip;
59c324683400b4 Srinivas Kandagatla 2020-01-07 93 chip->direction_input = wcd_gpio_direction_input;
59c324683400b4 Srinivas Kandagatla 2020-01-07 94 chip->direction_output = wcd_gpio_direction_output;
59c324683400b4 Srinivas Kandagatla 2020-01-07 95 chip->get_direction = wcd_gpio_get_direction;
59c324683400b4 Srinivas Kandagatla 2020-01-07 96 chip->get = wcd_gpio_get;
59c324683400b4 Srinivas Kandagatla 2020-01-07 97 chip->set = wcd_gpio_set;
59c324683400b4 Srinivas Kandagatla 2020-01-07 98 chip->parent = dev;
59c324683400b4 Srinivas Kandagatla 2020-01-07 99 chip->base = -1;
59c324683400b4 Srinivas Kandagatla 2020-01-07 100 chip->ngpio = WCD934X_NPINS;
59c324683400b4 Srinivas Kandagatla 2020-01-07 101 chip->label = dev_name(dev);
59c324683400b4 Srinivas Kandagatla 2020-01-07 102 chip->can_sleep = false;
59c324683400b4 Srinivas Kandagatla 2020-01-07 103
59c324683400b4 Srinivas Kandagatla 2020-01-07 104 return devm_gpiochip_add_data(dev, chip, data);
59c324683400b4 Srinivas Kandagatla 2020-01-07 105 }
59c324683400b4 Srinivas Kandagatla 2020-01-07 106
Hi Andy,
I love your patch! Perhaps something to improve:
[auto build test WARNING on brgl/gpio/for-next]
[also build test WARNING on linus/master v6.2-rc3]
[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/Andy-Shevchenko/gpio-wcd934x-Use-proper-headers-and-drop-OF_GPIO-dependency/20230113-005747
base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link: https://lore.kernel.org/r/20230112163920.73102-2-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 2/2] gpio: wcd934x: Use proper headers and drop OF_GPIO dependency
config: x86_64-allyesconfig
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/7f9eb073b194585975007c28b381b96cd89b5c7a
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andy-Shevchenko/gpio-wcd934x-Use-proper-headers-and-drop-OF_GPIO-dependency/20230113-005747
git checkout 7f9eb073b194585975007c28b381b96cd89b5c7a
# 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>
All warnings (new ones prefixed by >>):
drivers/gpio/gpio-wcd934x.c:76:34: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
76 | static int wcd_gpio_probe(struct platform_device *pdev)
| ^~~~~~~~~~~~~~~
drivers/gpio/gpio-wcd934x.c: In function 'wcd_gpio_probe':
drivers/gpio/gpio-wcd934x.c:78:35: error: invalid use of undefined type 'struct platform_device'
78 | struct device *dev = &pdev->dev;
| ^~
drivers/gpio/gpio-wcd934x.c: At top level:
drivers/gpio/gpio-wcd934x.c:114:15: error: variable 'wcd_gpio_driver' has initializer but incomplete type
114 | static struct platform_driver wcd_gpio_driver = {
| ^~~~~~~~~~~~~~~
drivers/gpio/gpio-wcd934x.c:115:10: error: 'struct platform_driver' has no member named 'driver'
115 | .driver = {
| ^~~~~~
drivers/gpio/gpio-wcd934x.c:115:19: error: extra brace group at end of initializer
115 | .driver = {
| ^
drivers/gpio/gpio-wcd934x.c:115:19: note: (near initialization for 'wcd_gpio_driver')
drivers/gpio/gpio-wcd934x.c:115:19: warning: excess elements in struct initializer
drivers/gpio/gpio-wcd934x.c:115:19: note: (near initialization for 'wcd_gpio_driver')
drivers/gpio/gpio-wcd934x.c:119:10: error: 'struct platform_driver' has no member named 'probe'
119 | .probe = wcd_gpio_probe,
| ^~~~~
drivers/gpio/gpio-wcd934x.c:119:18: warning: excess elements in struct initializer
119 | .probe = wcd_gpio_probe,
| ^~~~~~~~~~~~~~
drivers/gpio/gpio-wcd934x.c:119:18: note: (near initialization for 'wcd_gpio_driver')
drivers/gpio/gpio-wcd934x.c:122:1: warning: data definition has no type or storage class
122 | module_platform_driver(wcd_gpio_driver);
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-wcd934x.c:122:1: error: type defaults to 'int' in declaration of 'module_platform_driver' [-Werror=implicit-int]
drivers/gpio/gpio-wcd934x.c:122:1: warning: parameter names (without types) in function declaration
drivers/gpio/gpio-wcd934x.c:114:31: error: storage size of 'wcd_gpio_driver' isn't known
114 | static struct platform_driver wcd_gpio_driver = {
| ^~~~~~~~~~~~~~~
>> drivers/gpio/gpio-wcd934x.c:114:31: warning: 'wcd_gpio_driver' defined but not used [-Wunused-variable]
cc1: some warnings being treated as errors
vim +/wcd_gpio_driver +114 drivers/gpio/gpio-wcd934x.c
59c324683400b4 Srinivas Kandagatla 2020-01-07 113
59c324683400b4 Srinivas Kandagatla 2020-01-07 @114 static struct platform_driver wcd_gpio_driver = {
59c324683400b4 Srinivas Kandagatla 2020-01-07 115 .driver = {
59c324683400b4 Srinivas Kandagatla 2020-01-07 116 .name = "wcd934x-gpio",
59c324683400b4 Srinivas Kandagatla 2020-01-07 117 .of_match_table = wcd_gpio_of_match,
59c324683400b4 Srinivas Kandagatla 2020-01-07 118 },
59c324683400b4 Srinivas Kandagatla 2020-01-07 119 .probe = wcd_gpio_probe,
59c324683400b4 Srinivas Kandagatla 2020-01-07 120 };
59c324683400b4 Srinivas Kandagatla 2020-01-07 121
Hi Andy, I love your patch! Yet something to improve: [auto build test ERROR on brgl/gpio/for-next] [also build test ERROR on linus/master v6.2-rc3 next-20230112] [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/Andy-Shevchenko/gpio-wcd934x-Use-proper-headers-and-drop-OF_GPIO-dependency/20230113-005747 base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next patch link: https://lore.kernel.org/r/20230112163920.73102-2-andriy.shevchenko%40linux.intel.com patch subject: [PATCH v1 2/2] gpio: wcd934x: Use proper headers and drop OF_GPIO dependency config: x86_64-randconfig-a016 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/7f9eb073b194585975007c28b381b96cd89b5c7a git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Andy-Shevchenko/gpio-wcd934x-Use-proper-headers-and-drop-OF_GPIO-dependency/20230113-005747 git checkout 7f9eb073b194585975007c28b381b96cd89b5c7a # 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 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/gpio/gpio-wcd934x.c:76:34: warning: declaration of 'struct platform_device' will not be visible outside of this function [-Wvisibility] static int wcd_gpio_probe(struct platform_device *pdev) ^ >> drivers/gpio/gpio-wcd934x.c:78:28: error: incomplete definition of type 'struct platform_device' struct device *dev = &pdev->dev; ~~~~^ drivers/gpio/gpio-wcd934x.c:76:34: note: forward declaration of 'struct platform_device' static int wcd_gpio_probe(struct platform_device *pdev) ^ >> drivers/gpio/gpio-wcd934x.c:114:31: error: variable has incomplete type 'struct platform_driver' static struct platform_driver wcd_gpio_driver = { ^ drivers/gpio/gpio-wcd934x.c:114:15: note: forward declaration of 'struct platform_driver' static struct platform_driver wcd_gpio_driver = { ^ >> drivers/gpio/gpio-wcd934x.c:122:1: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] module_platform_driver(wcd_gpio_driver); ^ >> drivers/gpio/gpio-wcd934x.c:122:24: error: a parameter list without types is only allowed in a function definition module_platform_driver(wcd_gpio_driver); ^ 1 warning and 4 errors generated. vim +78 drivers/gpio/gpio-wcd934x.c 59c324683400b4 Srinivas Kandagatla 2020-01-07 75 59c324683400b4 Srinivas Kandagatla 2020-01-07 76 static int wcd_gpio_probe(struct platform_device *pdev) 59c324683400b4 Srinivas Kandagatla 2020-01-07 77 { 59c324683400b4 Srinivas Kandagatla 2020-01-07 @78 struct device *dev = &pdev->dev; 59c324683400b4 Srinivas Kandagatla 2020-01-07 79 struct wcd_gpio_data *data; 59c324683400b4 Srinivas Kandagatla 2020-01-07 80 struct gpio_chip *chip; 59c324683400b4 Srinivas Kandagatla 2020-01-07 81 59c324683400b4 Srinivas Kandagatla 2020-01-07 82 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); 59c324683400b4 Srinivas Kandagatla 2020-01-07 83 if (!data) 59c324683400b4 Srinivas Kandagatla 2020-01-07 84 return -ENOMEM; 59c324683400b4 Srinivas Kandagatla 2020-01-07 85 59c324683400b4 Srinivas Kandagatla 2020-01-07 86 data->map = dev_get_regmap(dev->parent, NULL); 59c324683400b4 Srinivas Kandagatla 2020-01-07 87 if (!data->map) { 59c324683400b4 Srinivas Kandagatla 2020-01-07 88 dev_err(dev, "%s: failed to get regmap\n", __func__); 59c324683400b4 Srinivas Kandagatla 2020-01-07 89 return -EINVAL; 59c324683400b4 Srinivas Kandagatla 2020-01-07 90 } 59c324683400b4 Srinivas Kandagatla 2020-01-07 91 59c324683400b4 Srinivas Kandagatla 2020-01-07 92 chip = &data->chip; 59c324683400b4 Srinivas Kandagatla 2020-01-07 93 chip->direction_input = wcd_gpio_direction_input; 59c324683400b4 Srinivas Kandagatla 2020-01-07 94 chip->direction_output = wcd_gpio_direction_output; 59c324683400b4 Srinivas Kandagatla 2020-01-07 95 chip->get_direction = wcd_gpio_get_direction; 59c324683400b4 Srinivas Kandagatla 2020-01-07 96 chip->get = wcd_gpio_get; 59c324683400b4 Srinivas Kandagatla 2020-01-07 97 chip->set = wcd_gpio_set; 59c324683400b4 Srinivas Kandagatla 2020-01-07 98 chip->parent = dev; 59c324683400b4 Srinivas Kandagatla 2020-01-07 99 chip->base = -1; 59c324683400b4 Srinivas Kandagatla 2020-01-07 100 chip->ngpio = WCD934X_NPINS; 59c324683400b4 Srinivas Kandagatla 2020-01-07 101 chip->label = dev_name(dev); 59c324683400b4 Srinivas Kandagatla 2020-01-07 102 chip->can_sleep = false; 59c324683400b4 Srinivas Kandagatla 2020-01-07 103 59c324683400b4 Srinivas Kandagatla 2020-01-07 104 return devm_gpiochip_add_data(dev, chip, data); 59c324683400b4 Srinivas Kandagatla 2020-01-07 105 } 59c324683400b4 Srinivas Kandagatla 2020-01-07 106 59c324683400b4 Srinivas Kandagatla 2020-01-07 107 static const struct of_device_id wcd_gpio_of_match[] = { 59c324683400b4 Srinivas Kandagatla 2020-01-07 108 { .compatible = "qcom,wcd9340-gpio" }, 59c324683400b4 Srinivas Kandagatla 2020-01-07 109 { .compatible = "qcom,wcd9341-gpio" }, 59c324683400b4 Srinivas Kandagatla 2020-01-07 110 { } 59c324683400b4 Srinivas Kandagatla 2020-01-07 111 }; 59c324683400b4 Srinivas Kandagatla 2020-01-07 112 MODULE_DEVICE_TABLE(of, wcd_gpio_of_match); 59c324683400b4 Srinivas Kandagatla 2020-01-07 113 59c324683400b4 Srinivas Kandagatla 2020-01-07 @114 static struct platform_driver wcd_gpio_driver = { 59c324683400b4 Srinivas Kandagatla 2020-01-07 115 .driver = { 59c324683400b4 Srinivas Kandagatla 2020-01-07 116 .name = "wcd934x-gpio", 59c324683400b4 Srinivas Kandagatla 2020-01-07 117 .of_match_table = wcd_gpio_of_match, 59c324683400b4 Srinivas Kandagatla 2020-01-07 118 }, 59c324683400b4 Srinivas Kandagatla 2020-01-07 119 .probe = wcd_gpio_probe, 59c324683400b4 Srinivas Kandagatla 2020-01-07 120 }; 59c324683400b4 Srinivas Kandagatla 2020-01-07 121 59c324683400b4 Srinivas Kandagatla 2020-01-07 @122 module_platform_driver(wcd_gpio_driver);
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 9711fcb9a4e9..3b2078a654ce 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -700,7 +700,7 @@ config GPIO_VX855 config GPIO_WCD934X tristate "Qualcomm Technologies Inc WCD9340/WCD9341 GPIO controller driver" - depends on MFD_WCD934X && OF_GPIO + depends on MFD_WCD934X help This driver is to support GPIO block found on the Qualcomm Technologies Inc WCD9340/WCD9341 Audio Codec. diff --git a/drivers/gpio/gpio-wcd934x.c b/drivers/gpio/gpio-wcd934x.c index 817750e4e033..e6a8df7211f8 100644 --- a/drivers/gpio/gpio-wcd934x.c +++ b/drivers/gpio/gpio-wcd934x.c @@ -1,11 +1,12 @@ // SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2019, Linaro Limited +#include <linux/mod_devicetable.h> #include <linux/module.h> -#include <linux/gpio/driver.h> #include <linux/regmap.h> #include <linux/slab.h> -#include <linux/of_device.h> + +#include <linux/gpio/driver.h> #define WCD_PIN_MASK(p) BIT(p) #define WCD_REG_DIR_CTL_OFFSET 0x42