Message ID | 20230313144557.35856-1-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:5915:0:0:0:0:0 with SMTP id v21csp1236282wrd; Mon, 13 Mar 2023 08:03:40 -0700 (PDT) X-Google-Smtp-Source: AK7set/TgrUp69Re4iR+Y4kbCLYRH3e1T977NLWH+FPnG2DCbF4H2pGyCl5SvjaUNr+Fugkxe8aW X-Received: by 2002:a17:902:ec8e:b0:19c:bcae:b45a with SMTP id x14-20020a170902ec8e00b0019cbcaeb45amr38275612plg.65.1678719820671; Mon, 13 Mar 2023 08:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678719820; cv=none; d=google.com; s=arc-20160816; b=CxDoZSlMmbq5IRNnNO4jA5JVRACUJ8ZKm1wfNIPoezqV/vtW7mlMzvuhv6h5oL9S1K zviX5S0zzUIm3Mb8Wd/3W01KU15ClGQxgM1zkivM+dt6qiUSvWuG0fkh92NEwzhaWNXM X8NXr+Cnxxq2UwkKSyvhP/hvEkpQ4avTxIkOMijlIkgMHjp+n7FM+/iETBpxMFClb9QA kZ+IK2rMOoMTp79tA/uWVrYgBfRqxjPxn//VGvKjp4wQ8NzQegr75aZ95wY+0o4aZiK3 ZAJZ9UviDZO5XFUb84Mug060KO0+A5g0YdT6uaYzvL3Jyl+cw4fLWXQ0O6ipqz5wn8w6 1Oxw== 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=dF/JVZFY6Apx5PG/9AoPMUINYrjBX04pckYTrBR39Ig=; b=Ljn+5+XGWjuVAFj9WXrlIAIpWvztx16d8Mn15NkfQwyAKQWWwLrCDzV5lIMnZf4g13 YSWxNZ5O8vM1fOd1RotT4GjuLQUBzgrpL2p5zQ8ciGIyye+mpzF+Qd8GAjToX3jS/Wnu YW65Z3b3XZ5SarhBJi3eakR05WiSUpe/QCI383CzdMmBqBRaMZX3IfxyrD3TpSUvw025 hRh5AjTt2sGcf28gcInty381neAVOv1g8D61elO5lLngPSa8ajjYX1hBBxL0QVkdzFtM jWlyg/fvVPccrOGI7FeOqUSxhbpTx/85KRDCHJIE0GsFfK7EEm4DNujOPNOL92a/X80o NCcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=W5wTwyUC; 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 i4-20020a17090332c400b0019e3ff97c99si7369418plr.293.2023.03.13.08.03.25; Mon, 13 Mar 2023 08:03:40 -0700 (PDT) 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=W5wTwyUC; 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 S230179AbjCMOpm (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Mon, 13 Mar 2023 10:45:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230410AbjCMOpj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Mar 2023 10:45:39 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 164E228862; Mon, 13 Mar 2023 07:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678718722; x=1710254722; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xUYcK7XJvLY1dMjMeqZCwhuSpycc+EaqI3YKX0sIHTU=; b=W5wTwyUCeEmsEqMhoHF8fKVSPy+i1sQOYlmggghj4oOzNE2CMhmcKAA8 Rb9gJGPn/MzcfCnwhatHMzUBXjhzTpIdnlbKj/JdySWlwJggnrbGv0NsZ YqC1ew70glAWga2w8pRkYxt+vpNze19zWDMTdO25z9XzDF3Ew/J7ZzayC VSA9SDhEa1H6qzSs8maFqib53rtK97VS7cEqoyzmdigMwG9cyvWljdgss xDH+TseRezjf0G1be8JZujO6inT3DARuI5gYB7a0U53RK+dvM/wvMu4Of StvQmaRbhsPeaXCZm0zTCJRzDs4AoMkIaADGXO20nTfalrwED98TpaGTN A==; X-IronPort-AV: E=McAfee;i="6500,9779,10648"; a="325523379" X-IronPort-AV: E=Sophos;i="5.98,257,1673942400"; d="scan'208";a="325523379" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2023 07:45:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10648"; a="628662504" X-IronPort-AV: E=Sophos;i="5.98,257,1673942400"; d="scan'208";a="628662504" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 13 Mar 2023 07:45:18 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C27CD365; Mon, 13 Mar 2023 16:46:02 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Bartosz Golaszewski <bartosz.golaszewski@linaro.org>, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <brgl@bgdev.pl>, Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>, Arnd Bergmann <arnd@arndb.de>, Dmitry Torokhov <dmitry.torokhov@gmail.com> Subject: [rft, PATCH v1 1/1] gpio: Drop unused inclusions from of_gpio.h Date: Mon, 13 Mar 2023 16:45:57 +0200 Message-Id: <20230313144557.35856-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.2 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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?1760265314521052784?= X-GMAIL-MSGID: =?utf-8?q?1760265314521052784?= |
Series |
[rft,v1,1/1] gpio: Drop unused inclusions from of_gpio.h
|
|
Commit Message
Andy Shevchenko
March 13, 2023, 2:45 p.m. UTC
As a preliminary step, drop unused inclusions from of_gpio.h,
so people will use the header only when it's really needed and
not as a substitute of any of the dropped ones.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
For testing purposes on what will fail in CIs. People are also
encourage to test this, if have time / chance / wish.
include/linux/of_gpio.h | 5 -----
1 file changed, 5 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.3-rc2 next-20230310] [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-Drop-unused-inclusions-from-of_gpio-h/20230313-224656 base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next patch link: https://lore.kernel.org/r/20230313144557.35856-1-andriy.shevchenko%40linux.intel.com patch subject: [rft, PATCH v1 1/1] gpio: Drop unused inclusions from of_gpio.h config: x86_64-randconfig-a012-20230313 (https://download.01.org/0day-ci/archive/20230314/202303140125.kHh8NLma-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/b108d11788b6db9e37a6c4b3110c09cecf30a46c git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Andy-Shevchenko/gpio-Drop-unused-inclusions-from-of_gpio-h/20230313-224656 git checkout b108d11788b6db9e37a6c4b3110c09cecf30a46c # 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 sound/soc/codecs/ 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/202303140125.kHh8NLma-lkp@intel.com/ All errors (new ones prefixed by >>): >> sound/soc/codecs/cs42l73.c:1316:9: error: implicit declaration of function 'devm_gpio_request_one' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ret = devm_gpio_request_one(&i2c_client->dev, ^ >> sound/soc/codecs/cs42l73.c:1318:10: error: use of undeclared identifier 'GPIOF_OUT_INIT_HIGH' GPIOF_OUT_INIT_HIGH, ^ >> sound/soc/codecs/cs42l73.c:1325:3: error: implicit declaration of function 'gpio_set_value_cansleep' is invalid in C99 [-Werror,-Wimplicit-function-declaration] gpio_set_value_cansleep(cs42l73->pdata.reset_gpio, 0); ^ sound/soc/codecs/cs42l73.c:1363:2: error: implicit declaration of function 'gpio_set_value_cansleep' is invalid in C99 [-Werror,-Wimplicit-function-declaration] gpio_set_value_cansleep(cs42l73->pdata.reset_gpio, 0); ^ 4 errors generated. -- >> sound/soc/codecs/ak5386.c:114:6: error: implicit declaration of function 'gpio_is_valid' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (gpio_is_valid(priv->reset_gpio)) ^ sound/soc/codecs/ak5386.c:114:6: note: did you mean 'uuid_is_valid'? include/linux/uuid.h:102:19: note: 'uuid_is_valid' declared here bool __must_check uuid_is_valid(const char *uuid); ^ >> sound/soc/codecs/ak5386.c:115:3: error: implicit declaration of function 'gpio_set_value' is invalid in C99 [-Werror,-Wimplicit-function-declaration] gpio_set_value(priv->reset_gpio, 1); ^ sound/soc/codecs/ak5386.c:126:6: error: implicit declaration of function 'gpio_is_valid' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (gpio_is_valid(priv->reset_gpio)) ^ sound/soc/codecs/ak5386.c:127:3: error: implicit declaration of function 'gpio_set_value' is invalid in C99 [-Werror,-Wimplicit-function-declaration] gpio_set_value(priv->reset_gpio, 0); ^ sound/soc/codecs/ak5386.c:186:6: error: implicit declaration of function 'gpio_is_valid' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (gpio_is_valid(priv->reset_gpio)) ^ >> sound/soc/codecs/ak5386.c:187:7: error: implicit declaration of function 'devm_gpio_request_one' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (devm_gpio_request_one(dev, priv->reset_gpio, ^ >> sound/soc/codecs/ak5386.c:188:8: error: use of undeclared identifier 'GPIOF_OUT_INIT_LOW' GPIOF_OUT_INIT_LOW, ^ 7 errors generated. -- >> sound/soc/codecs/aw88395/aw88395.c:458:3: error: implicit declaration of function 'gpiod_set_value_cansleep' is invalid in C99 [-Werror,-Wimplicit-function-declaration] gpiod_set_value_cansleep(aw88395->reset_gpio, 0); ^ >> sound/soc/codecs/aw88395/aw88395.c:527:24: error: implicit declaration of function 'devm_gpiod_get_optional' is invalid in C99 [-Werror,-Wimplicit-function-declaration] aw88395->reset_gpio = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_LOW); ^ sound/soc/codecs/aw88395/aw88395.c:527:24: note: did you mean 'devm_regulator_get_optional'? include/linux/regulator/consumer.h:208:32: note: 'devm_regulator_get_optional' declared here struct regulator *__must_check devm_regulator_get_optional(struct device *dev, ^ >> sound/soc/codecs/aw88395/aw88395.c:527:68: error: use of undeclared identifier 'GPIOD_OUT_LOW' aw88395->reset_gpio = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_LOW); ^ 3 errors generated. -- >> sound/soc/codecs/cs42l52.c:1143:9: error: implicit declaration of function 'devm_gpio_request_one' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ret = devm_gpio_request_one(&i2c_client->dev, ^ >> sound/soc/codecs/cs42l52.c:1145:10: error: use of undeclared identifier 'GPIOF_OUT_INIT_HIGH' GPIOF_OUT_INIT_HIGH, ^ >> sound/soc/codecs/cs42l52.c:1152:3: error: implicit declaration of function 'gpio_set_value_cansleep' is invalid in C99 [-Werror,-Wimplicit-function-declaration] gpio_set_value_cansleep(cs42l52->pdata.reset_gpio, 0); ^ 3 errors generated. -- >> sound/soc/codecs/cs42l56.c:1203:9: error: implicit declaration of function 'gpio_request_one' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ret = gpio_request_one(cs42l56->pdata.gpio_nreset, ^ >> sound/soc/codecs/cs42l56.c:1204:12: error: use of undeclared identifier 'GPIOF_OUT_INIT_HIGH' GPIOF_OUT_INIT_HIGH, "CS42L56 /RST"); ^ >> sound/soc/codecs/cs42l56.c:1211:3: error: implicit declaration of function 'gpio_set_value_cansleep' is invalid in C99 [-Werror,-Wimplicit-function-declaration] gpio_set_value_cansleep(cs42l56->pdata.gpio_nreset, 0); ^ 3 errors generated. -- >> sound/soc/codecs/wcd9335.c:5091:2: error: implicit declaration of function 'gpio_direction_output' is invalid in C99 [-Werror,-Wimplicit-function-declaration] gpio_direction_output(wcd->reset_gpio, 0); ^ >> sound/soc/codecs/wcd9335.c:5093:2: error: implicit declaration of function 'gpio_set_value' is invalid in C99 [-Werror,-Wimplicit-function-declaration] gpio_set_value(wcd->reset_gpio, 1); ^ 2 errors generated. vim +/devm_gpio_request_one +1316 sound/soc/codecs/cs42l73.c 6d10c91493a0b3 Brian Austin 2011-11-16 1275 4a4043456cb82d Stephen Kitt 2022-03-25 1276 static int cs42l73_i2c_probe(struct i2c_client *i2c_client) 6d10c91493a0b3 Brian Austin 2011-11-16 1277 { 6d10c91493a0b3 Brian Austin 2011-11-16 1278 struct cs42l73_private *cs42l73; 3d8c8bc0250f7c Brian Austin 2013-10-17 1279 struct cs42l73_platform_data *pdata = dev_get_platdata(&i2c_client->dev); 26495252fe0d1e Charles Keepax 2021-05-10 1280 int ret, devid; 6d10c91493a0b3 Brian Austin 2011-11-16 1281 unsigned int reg; 7b09eea52939d2 Brian Austin 2013-10-18 1282 u32 val32; 6d10c91493a0b3 Brian Austin 2011-11-16 1283 68fa08c665e51b Markus Elfring 2017-11-22 1284 cs42l73 = devm_kzalloc(&i2c_client->dev, sizeof(*cs42l73), GFP_KERNEL); 10d95ad48b4bf4 Sachin Kamat 2014-06-20 1285 if (!cs42l73) 6d10c91493a0b3 Brian Austin 2011-11-16 1286 return -ENOMEM; 6d10c91493a0b3 Brian Austin 2011-11-16 1287 571f6a7f07e9dd Brian Austin 2012-06-04 1288 cs42l73->regmap = devm_regmap_init_i2c(i2c_client, &cs42l73_regmap); 6d10c91493a0b3 Brian Austin 2011-11-16 1289 if (IS_ERR(cs42l73->regmap)) { 6d10c91493a0b3 Brian Austin 2011-11-16 1290 ret = PTR_ERR(cs42l73->regmap); 6d10c91493a0b3 Brian Austin 2011-11-16 1291 dev_err(&i2c_client->dev, "regmap_init() failed: %d\n", ret); 571f6a7f07e9dd Brian Austin 2012-06-04 1292 return ret; 6d10c91493a0b3 Brian Austin 2011-11-16 1293 } 3d8c8bc0250f7c Brian Austin 2013-10-17 1294 7b09eea52939d2 Brian Austin 2013-10-18 1295 if (pdata) { 3d8c8bc0250f7c Brian Austin 2013-10-17 1296 cs42l73->pdata = *pdata; 7b09eea52939d2 Brian Austin 2013-10-18 1297 } else { 68fa08c665e51b Markus Elfring 2017-11-22 1298 pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata), 7b09eea52939d2 Brian Austin 2013-10-18 1299 GFP_KERNEL); ddedd797943df2 Markus Elfring 2017-11-22 1300 if (!pdata) 7b09eea52939d2 Brian Austin 2013-10-18 1301 return -ENOMEM; ddedd797943df2 Markus Elfring 2017-11-22 1302 7b09eea52939d2 Brian Austin 2013-10-18 1303 if (i2c_client->dev.of_node) { 7b09eea52939d2 Brian Austin 2013-10-18 1304 if (of_property_read_u32(i2c_client->dev.of_node, 7b09eea52939d2 Brian Austin 2013-10-18 1305 "chgfreq", &val32) >= 0) 7b09eea52939d2 Brian Austin 2013-10-18 1306 pdata->chgfreq = val32; 7b09eea52939d2 Brian Austin 2013-10-18 1307 } 7b09eea52939d2 Brian Austin 2013-10-18 1308 pdata->reset_gpio = of_get_named_gpio(i2c_client->dev.of_node, 7b09eea52939d2 Brian Austin 2013-10-18 1309 "reset-gpio", 0); 7b09eea52939d2 Brian Austin 2013-10-18 1310 cs42l73->pdata = *pdata; 7b09eea52939d2 Brian Austin 2013-10-18 1311 } 3d8c8bc0250f7c Brian Austin 2013-10-17 1312 3d8c8bc0250f7c Brian Austin 2013-10-17 1313 i2c_set_clientdata(i2c_client, cs42l73); 3d8c8bc0250f7c Brian Austin 2013-10-17 1314 3d8c8bc0250f7c Brian Austin 2013-10-17 1315 if (cs42l73->pdata.reset_gpio) { 2b21694f153a0d Axel Lin 2014-04-08 @1316 ret = devm_gpio_request_one(&i2c_client->dev, 2b21694f153a0d Axel Lin 2014-04-08 1317 cs42l73->pdata.reset_gpio, 2b21694f153a0d Axel Lin 2014-04-08 @1318 GPIOF_OUT_INIT_HIGH, 2b21694f153a0d Axel Lin 2014-04-08 1319 "CS42L73 /RST"); 3d8c8bc0250f7c Brian Austin 2013-10-17 1320 if (ret < 0) { 3d8c8bc0250f7c Brian Austin 2013-10-17 1321 dev_err(&i2c_client->dev, "Failed to request /RST %d: %d\n", 3d8c8bc0250f7c Brian Austin 2013-10-17 1322 cs42l73->pdata.reset_gpio, ret); 3d8c8bc0250f7c Brian Austin 2013-10-17 1323 return ret; 3d8c8bc0250f7c Brian Austin 2013-10-17 1324 } 3d8c8bc0250f7c Brian Austin 2013-10-17 @1325 gpio_set_value_cansleep(cs42l73->pdata.reset_gpio, 0); 3d8c8bc0250f7c Brian Austin 2013-10-17 1326 gpio_set_value_cansleep(cs42l73->pdata.reset_gpio, 1); 3d8c8bc0250f7c Brian Austin 2013-10-17 1327 } 3d8c8bc0250f7c Brian Austin 2013-10-17 1328 6d10c91493a0b3 Brian Austin 2011-11-16 1329 /* initialize codec */ 26495252fe0d1e Charles Keepax 2021-05-10 1330 devid = cirrus_read_device_id(cs42l73->regmap, CS42L73_DEVID_AB); 26495252fe0d1e Charles Keepax 2021-05-10 1331 if (devid < 0) { 26495252fe0d1e Charles Keepax 2021-05-10 1332 ret = devid; 26495252fe0d1e Charles Keepax 2021-05-10 1333 dev_err(&i2c_client->dev, "Failed to read device ID: %d\n", ret); 26495252fe0d1e Charles Keepax 2021-05-10 1334 goto err_reset; 26495252fe0d1e Charles Keepax 2021-05-10 1335 } 6d10c91493a0b3 Brian Austin 2011-11-16 1336 6d10c91493a0b3 Brian Austin 2011-11-16 1337 if (devid != CS42L73_DEVID) { ea0756158110fe Axel Lin 2011-11-19 1338 ret = -ENODEV; 6d10c91493a0b3 Brian Austin 2011-11-16 1339 dev_err(&i2c_client->dev, 6d10c91493a0b3 Brian Austin 2011-11-16 1340 "CS42L73 Device ID (%X). Expected %X\n", 6d10c91493a0b3 Brian Austin 2011-11-16 1341 devid, CS42L73_DEVID); 26495252fe0d1e Charles Keepax 2021-05-10 1342 goto err_reset; 6d10c91493a0b3 Brian Austin 2011-11-16 1343 } 6d10c91493a0b3 Brian Austin 2011-11-16 1344 6d10c91493a0b3 Brian Austin 2011-11-16 1345 ret = regmap_read(cs42l73->regmap, CS42L73_REVID, ®); 6d10c91493a0b3 Brian Austin 2011-11-16 1346 if (ret < 0) { 6d10c91493a0b3 Brian Austin 2011-11-16 1347 dev_err(&i2c_client->dev, "Get Revision ID failed\n"); 26495252fe0d1e Charles Keepax 2021-05-10 1348 goto err_reset; 6d10c91493a0b3 Brian Austin 2011-11-16 1349 } 6d10c91493a0b3 Brian Austin 2011-11-16 1350 6d10c91493a0b3 Brian Austin 2011-11-16 1351 dev_info(&i2c_client->dev, 8421f620da9717 Axel Lin 2011-11-19 1352 "Cirrus Logic CS42L73, Revision: %02X\n", reg & 0xFF); 6d10c91493a0b3 Brian Austin 2011-11-16 1353 092631bf863d6c Kuninori Morimoto 2018-01-29 1354 ret = devm_snd_soc_register_component(&i2c_client->dev, 092631bf863d6c Kuninori Morimoto 2018-01-29 1355 &soc_component_dev_cs42l73, cs42l73_dai, 6d10c91493a0b3 Brian Austin 2011-11-16 1356 ARRAY_SIZE(cs42l73_dai)); 6d10c91493a0b3 Brian Austin 2011-11-16 1357 if (ret < 0) 26495252fe0d1e Charles Keepax 2021-05-10 1358 goto err_reset; 26495252fe0d1e Charles Keepax 2021-05-10 1359 571f6a7f07e9dd Brian Austin 2012-06-04 1360 return 0; 26495252fe0d1e Charles Keepax 2021-05-10 1361 26495252fe0d1e Charles Keepax 2021-05-10 1362 err_reset: 26495252fe0d1e Charles Keepax 2021-05-10 1363 gpio_set_value_cansleep(cs42l73->pdata.reset_gpio, 0); 26495252fe0d1e Charles Keepax 2021-05-10 1364 26495252fe0d1e Charles Keepax 2021-05-10 1365 return ret; 6d10c91493a0b3 Brian Austin 2011-11-16 1366 } 6d10c91493a0b3 Brian Austin 2011-11-16 1367
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.3-rc2 next-20230310] [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-Drop-unused-inclusions-from-of_gpio-h/20230313-224656 base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next patch link: https://lore.kernel.org/r/20230313144557.35856-1-andriy.shevchenko%40linux.intel.com patch subject: [rft, PATCH v1 1/1] gpio: Drop unused inclusions from of_gpio.h config: mips-allmodconfig (https://download.01.org/0day-ci/archive/20230314/202303140154.SFYdafUn-lkp@intel.com/config) compiler: mips-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/b108d11788b6db9e37a6c4b3110c09cecf30a46c git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Andy-Shevchenko/gpio-Drop-unused-inclusions-from-of_gpio-h/20230313-224656 git checkout b108d11788b6db9e37a6c4b3110c09cecf30a46c # 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=mips olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/tty/serial/ 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/202303140154.SFYdafUn-lkp@intel.com/ All errors (new ones prefixed by >>): drivers/tty/serial/pic32_uart.c: In function 'pic32_uart_get_mctrl': >> drivers/tty/serial/pic32_uart.c:169:18: error: implicit declaration of function 'gpiod_get_value' [-Werror=implicit-function-declaration] 169 | else if (gpiod_get_value(sport->cts_gpiod)) | ^~~~~~~~~~~~~~~ drivers/tty/serial/pic32_uart.c: In function 'pic32_uart_probe': >> drivers/tty/serial/pic32_uart.c:899:28: error: implicit declaration of function 'devm_gpiod_get_optional'; did you mean 'devm_clk_get_optional'? [-Werror=implicit-function-declaration] 899 | sport->cts_gpiod = devm_gpiod_get_optional(dev, "cts", GPIOD_IN); | ^~~~~~~~~~~~~~~~~~~~~~~ | devm_clk_get_optional >> drivers/tty/serial/pic32_uart.c:899:64: error: 'GPIOD_IN' undeclared (first use in this function); did you mean 'IOC_IN'? 899 | sport->cts_gpiod = devm_gpiod_get_optional(dev, "cts", GPIOD_IN); | ^~~~~~~~ | IOC_IN drivers/tty/serial/pic32_uart.c:899:64: note: each undeclared identifier is reported only once for each function it appears in >> drivers/tty/serial/pic32_uart.c:902:9: error: implicit declaration of function 'gpiod_set_consumer_name' [-Werror=implicit-function-declaration] 902 | gpiod_set_consumer_name(sport->cts_gpiod, "CTS"); | ^~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +/gpiod_get_value +169 drivers/tty/serial/pic32_uart.c 157b9394709ed5 Andrei Pistirica 2016-01-13 159 157b9394709ed5 Andrei Pistirica 2016-01-13 160 /* serial core request to return the state of misc UART input pins */ 157b9394709ed5 Andrei Pistirica 2016-01-13 161 static unsigned int pic32_uart_get_mctrl(struct uart_port *port) 157b9394709ed5 Andrei Pistirica 2016-01-13 162 { 157b9394709ed5 Andrei Pistirica 2016-01-13 163 struct pic32_sport *sport = to_pic32_sport(port); 157b9394709ed5 Andrei Pistirica 2016-01-13 164 unsigned int mctrl = 0; 157b9394709ed5 Andrei Pistirica 2016-01-13 165 e9c9d3bb158df0 Andy Shevchenko 2022-08-07 166 /* get the state of CTS input pin for this port */ e9c9d3bb158df0 Andy Shevchenko 2022-08-07 167 if (!sport->cts_gpiod) 157b9394709ed5 Andrei Pistirica 2016-01-13 168 mctrl |= TIOCM_CTS; e9c9d3bb158df0 Andy Shevchenko 2022-08-07 @169 else if (gpiod_get_value(sport->cts_gpiod)) 157b9394709ed5 Andrei Pistirica 2016-01-13 170 mctrl |= TIOCM_CTS; 157b9394709ed5 Andrei Pistirica 2016-01-13 171 157b9394709ed5 Andrei Pistirica 2016-01-13 172 /* DSR and CD are not supported in PIC32, so return 1 157b9394709ed5 Andrei Pistirica 2016-01-13 173 * RI is not supported in PIC32, so return 0 157b9394709ed5 Andrei Pistirica 2016-01-13 174 */ 157b9394709ed5 Andrei Pistirica 2016-01-13 175 mctrl |= TIOCM_CD; 157b9394709ed5 Andrei Pistirica 2016-01-13 176 mctrl |= TIOCM_DSR; 157b9394709ed5 Andrei Pistirica 2016-01-13 177 157b9394709ed5 Andrei Pistirica 2016-01-13 178 return mctrl; 157b9394709ed5 Andrei Pistirica 2016-01-13 179 } 157b9394709ed5 Andrei Pistirica 2016-01-13 180
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.3-rc2 next-20230310] [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-Drop-unused-inclusions-from-of_gpio-h/20230313-224656 base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next patch link: https://lore.kernel.org/r/20230313144557.35856-1-andriy.shevchenko%40linux.intel.com patch subject: [rft, PATCH v1 1/1] gpio: Drop unused inclusions from of_gpio.h config: x86_64-randconfig-a016-20230313 (https://download.01.org/0day-ci/archive/20230314/202303140127.447rXq8p-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/b108d11788b6db9e37a6c4b3110c09cecf30a46c git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Andy-Shevchenko/gpio-Drop-unused-inclusions-from-of_gpio-h/20230313-224656 git checkout b108d11788b6db9e37a6c4b3110c09cecf30a46c # 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/regulator/ 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/202303140127.447rXq8p-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/regulator/s5m8767.c:274:2: error: implicit declaration of function 'gpio_set_value' is invalid in C99 [-Werror,-Wimplicit-function-declaration] gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1); ^ drivers/regulator/s5m8767.c:274:2: note: did you mean 'gpiod_set_value'? include/linux/gpio/consumer.h:122:6: note: 'gpiod_set_value' declared here void gpiod_set_value(struct gpio_desc *desc, int value); ^ drivers/regulator/s5m8767.c:285:2: error: implicit declaration of function 'gpio_set_value' is invalid in C99 [-Werror,-Wimplicit-function-declaration] gpio_set_value(s5m8767->buck_gpios[2], temp_index & 0x1); ^ drivers/regulator/s5m8767.c:493:8: error: implicit declaration of function 'gpio_is_valid' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (!gpio_is_valid(gpio)) { ^ drivers/regulator/s5m8767.c:493:8: note: did you mean 'uuid_is_valid'? include/linux/uuid.h:102:19: note: 'uuid_is_valid' declared here bool __must_check uuid_is_valid(const char *uuid); ^ drivers/regulator/s5m8767.c:511:8: error: implicit declaration of function 'gpio_is_valid' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (!gpio_is_valid(gpio)) { ^ drivers/regulator/s5m8767.c:535:18: error: implicit declaration of function 'of_get_child_by_name' is invalid in C99 [-Werror,-Wimplicit-function-declaration] regulators_np = of_get_child_by_name(pmic_np, "regulators"); ^ >> drivers/regulator/s5m8767.c:535:16: warning: incompatible integer to pointer conversion assigning to 'struct device_node *' from 'int' [-Wint-conversion] regulators_np = of_get_child_by_name(pmic_np, "regulators"); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/regulator/s5m8767.c:542:26: error: implicit declaration of function 'of_get_child_count' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pdata->num_regulators = of_get_child_count(regulators_np); ^ drivers/regulator/s5m8767.c:542:26: note: did you mean 'of_get_child_by_name'? drivers/regulator/s5m8767.c:535:18: note: 'of_get_child_by_name' declared here regulators_np = of_get_child_by_name(pmic_np, "regulators"); ^ drivers/regulator/s5m8767.c:548:3: error: implicit declaration of function 'of_node_put' is invalid in C99 [-Werror,-Wimplicit-function-declaration] of_node_put(regulators_np); ^ drivers/regulator/s5m8767.c:556:3: error: implicit declaration of function 'of_node_put' is invalid in C99 [-Werror,-Wimplicit-function-declaration] of_node_put(regulators_np); ^ drivers/regulator/s5m8767.c:562:2: error: implicit declaration of function 'for_each_child_of_node' is invalid in C99 [-Werror,-Wimplicit-function-declaration] for_each_child_of_node(regulators_np, reg_np) { ^ drivers/regulator/s5m8767.c:562:47: error: expected ';' after expression for_each_child_of_node(regulators_np, reg_np) { ^ ; drivers/regulator/s5m8767.c:564:8: error: implicit declaration of function 'of_node_name_eq' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (of_node_name_eq(reg_np, regulators[i].name)) ^ drivers/regulator/s5m8767.c:571:4: error: 'continue' statement not in loop statement continue; ^ drivers/regulator/s5m8767.c:576:4: error: implicit declaration of function 'of_fwnode_handle' is invalid in C99 [-Werror,-Wimplicit-function-declaration] of_fwnode_handle(reg_np), ^ >> drivers/regulator/s5m8767.c:576:4: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'struct fwnode_handle *' [-Wint-conversion] of_fwnode_handle(reg_np), ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/gpio/consumer.h:573:28: note: passing argument to parameter 'fwnode' here struct fwnode_handle *fwnode, ^ drivers/regulator/s5m8767.c:583:4: error: implicit declaration of function 'of_node_put' is invalid in C99 [-Werror,-Wimplicit-function-declaration] of_node_put(reg_np); ^ drivers/regulator/s5m8767.c:595:7: error: implicit declaration of function 'of_property_read_u32' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (of_property_read_u32(reg_np, "op_mode", ^ drivers/regulator/s5m8767.c:606:2: error: implicit declaration of function 'of_node_put' is invalid in C99 [-Werror,-Wimplicit-function-declaration] of_node_put(regulators_np); ^ drivers/regulator/s5m8767.c:608:6: error: implicit declaration of function 'of_get_property' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (of_get_property(pmic_np, "s5m8767,pmic-buck2-uses-gpio-dvs", NULL)) { ^ drivers/regulator/s5m8767.c:611:7: error: implicit declaration of function 'of_property_read_u32_array' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (of_property_read_u32_array(pmic_np, ^ drivers/regulator/s5m8767.c:622:7: error: implicit declaration of function 'of_property_read_u32_array' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (of_property_read_u32_array(pmic_np, ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 2 warnings and 20 errors generated. vim +535 drivers/regulator/s5m8767.c 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 519 cbb0ed495ca165 Axel Lin 2013-02-13 520 static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev, 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 521 struct sec_platform_data *pdata) 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 522 { cbb0ed495ca165 Axel Lin 2013-02-13 523 struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 524 struct device_node *pmic_np, *regulators_np, *reg_np; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 525 struct sec_regulator_data *rdata; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 526 struct sec_opmode_data *rmode; 04f9f068a619cc Chanwoo Choi 2013-10-10 527 unsigned int i, dvs_voltage_nr = 8, ret; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 528 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 529 pmic_np = iodev->dev->of_node; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 530 if (!pmic_np) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 531 dev_err(iodev->dev, "could not find pmic sub-node\n"); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 532 return -ENODEV; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 533 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 534 4e52c03dfcdef5 Sachin Kamat 2014-02-13 @535 regulators_np = of_get_child_by_name(pmic_np, "regulators"); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 536 if (!regulators_np) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 537 dev_err(iodev->dev, "could not find regulators sub-node\n"); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 538 return -EINVAL; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 539 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 540 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 541 /* count the number of regulators to be supported in pmic */ 1f91b6f6c747d3 Axel Lin 2013-02-06 542 pdata->num_regulators = of_get_child_count(regulators_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 543 a86854d0c599b3 Kees Cook 2018-06-12 544 rdata = devm_kcalloc(&pdev->dev, a86854d0c599b3 Kees Cook 2018-06-12 545 pdata->num_regulators, sizeof(*rdata), a86854d0c599b3 Kees Cook 2018-06-12 546 GFP_KERNEL); a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 547 if (!rdata) { a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 548 of_node_put(regulators_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 549 return -ENOMEM; a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 550 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 551 a86854d0c599b3 Kees Cook 2018-06-12 552 rmode = devm_kcalloc(&pdev->dev, a86854d0c599b3 Kees Cook 2018-06-12 553 pdata->num_regulators, sizeof(*rmode), a86854d0c599b3 Kees Cook 2018-06-12 554 GFP_KERNEL); a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 555 if (!rmode) { a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 556 of_node_put(regulators_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 557 return -ENOMEM; a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 558 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 559 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 560 pdata->regulators = rdata; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 561 pdata->opmode = rmode; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 562 for_each_child_of_node(regulators_np, reg_np) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 563 for (i = 0; i < ARRAY_SIZE(regulators); i++) c32569e358adea Rob Herring 2018-12-05 564 if (of_node_name_eq(reg_np, regulators[i].name)) 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 565 break; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 566 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 567 if (i == ARRAY_SIZE(regulators)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 568 dev_warn(iodev->dev, 0c9721a5d1dea7 Rob Herring 2018-08-27 569 "don't know how to configure regulator %pOFn\n", 0c9721a5d1dea7 Rob Herring 2018-08-27 570 reg_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 571 continue; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 572 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 573 5be0e549e18f8a Dmitry Torokhov 2019-10-04 574 rdata->ext_control_gpiod = devm_fwnode_gpiod_get( 63239e4bf7eff3 Linus Walleij 2018-10-15 575 &pdev->dev, 5be0e549e18f8a Dmitry Torokhov 2019-10-04 @576 of_fwnode_handle(reg_np), 5be0e549e18f8a Dmitry Torokhov 2019-10-04 577 "s5m8767,pmic-ext-control", 63239e4bf7eff3 Linus Walleij 2018-10-15 578 GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE, 9ae5cc75ceaacf Linus Walleij 2018-05-14 579 "s5m8767"); dea6dd2ba63f8c Pan Bian 2021-01-20 580 if (PTR_ERR(rdata->ext_control_gpiod) == -ENOENT) { 025bf37725f192 Waibel Georg 2019-06-20 581 rdata->ext_control_gpiod = NULL; dea6dd2ba63f8c Pan Bian 2021-01-20 582 } else if (IS_ERR(rdata->ext_control_gpiod)) { dea6dd2ba63f8c Pan Bian 2021-01-20 583 of_node_put(reg_np); dea6dd2ba63f8c Pan Bian 2021-01-20 584 of_node_put(regulators_np); 9ae5cc75ceaacf Linus Walleij 2018-05-14 585 return PTR_ERR(rdata->ext_control_gpiod); dea6dd2ba63f8c Pan Bian 2021-01-20 586 } ee1e0994ab1bd3 Krzysztof Kozlowski 2014-01-24 587 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 588 rdata->id = i; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 589 rdata->initdata = of_get_regulator_init_data( 072e78b12bf518 Javier Martinez Canillas 2014-11-10 590 &pdev->dev, reg_np, 072e78b12bf518 Javier Martinez Canillas 2014-11-10 591 ®ulators[i]); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 592 rdata->reg_node = reg_np; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 593 rdata++; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 594 rmode->id = i; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 595 if (of_property_read_u32(reg_np, "op_mode", 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 596 &rmode->mode)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 597 dev_warn(iodev->dev, f3c7f7b636ef50 Christophe JAILLET 2019-12-03 598 "no op_mode property at %pOF\n", 7799167b7a14fe Rob Herring 2017-07-18 599 reg_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 600 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 601 rmode->mode = S5M8767_OPMODE_NORMAL_MODE; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 602 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 603 rmode++; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 604 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 605 b7db01f3b3b86f Sachin Kamat 2014-02-13 606 of_node_put(regulators_np); b7db01f3b3b86f Sachin Kamat 2014-02-13 607 04f9f068a619cc Chanwoo Choi 2013-10-10 608 if (of_get_property(pmic_np, "s5m8767,pmic-buck2-uses-gpio-dvs", NULL)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 609 pdata->buck2_gpiodvs = true; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 610 04f9f068a619cc Chanwoo Choi 2013-10-10 611 if (of_property_read_u32_array(pmic_np, 04f9f068a619cc Chanwoo Choi 2013-10-10 612 "s5m8767,pmic-buck2-dvs-voltage", 04f9f068a619cc Chanwoo Choi 2013-10-10 613 pdata->buck2_voltage, dvs_voltage_nr)) { 04f9f068a619cc Chanwoo Choi 2013-10-10 614 dev_err(iodev->dev, "buck2 voltages not specified\n"); 04f9f068a619cc Chanwoo Choi 2013-10-10 615 return -EINVAL; 04f9f068a619cc Chanwoo Choi 2013-10-10 616 } 04f9f068a619cc Chanwoo Choi 2013-10-10 617 } 04f9f068a619cc Chanwoo Choi 2013-10-10 618 04f9f068a619cc Chanwoo Choi 2013-10-10 619 if (of_get_property(pmic_np, "s5m8767,pmic-buck3-uses-gpio-dvs", NULL)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 620 pdata->buck3_gpiodvs = true; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 621 04f9f068a619cc Chanwoo Choi 2013-10-10 622 if (of_property_read_u32_array(pmic_np, 04f9f068a619cc Chanwoo Choi 2013-10-10 623 "s5m8767,pmic-buck3-dvs-voltage", 04f9f068a619cc Chanwoo Choi 2013-10-10 624 pdata->buck3_voltage, dvs_voltage_nr)) { 04f9f068a619cc Chanwoo Choi 2013-10-10 625 dev_err(iodev->dev, "buck3 voltages not specified\n"); 04f9f068a619cc Chanwoo Choi 2013-10-10 626 return -EINVAL; 04f9f068a619cc Chanwoo Choi 2013-10-10 627 } 04f9f068a619cc Chanwoo Choi 2013-10-10 628 } 04f9f068a619cc Chanwoo Choi 2013-10-10 629 04f9f068a619cc Chanwoo Choi 2013-10-10 630 if (of_get_property(pmic_np, "s5m8767,pmic-buck4-uses-gpio-dvs", NULL)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 631 pdata->buck4_gpiodvs = true; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 632 04f9f068a619cc Chanwoo Choi 2013-10-10 633 if (of_property_read_u32_array(pmic_np, 04f9f068a619cc Chanwoo Choi 2013-10-10 634 "s5m8767,pmic-buck4-dvs-voltage", 04f9f068a619cc Chanwoo Choi 2013-10-10 635 pdata->buck4_voltage, dvs_voltage_nr)) { 04f9f068a619cc Chanwoo Choi 2013-10-10 636 dev_err(iodev->dev, "buck4 voltages not specified\n"); 04f9f068a619cc Chanwoo Choi 2013-10-10 637 return -EINVAL; 04f9f068a619cc Chanwoo Choi 2013-10-10 638 } 04f9f068a619cc Chanwoo Choi 2013-10-10 639 } 04f9f068a619cc Chanwoo Choi 2013-10-10 640 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 641 if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs || 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 642 pdata->buck4_gpiodvs) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 643 ret = s5m8767_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 644 if (ret) 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 645 return -EINVAL; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 646 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 647 if (of_property_read_u32(pmic_np, 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 648 "s5m8767,pmic-buck-default-dvs-idx", 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 649 &pdata->buck_default_idx)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 650 pdata->buck_default_idx = 0; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 651 } else { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 652 if (pdata->buck_default_idx >= 8) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 653 pdata->buck_default_idx = 0; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 654 dev_info(iodev->dev, 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 655 "invalid value for default dvs index, use 0\n"); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 656 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 657 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 658 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 659 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 660 ret = s5m8767_pmic_dt_parse_ds_gpio(iodev, pdata, pmic_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 661 if (ret) 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 662 return -EINVAL; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 663 033054e8603036 Chanwoo Choi 2013-10-10 664 if (of_get_property(pmic_np, "s5m8767,pmic-buck2-ramp-enable", NULL)) 033054e8603036 Chanwoo Choi 2013-10-10 665 pdata->buck2_ramp_enable = true; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 666 033054e8603036 Chanwoo Choi 2013-10-10 667 if (of_get_property(pmic_np, "s5m8767,pmic-buck3-ramp-enable", NULL)) 033054e8603036 Chanwoo Choi 2013-10-10 668 pdata->buck3_ramp_enable = true; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 669 033054e8603036 Chanwoo Choi 2013-10-10 670 if (of_get_property(pmic_np, "s5m8767,pmic-buck4-ramp-enable", NULL)) 033054e8603036 Chanwoo Choi 2013-10-10 671 pdata->buck4_ramp_enable = true; 033054e8603036 Chanwoo Choi 2013-10-10 672 033054e8603036 Chanwoo Choi 2013-10-10 673 if (pdata->buck2_ramp_enable || pdata->buck3_ramp_enable 033054e8603036 Chanwoo Choi 2013-10-10 674 || pdata->buck4_ramp_enable) { 033054e8603036 Chanwoo Choi 2013-10-10 675 if (of_property_read_u32(pmic_np, "s5m8767,pmic-buck-ramp-delay", 033054e8603036 Chanwoo Choi 2013-10-10 676 &pdata->buck_ramp_delay)) 033054e8603036 Chanwoo Choi 2013-10-10 677 pdata->buck_ramp_delay = 0; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 678 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 679 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 680 return 0; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 681 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 682 #else cbb0ed495ca165 Axel Lin 2013-02-13 683 static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev, 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 684 struct sec_platform_data *pdata) 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 685 { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 686 return 0; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 687 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 688 #endif /* CONFIG_OF */ 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 689
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.3-rc2 next-20230310] [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-Drop-unused-inclusions-from-of_gpio-h/20230313-224656 base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next patch link: https://lore.kernel.org/r/20230313144557.35856-1-andriy.shevchenko%40linux.intel.com patch subject: [rft, PATCH v1 1/1] gpio: Drop unused inclusions from of_gpio.h config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20230314/202303140150.VrCOppiE-lkp@intel.com/config) compiler: arm-linux-gnueabi-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/b108d11788b6db9e37a6c4b3110c09cecf30a46c git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Andy-Shevchenko/gpio-Drop-unused-inclusions-from-of_gpio-h/20230313-224656 git checkout b108d11788b6db9e37a6c4b3110c09cecf30a46c # 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=arm olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/drm/sti/ drivers/net/ethernet/smsc/ drivers/net/phy/ drivers/nfc/nfcmrvl/ drivers/pci/controller/dwc/ drivers/regulator/ drivers/video/backlight/ sound/soc/codecs/ sound/soc/samsung/ 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/202303140150.VrCOppiE-lkp@intel.com/ All warnings (new ones prefixed by >>): sound/soc/codecs/wcd938x.c:4056:21: error: variable 'wcd_domain_ops' has initializer but incomplete type 4056 | static const struct irq_domain_ops wcd_domain_ops = { | ^~~~~~~~~~~~~~ sound/soc/codecs/wcd938x.c:4057:10: error: 'const struct irq_domain_ops' has no member named 'map' 4057 | .map = wcd_irq_chip_map, | ^~~ >> sound/soc/codecs/wcd938x.c:4057:16: warning: excess elements in struct initializer 4057 | .map = wcd_irq_chip_map, | ^~~~~~~~~~~~~~~~ sound/soc/codecs/wcd938x.c:4057:16: note: (near initialization for 'wcd_domain_ops') sound/soc/codecs/wcd938x.c: In function 'wcd938x_irq_init': sound/soc/codecs/wcd938x.c:4063:21: error: implicit declaration of function 'irq_domain_add_linear' [-Werror=implicit-function-declaration] 4063 | wcd->virq = irq_domain_add_linear(NULL, 1, &wcd_domain_ops, NULL); | ^~~~~~~~~~~~~~~~~~~~~ >> sound/soc/codecs/wcd938x.c:4063:19: warning: assignment to 'struct irq_domain *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 4063 | wcd->virq = irq_domain_add_linear(NULL, 1, &wcd_domain_ops, NULL); | ^ sound/soc/codecs/wcd938x.c:4070:41: error: implicit declaration of function 'irq_create_mapping' [-Werror=implicit-function-declaration] 4070 | irq_create_mapping(wcd->virq, 0), | ^~~~~~~~~~~~~~~~~~ sound/soc/codecs/wcd938x.c: In function 'wcd938x_reset': sound/soc/codecs/wcd938x.c:4288:9: error: implicit declaration of function 'gpio_direction_output'; did you mean 'gpiod_direction_output'? [-Werror=implicit-function-declaration] 4288 | gpio_direction_output(wcd938x->reset_gpio, 0); | ^~~~~~~~~~~~~~~~~~~~~ | gpiod_direction_output sound/soc/codecs/wcd938x.c:4291:9: error: implicit declaration of function 'gpio_set_value'; did you mean 'gpiod_set_value'? [-Werror=implicit-function-declaration] 4291 | gpio_set_value(wcd938x->reset_gpio, 1); | ^~~~~~~~~~~~~~ | gpiod_set_value sound/soc/codecs/wcd938x.c: At top level: sound/soc/codecs/wcd938x.c:4056:36: error: storage size of 'wcd_domain_ops' isn't known 4056 | static const struct irq_domain_ops wcd_domain_ops = { | ^~~~~~~~~~~~~~ cc1: some warnings being treated as errors -- drivers/regulator/s5m8767.c: In function 's5m8767_set_high': drivers/regulator/s5m8767.c:274:9: error: implicit declaration of function 'gpio_set_value'; did you mean 'gpiod_set_value'? [-Werror=implicit-function-declaration] 274 | gpio_set_value(s5m8767->buck_gpios[0], (temp_index >> 2) & 0x1); | ^~~~~~~~~~~~~~ | gpiod_set_value drivers/regulator/s5m8767.c: In function 's5m8767_pmic_dt_parse_dvs_gpio': drivers/regulator/s5m8767.c:493:22: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Werror=implicit-function-declaration] 493 | if (!gpio_is_valid(gpio)) { | ^~~~~~~~~~~~~ | uuid_is_valid drivers/regulator/s5m8767.c: In function 's5m8767_pmic_dt_parse_pdata': drivers/regulator/s5m8767.c:535:25: error: implicit declaration of function 'of_get_child_by_name' [-Werror=implicit-function-declaration] 535 | regulators_np = of_get_child_by_name(pmic_np, "regulators"); | ^~~~~~~~~~~~~~~~~~~~ >> drivers/regulator/s5m8767.c:535:23: warning: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 535 | regulators_np = of_get_child_by_name(pmic_np, "regulators"); | ^ drivers/regulator/s5m8767.c:542:33: error: implicit declaration of function 'of_get_child_count' [-Werror=implicit-function-declaration] 542 | pdata->num_regulators = of_get_child_count(regulators_np); | ^~~~~~~~~~~~~~~~~~ drivers/regulator/s5m8767.c:548:17: error: implicit declaration of function 'of_node_put' [-Werror=implicit-function-declaration] 548 | of_node_put(regulators_np); | ^~~~~~~~~~~ drivers/regulator/s5m8767.c:562:9: error: implicit declaration of function 'for_each_child_of_node'; did you mean 'for_each_online_node'? [-Werror=implicit-function-declaration] 562 | for_each_child_of_node(regulators_np, reg_np) { | ^~~~~~~~~~~~~~~~~~~~~~ | for_each_online_node drivers/regulator/s5m8767.c:562:54: error: expected ';' before '{' token 562 | for_each_child_of_node(regulators_np, reg_np) { | ^~ | ; drivers/regulator/s5m8767.c:608:13: error: implicit declaration of function 'of_get_property' [-Werror=implicit-function-declaration] 608 | if (of_get_property(pmic_np, "s5m8767,pmic-buck2-uses-gpio-dvs", NULL)) { | ^~~~~~~~~~~~~~~ drivers/regulator/s5m8767.c:611:21: error: implicit declaration of function 'of_property_read_u32_array' [-Werror=implicit-function-declaration] 611 | if (of_property_read_u32_array(pmic_np, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/regulator/s5m8767.c:647:21: error: implicit declaration of function 'of_property_read_u32' [-Werror=implicit-function-declaration] 647 | if (of_property_read_u32(pmic_np, | ^~~~~~~~~~~~~~~~~~~~ drivers/regulator/s5m8767.c:527:22: warning: unused variable 'i' [-Wunused-variable] 527 | unsigned int i, dvs_voltage_nr = 8, ret; | ^ drivers/regulator/s5m8767.c: In function 's5m8767_pmic_probe': drivers/regulator/s5m8767.c:808:23: error: implicit declaration of function 'devm_gpio_request'; did you mean 'devm_gpiod_put'? [-Werror=implicit-function-declaration] 808 | ret = devm_gpio_request(&pdev->dev, pdata->buck_gpios[0], | ^~~~~~~~~~~~~~~~~ | devm_gpiod_put drivers/regulator/s5m8767.c:824:17: error: implicit declaration of function 'gpio_direction_output'; did you mean 'gpiod_direction_output'? [-Werror=implicit-function-declaration] 824 | gpio_direction_output(pdata->buck_gpios[0], | ^~~~~~~~~~~~~~~~~~~~~ | gpiod_direction_output drivers/regulator/s5m8767.c: At top level: drivers/regulator/s5m8767.c:998:40: error: array type has incomplete element type 'struct platform_device_id' 998 | static const struct platform_device_id s5m8767_pmic_id[] = { | ^~~~~~~~~~~~~~~ drivers/regulator/s5m8767.c:998:40: warning: 's5m8767_pmic_id' defined but not used [-Wunused-variable] cc1: some warnings being treated as errors -- drivers/net/phy/at803x.c:629:21: error: implicit declaration of function 'of_match_ptr' [-Werror=implicit-function-declaration] 629 | .of_match = of_match_ptr("vddio-regulator"), | ^~~~~~~~~~~~ >> drivers/net/phy/at803x.c:629:21: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] drivers/net/phy/at803x.c:629:21: note: (near initialization for 'vddio_desc.of_match') drivers/net/phy/at803x.c:629:21: error: initializer element is not constant drivers/net/phy/at803x.c:629:21: note: (near initialization for 'vddio_desc.of_match') drivers/net/phy/at803x.c:642:21: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 642 | .of_match = of_match_ptr("vddh-regulator"), | ^~~~~~~~~~~~ drivers/net/phy/at803x.c:642:21: note: (near initialization for 'vddh_desc.of_match') drivers/net/phy/at803x.c:642:21: error: initializer element is not constant drivers/net/phy/at803x.c:642:21: note: (near initialization for 'vddh_desc.of_match') drivers/net/phy/at803x.c: In function 'at803x_parse_dt': drivers/net/phy/at803x.c:735:13: error: implicit declaration of function 'of_property_read_bool' [-Werror=implicit-function-declaration] 735 | if (of_property_read_bool(node, "qca,disable-smarteee")) | ^~~~~~~~~~~~~~~~~~~~~ drivers/net/phy/at803x.c:741:14: error: implicit declaration of function 'of_property_read_u32' [-Werror=implicit-function-declaration] 741 | if (!of_property_read_u32(node, "qca,smarteee-tw-us-1g", &tw)) { | ^~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors -- drivers/nfc/nfcmrvl/uart.c: In function 'nfcmrvl_uart_parse_dt': drivers/nfc/nfcmrvl/uart.c:65:24: error: implicit declaration of function 'of_get_compatible_child' [-Werror=implicit-function-declaration] 65 | matched_node = of_get_compatible_child(node, "marvell,nfc-uart"); | ^~~~~~~~~~~~~~~~~~~~~~~ >> drivers/nfc/nfcmrvl/uart.c:65:22: warning: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 65 | matched_node = of_get_compatible_child(node, "marvell,nfc-uart"); | ^ drivers/nfc/nfcmrvl/uart.c:67:30: warning: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 67 | matched_node = of_get_compatible_child(node, "mrvl,nfc-uart"); | ^ drivers/nfc/nfcmrvl/uart.c:75:17: error: implicit declaration of function 'of_node_put' [-Werror=implicit-function-declaration] 75 | of_node_put(matched_node); | ^~~~~~~~~~~ drivers/nfc/nfcmrvl/uart.c:79:13: error: implicit declaration of function 'of_find_property' [-Werror=implicit-function-declaration] 79 | if (of_find_property(matched_node, "flow-control", NULL)) | ^~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors -- drivers/gpu/drm/sti/sti_dvo.c: In function 'sti_dvo_probe': drivers/gpu/drm/sti/sti_dvo.c:560:27: error: implicit declaration of function 'of_parse_phandle' [-Werror=implicit-function-declaration] 560 | dvo->panel_node = of_parse_phandle(np, "sti,panel", 0); | ^~~~~~~~~~~~~~~~ >> drivers/gpu/drm/sti/sti_dvo.c:560:25: warning: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 560 | dvo->panel_node = of_parse_phandle(np, "sti,panel", 0); | ^ drivers/gpu/drm/sti/sti_dvo.c:563:9: error: implicit declaration of function 'of_node_put' [-Werror=implicit-function-declaration] 563 | of_node_put(dvo->panel_node); | ^~~~~~~~~~~ drivers/gpu/drm/sti/sti_dvo.c: At top level: drivers/gpu/drm/sti/sti_dvo.c:576:34: error: array type has incomplete element type 'struct of_device_id' 576 | static const struct of_device_id dvo_of_match[] = { | ^~~~~~~~~~~~ drivers/gpu/drm/sti/sti_dvo.c:576:34: warning: 'dvo_of_match' defined but not used [-Wunused-variable] cc1: some warnings being treated as errors vim +535 drivers/regulator/s5m8767.c 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 519 cbb0ed495ca165 Axel Lin 2013-02-13 520 static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev, 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 521 struct sec_platform_data *pdata) 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 522 { cbb0ed495ca165 Axel Lin 2013-02-13 523 struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 524 struct device_node *pmic_np, *regulators_np, *reg_np; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 525 struct sec_regulator_data *rdata; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 526 struct sec_opmode_data *rmode; 04f9f068a619cc Chanwoo Choi 2013-10-10 527 unsigned int i, dvs_voltage_nr = 8, ret; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 528 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 529 pmic_np = iodev->dev->of_node; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 530 if (!pmic_np) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 531 dev_err(iodev->dev, "could not find pmic sub-node\n"); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 532 return -ENODEV; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 533 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 534 4e52c03dfcdef5 Sachin Kamat 2014-02-13 @535 regulators_np = of_get_child_by_name(pmic_np, "regulators"); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 536 if (!regulators_np) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 537 dev_err(iodev->dev, "could not find regulators sub-node\n"); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 538 return -EINVAL; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 539 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 540 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 541 /* count the number of regulators to be supported in pmic */ 1f91b6f6c747d3 Axel Lin 2013-02-06 542 pdata->num_regulators = of_get_child_count(regulators_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 543 a86854d0c599b3 Kees Cook 2018-06-12 544 rdata = devm_kcalloc(&pdev->dev, a86854d0c599b3 Kees Cook 2018-06-12 545 pdata->num_regulators, sizeof(*rdata), a86854d0c599b3 Kees Cook 2018-06-12 546 GFP_KERNEL); a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 547 if (!rdata) { a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 548 of_node_put(regulators_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 549 return -ENOMEM; a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 550 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 551 a86854d0c599b3 Kees Cook 2018-06-12 552 rmode = devm_kcalloc(&pdev->dev, a86854d0c599b3 Kees Cook 2018-06-12 553 pdata->num_regulators, sizeof(*rmode), a86854d0c599b3 Kees Cook 2018-06-12 554 GFP_KERNEL); a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 555 if (!rmode) { a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 556 of_node_put(regulators_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 557 return -ENOMEM; a5872bd3398d0f Krzysztof Kozlowski 2021-01-21 558 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 559 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 560 pdata->regulators = rdata; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 561 pdata->opmode = rmode; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 562 for_each_child_of_node(regulators_np, reg_np) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 563 for (i = 0; i < ARRAY_SIZE(regulators); i++) c32569e358adea Rob Herring 2018-12-05 564 if (of_node_name_eq(reg_np, regulators[i].name)) 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 565 break; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 566 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 567 if (i == ARRAY_SIZE(regulators)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 568 dev_warn(iodev->dev, 0c9721a5d1dea7 Rob Herring 2018-08-27 569 "don't know how to configure regulator %pOFn\n", 0c9721a5d1dea7 Rob Herring 2018-08-27 570 reg_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 571 continue; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 572 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 573 5be0e549e18f8a Dmitry Torokhov 2019-10-04 574 rdata->ext_control_gpiod = devm_fwnode_gpiod_get( 63239e4bf7eff3 Linus Walleij 2018-10-15 575 &pdev->dev, 5be0e549e18f8a Dmitry Torokhov 2019-10-04 576 of_fwnode_handle(reg_np), 5be0e549e18f8a Dmitry Torokhov 2019-10-04 577 "s5m8767,pmic-ext-control", 63239e4bf7eff3 Linus Walleij 2018-10-15 578 GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE, 9ae5cc75ceaacf Linus Walleij 2018-05-14 579 "s5m8767"); dea6dd2ba63f8c Pan Bian 2021-01-20 580 if (PTR_ERR(rdata->ext_control_gpiod) == -ENOENT) { 025bf37725f192 Waibel Georg 2019-06-20 581 rdata->ext_control_gpiod = NULL; dea6dd2ba63f8c Pan Bian 2021-01-20 582 } else if (IS_ERR(rdata->ext_control_gpiod)) { dea6dd2ba63f8c Pan Bian 2021-01-20 583 of_node_put(reg_np); dea6dd2ba63f8c Pan Bian 2021-01-20 584 of_node_put(regulators_np); 9ae5cc75ceaacf Linus Walleij 2018-05-14 585 return PTR_ERR(rdata->ext_control_gpiod); dea6dd2ba63f8c Pan Bian 2021-01-20 586 } ee1e0994ab1bd3 Krzysztof Kozlowski 2014-01-24 587 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 588 rdata->id = i; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 589 rdata->initdata = of_get_regulator_init_data( 072e78b12bf518 Javier Martinez Canillas 2014-11-10 590 &pdev->dev, reg_np, 072e78b12bf518 Javier Martinez Canillas 2014-11-10 591 ®ulators[i]); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 592 rdata->reg_node = reg_np; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 593 rdata++; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 594 rmode->id = i; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 595 if (of_property_read_u32(reg_np, "op_mode", 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 596 &rmode->mode)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 597 dev_warn(iodev->dev, f3c7f7b636ef50 Christophe JAILLET 2019-12-03 598 "no op_mode property at %pOF\n", 7799167b7a14fe Rob Herring 2017-07-18 599 reg_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 600 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 601 rmode->mode = S5M8767_OPMODE_NORMAL_MODE; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 602 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 603 rmode++; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 604 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 605 b7db01f3b3b86f Sachin Kamat 2014-02-13 606 of_node_put(regulators_np); b7db01f3b3b86f Sachin Kamat 2014-02-13 607 04f9f068a619cc Chanwoo Choi 2013-10-10 608 if (of_get_property(pmic_np, "s5m8767,pmic-buck2-uses-gpio-dvs", NULL)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 609 pdata->buck2_gpiodvs = true; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 610 04f9f068a619cc Chanwoo Choi 2013-10-10 611 if (of_property_read_u32_array(pmic_np, 04f9f068a619cc Chanwoo Choi 2013-10-10 612 "s5m8767,pmic-buck2-dvs-voltage", 04f9f068a619cc Chanwoo Choi 2013-10-10 613 pdata->buck2_voltage, dvs_voltage_nr)) { 04f9f068a619cc Chanwoo Choi 2013-10-10 614 dev_err(iodev->dev, "buck2 voltages not specified\n"); 04f9f068a619cc Chanwoo Choi 2013-10-10 615 return -EINVAL; 04f9f068a619cc Chanwoo Choi 2013-10-10 616 } 04f9f068a619cc Chanwoo Choi 2013-10-10 617 } 04f9f068a619cc Chanwoo Choi 2013-10-10 618 04f9f068a619cc Chanwoo Choi 2013-10-10 619 if (of_get_property(pmic_np, "s5m8767,pmic-buck3-uses-gpio-dvs", NULL)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 620 pdata->buck3_gpiodvs = true; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 621 04f9f068a619cc Chanwoo Choi 2013-10-10 622 if (of_property_read_u32_array(pmic_np, 04f9f068a619cc Chanwoo Choi 2013-10-10 623 "s5m8767,pmic-buck3-dvs-voltage", 04f9f068a619cc Chanwoo Choi 2013-10-10 624 pdata->buck3_voltage, dvs_voltage_nr)) { 04f9f068a619cc Chanwoo Choi 2013-10-10 625 dev_err(iodev->dev, "buck3 voltages not specified\n"); 04f9f068a619cc Chanwoo Choi 2013-10-10 626 return -EINVAL; 04f9f068a619cc Chanwoo Choi 2013-10-10 627 } 04f9f068a619cc Chanwoo Choi 2013-10-10 628 } 04f9f068a619cc Chanwoo Choi 2013-10-10 629 04f9f068a619cc Chanwoo Choi 2013-10-10 630 if (of_get_property(pmic_np, "s5m8767,pmic-buck4-uses-gpio-dvs", NULL)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 631 pdata->buck4_gpiodvs = true; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 632 04f9f068a619cc Chanwoo Choi 2013-10-10 633 if (of_property_read_u32_array(pmic_np, 04f9f068a619cc Chanwoo Choi 2013-10-10 634 "s5m8767,pmic-buck4-dvs-voltage", 04f9f068a619cc Chanwoo Choi 2013-10-10 635 pdata->buck4_voltage, dvs_voltage_nr)) { 04f9f068a619cc Chanwoo Choi 2013-10-10 636 dev_err(iodev->dev, "buck4 voltages not specified\n"); 04f9f068a619cc Chanwoo Choi 2013-10-10 637 return -EINVAL; 04f9f068a619cc Chanwoo Choi 2013-10-10 638 } 04f9f068a619cc Chanwoo Choi 2013-10-10 639 } 04f9f068a619cc Chanwoo Choi 2013-10-10 640 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 641 if (pdata->buck2_gpiodvs || pdata->buck3_gpiodvs || 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 642 pdata->buck4_gpiodvs) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 643 ret = s5m8767_pmic_dt_parse_dvs_gpio(iodev, pdata, pmic_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 644 if (ret) 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 645 return -EINVAL; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 646 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 647 if (of_property_read_u32(pmic_np, 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 648 "s5m8767,pmic-buck-default-dvs-idx", 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 649 &pdata->buck_default_idx)) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 650 pdata->buck_default_idx = 0; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 651 } else { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 652 if (pdata->buck_default_idx >= 8) { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 653 pdata->buck_default_idx = 0; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 654 dev_info(iodev->dev, 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 655 "invalid value for default dvs index, use 0\n"); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 656 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 657 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 658 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 659 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 660 ret = s5m8767_pmic_dt_parse_ds_gpio(iodev, pdata, pmic_np); 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 661 if (ret) 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 662 return -EINVAL; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 663 033054e8603036 Chanwoo Choi 2013-10-10 664 if (of_get_property(pmic_np, "s5m8767,pmic-buck2-ramp-enable", NULL)) 033054e8603036 Chanwoo Choi 2013-10-10 665 pdata->buck2_ramp_enable = true; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 666 033054e8603036 Chanwoo Choi 2013-10-10 667 if (of_get_property(pmic_np, "s5m8767,pmic-buck3-ramp-enable", NULL)) 033054e8603036 Chanwoo Choi 2013-10-10 668 pdata->buck3_ramp_enable = true; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 669 033054e8603036 Chanwoo Choi 2013-10-10 670 if (of_get_property(pmic_np, "s5m8767,pmic-buck4-ramp-enable", NULL)) 033054e8603036 Chanwoo Choi 2013-10-10 671 pdata->buck4_ramp_enable = true; 033054e8603036 Chanwoo Choi 2013-10-10 672 033054e8603036 Chanwoo Choi 2013-10-10 673 if (pdata->buck2_ramp_enable || pdata->buck3_ramp_enable 033054e8603036 Chanwoo Choi 2013-10-10 674 || pdata->buck4_ramp_enable) { 033054e8603036 Chanwoo Choi 2013-10-10 675 if (of_property_read_u32(pmic_np, "s5m8767,pmic-buck-ramp-delay", 033054e8603036 Chanwoo Choi 2013-10-10 676 &pdata->buck_ramp_delay)) 033054e8603036 Chanwoo Choi 2013-10-10 677 pdata->buck_ramp_delay = 0; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 678 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 679 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 680 return 0; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 681 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 682 #else cbb0ed495ca165 Axel Lin 2013-02-13 683 static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev, 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 684 struct sec_platform_data *pdata) 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 685 { 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 686 return 0; 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 687 } 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 688 #endif /* CONFIG_OF */ 26aec009f6b61c Amit Daniel Kachhap 2013-02-03 689
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.3-rc2 next-20230310] [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-Drop-unused-inclusions-from-of_gpio-h/20230313-224656 base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next patch link: https://lore.kernel.org/r/20230313144557.35856-1-andriy.shevchenko%40linux.intel.com patch subject: [rft, PATCH v1 1/1] gpio: Drop unused inclusions from of_gpio.h config: arm-randconfig-r046-20230312 (https://download.01.org/0day-ci/archive/20230314/202303140220.FQmu9huZ-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7) 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 # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/intel-lab-lkp/linux/commit/b108d11788b6db9e37a6c4b3110c09cecf30a46c git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Andy-Shevchenko/gpio-Drop-unused-inclusions-from-of_gpio-h/20230313-224656 git checkout b108d11788b6db9e37a6c4b3110c09cecf30a46c # 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=arm olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/video/backlight/ 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/202303140220.FQmu9huZ-lkp@intel.com/ All errors (new ones prefixed by >>): >> drivers/video/backlight/hx8357.c:324:2: error: call to undeclared function 'gpio_set_value'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] gpio_set_value(lcd->reset, 1); ^ drivers/video/backlight/hx8357.c:324:2: note: did you mean 'gpiod_set_value'? include/linux/gpio/consumer.h:122:6: note: 'gpiod_set_value' declared here void gpiod_set_value(struct gpio_desc *desc, int value); ^ >> drivers/video/backlight/hx8357.c:344:3: error: call to undeclared function 'gpio_set_value_cansleep'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] gpio_set_value_cansleep(lcd->im_pins[0], 1); ^ drivers/video/backlight/hx8357.c:344:3: note: did you mean 'gpiod_set_value_cansleep'? include/linux/gpio/consumer.h:144:6: note: 'gpiod_set_value_cansleep' declared here void gpiod_set_value_cansleep(struct gpio_desc *desc, int value); ^ >> drivers/video/backlight/hx8357.c:605:7: error: call to undeclared function 'gpio_is_valid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] if (!gpio_is_valid(lcd->reset)) { ^ drivers/video/backlight/hx8357.c:605:7: note: did you mean 'uuid_is_valid'? include/linux/uuid.h:102:19: note: 'uuid_is_valid' declared here bool __must_check uuid_is_valid(const char *uuid); ^ >> drivers/video/backlight/hx8357.c:610:8: error: call to undeclared function 'devm_gpio_request_one'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] ret = devm_gpio_request_one(&spi->dev, lcd->reset, ^ >> drivers/video/backlight/hx8357.c:611:9: error: use of undeclared identifier 'GPIOF_OUT_INIT_HIGH'; did you mean 'GPIOD_OUT_HIGH'? GPIOF_OUT_INIT_HIGH, ^~~~~~~~~~~~~~~~~~~ GPIOD_OUT_HIGH include/linux/gpio/consumer.h:51:2: note: 'GPIOD_OUT_HIGH' declared here GPIOD_OUT_HIGH = GPIOD_FLAGS_BIT_DIR_SET | GPIOD_FLAGS_BIT_DIR_OUT | ^ >> drivers/video/backlight/hx8357.c:636:11: error: use of undeclared identifier 'GPIOF_OUT_INIT_LOW'; did you mean 'GPIOD_OUT_LOW'? GPIOF_OUT_INIT_LOW, ^~~~~~~~~~~~~~~~~~ GPIOD_OUT_LOW include/linux/gpio/consumer.h:50:2: note: 'GPIOD_OUT_LOW' declared here GPIOD_OUT_LOW = GPIOD_FLAGS_BIT_DIR_SET | GPIOD_FLAGS_BIT_DIR_OUT, ^ 6 errors generated. vim +/gpio_set_value +324 drivers/video/backlight/hx8357.c 8a6c1dd55168b5 Maxime Ripard 2013-02-21 318 fb52566873ca8c Alexandre Belloni 2013-08-01 319 static void hx8357_lcd_reset(struct lcd_device *lcdev) fb52566873ca8c Alexandre Belloni 2013-08-01 320 { fb52566873ca8c Alexandre Belloni 2013-08-01 321 struct hx8357_data *lcd = lcd_get_data(lcdev); fb52566873ca8c Alexandre Belloni 2013-08-01 322 fb52566873ca8c Alexandre Belloni 2013-08-01 323 /* Reset the screen */ fb52566873ca8c Alexandre Belloni 2013-08-01 @324 gpio_set_value(lcd->reset, 1); fb52566873ca8c Alexandre Belloni 2013-08-01 325 usleep_range(10000, 12000); fb52566873ca8c Alexandre Belloni 2013-08-01 326 gpio_set_value(lcd->reset, 0); fb52566873ca8c Alexandre Belloni 2013-08-01 327 usleep_range(10000, 12000); fb52566873ca8c Alexandre Belloni 2013-08-01 328 gpio_set_value(lcd->reset, 1); fb52566873ca8c Alexandre Belloni 2013-08-01 329 fb52566873ca8c Alexandre Belloni 2013-08-01 330 /* The controller needs 120ms to recover from reset */ fb52566873ca8c Alexandre Belloni 2013-08-01 331 msleep(120); fb52566873ca8c Alexandre Belloni 2013-08-01 332 } fb52566873ca8c Alexandre Belloni 2013-08-01 333 8a6c1dd55168b5 Maxime Ripard 2013-02-21 334 static int hx8357_lcd_init(struct lcd_device *lcdev) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 335 { 8a6c1dd55168b5 Maxime Ripard 2013-02-21 336 struct hx8357_data *lcd = lcd_get_data(lcdev); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 337 int ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 338 8a6c1dd55168b5 Maxime Ripard 2013-02-21 339 /* 8a6c1dd55168b5 Maxime Ripard 2013-02-21 340 * Set the interface selection pins to SPI mode, with three 8a6c1dd55168b5 Maxime Ripard 2013-02-21 341 * wires 8a6c1dd55168b5 Maxime Ripard 2013-02-21 342 */ ccf9901ffec4b4 Maxime Ripard 2013-08-01 343 if (lcd->use_im_pins) { 8a6c1dd55168b5 Maxime Ripard 2013-02-21 @344 gpio_set_value_cansleep(lcd->im_pins[0], 1); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 345 gpio_set_value_cansleep(lcd->im_pins[1], 0); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 346 gpio_set_value_cansleep(lcd->im_pins[2], 1); ccf9901ffec4b4 Maxime Ripard 2013-08-01 347 } 8a6c1dd55168b5 Maxime Ripard 2013-02-21 348 8a6c1dd55168b5 Maxime Ripard 2013-02-21 349 ret = hx8357_spi_write_array(lcdev, hx8357_seq_power, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 350 ARRAY_SIZE(hx8357_seq_power)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 351 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 352 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 353 8a6c1dd55168b5 Maxime Ripard 2013-02-21 354 ret = hx8357_spi_write_array(lcdev, hx8357_seq_vcom, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 355 ARRAY_SIZE(hx8357_seq_vcom)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 356 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 357 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 358 8a6c1dd55168b5 Maxime Ripard 2013-02-21 359 ret = hx8357_spi_write_array(lcdev, hx8357_seq_power_normal, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 360 ARRAY_SIZE(hx8357_seq_power_normal)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 361 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 362 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 363 8a6c1dd55168b5 Maxime Ripard 2013-02-21 364 ret = hx8357_spi_write_array(lcdev, hx8357_seq_panel_driving, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 365 ARRAY_SIZE(hx8357_seq_panel_driving)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 366 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 367 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 368 8a6c1dd55168b5 Maxime Ripard 2013-02-21 369 ret = hx8357_spi_write_array(lcdev, hx8357_seq_display_frame, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 370 ARRAY_SIZE(hx8357_seq_display_frame)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 371 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 372 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 373 8a6c1dd55168b5 Maxime Ripard 2013-02-21 374 ret = hx8357_spi_write_array(lcdev, hx8357_seq_panel_related, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 375 ARRAY_SIZE(hx8357_seq_panel_related)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 376 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 377 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 378 8a6c1dd55168b5 Maxime Ripard 2013-02-21 379 ret = hx8357_spi_write_array(lcdev, hx8357_seq_undefined1, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 380 ARRAY_SIZE(hx8357_seq_undefined1)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 381 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 382 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 383 8a6c1dd55168b5 Maxime Ripard 2013-02-21 384 ret = hx8357_spi_write_array(lcdev, hx8357_seq_undefined2, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 385 ARRAY_SIZE(hx8357_seq_undefined2)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 386 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 387 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 388 8a6c1dd55168b5 Maxime Ripard 2013-02-21 389 ret = hx8357_spi_write_array(lcdev, hx8357_seq_gamma, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 390 ARRAY_SIZE(hx8357_seq_gamma)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 391 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 392 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 393 8a6c1dd55168b5 Maxime Ripard 2013-02-21 394 ret = hx8357_spi_write_array(lcdev, hx8357_seq_address_mode, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 395 ARRAY_SIZE(hx8357_seq_address_mode)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 396 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 397 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 398 8a6c1dd55168b5 Maxime Ripard 2013-02-21 399 ret = hx8357_spi_write_array(lcdev, hx8357_seq_pixel_format, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 400 ARRAY_SIZE(hx8357_seq_pixel_format)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 401 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 402 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 403 8a6c1dd55168b5 Maxime Ripard 2013-02-21 404 ret = hx8357_spi_write_array(lcdev, hx8357_seq_column_address, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 405 ARRAY_SIZE(hx8357_seq_column_address)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 406 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 407 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 408 8a6c1dd55168b5 Maxime Ripard 2013-02-21 409 ret = hx8357_spi_write_array(lcdev, hx8357_seq_page_address, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 410 ARRAY_SIZE(hx8357_seq_page_address)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 411 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 412 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 413 8a6c1dd55168b5 Maxime Ripard 2013-02-21 414 ret = hx8357_spi_write_array(lcdev, hx8357_seq_rgb, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 415 ARRAY_SIZE(hx8357_seq_rgb)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 416 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 417 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 418 8a6c1dd55168b5 Maxime Ripard 2013-02-21 419 ret = hx8357_spi_write_array(lcdev, hx8357_seq_display_mode, 8a6c1dd55168b5 Maxime Ripard 2013-02-21 420 ARRAY_SIZE(hx8357_seq_display_mode)); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 421 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 422 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 423 8a6c1dd55168b5 Maxime Ripard 2013-02-21 424 ret = hx8357_spi_write_byte(lcdev, HX8357_EXIT_SLEEP_MODE); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 425 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 426 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 427 fb52566873ca8c Alexandre Belloni 2013-08-01 428 /* fb52566873ca8c Alexandre Belloni 2013-08-01 429 * The controller needs 120ms to fully recover from exiting sleep mode fb52566873ca8c Alexandre Belloni 2013-08-01 430 */ 8a6c1dd55168b5 Maxime Ripard 2013-02-21 431 msleep(120); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 432 8a6c1dd55168b5 Maxime Ripard 2013-02-21 433 ret = hx8357_spi_write_byte(lcdev, HX8357_SET_DISPLAY_ON); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 434 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 435 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 436 8a6c1dd55168b5 Maxime Ripard 2013-02-21 437 usleep_range(5000, 7000); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 438 8a6c1dd55168b5 Maxime Ripard 2013-02-21 439 ret = hx8357_spi_write_byte(lcdev, HX8357_WRITE_MEMORY_START); 8a6c1dd55168b5 Maxime Ripard 2013-02-21 440 if (ret < 0) 8a6c1dd55168b5 Maxime Ripard 2013-02-21 441 return ret; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 442 8a6c1dd55168b5 Maxime Ripard 2013-02-21 443 return 0; 8a6c1dd55168b5 Maxime Ripard 2013-02-21 444 } 8a6c1dd55168b5 Maxime Ripard 2013-02-21 445
On Mon, Mar 13, 2023 at 3:45 PM Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote: > As a preliminary step, drop unused inclusions from of_gpio.h, > so people will use the header only when it's really needed and > not as a substitute of any of the dropped ones. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > > For testing purposes on what will fail in CIs. People are also > encourage to test this, if have time / chance / wish. Haha the CI gives 6 million errors as usual :D Wella, just nail them all down, that's how we got rid of <linux/gpio/driver.h> from <linux/gpio.h> ... The end result will look really good. Thanks for looking into this! Yours, Linus Walleij
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index d0f66a5e1b2a..bf6774632b5e 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h @@ -10,11 +10,6 @@ #ifndef __LINUX_OF_GPIO_H #define __LINUX_OF_GPIO_H -#include <linux/compiler.h> -#include <linux/gpio/driver.h> -#include <linux/gpio.h> /* FIXME: Shouldn't be here */ -#include <linux/of.h> - struct device_node; #ifdef CONFIG_OF_GPIO