From patchwork Mon Sep 5 06:30:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12965545 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D555CECAAD5 for ; Mon, 5 Sep 2022 06:34:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UgjyaAsxXJ6XFu/gu5vtH12B9dKrRv+DDAa93itBQMU=; b=YyJCnfCaGrcUKE TZ3625j29h8xlvayX7jfpzWIiFbH0A/xkQ9mGcNk6/dRkC7AL50TACzEZid7IXC54QBj1hl2Kjdvo FUpTMhv7cU/Dgi1BqKMMJEjs4mkGDEYHq9pkOC6D94IHJWBIV6gy89yiFDIL0HqS4tjwGjpUUPJ9h ip4e+BUziANy8rFN9QGorXkzDr+phLCGywWfTSRntkqb2t/TD0R9bZNUtANcbp1/xho5nD9+C+x93 wWR0woWpEpyVE1iIjy0I6nAOQ4avL8ur+fPgnueOv/mjt89ZQ5jTCbs0PKKXgkVy51+OAD6DRp+7U WJ4Ugzg4twT28+pAad7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5fA-00CI7p-NW; Mon, 05 Sep 2022 06:32:53 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5dZ-00CFro-C4; Mon, 05 Sep 2022 06:31:24 +0000 Received: by mail-pg1-x52c.google.com with SMTP id bh13so7306229pgb.4; Sun, 04 Sep 2022 23:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=OVfZryZDsn7EOmcZgQCBsExc88uptR2TDaptHz7Mkz0=; b=NCVkm6jO5T8JvtIiswGFJRWQ6X8V/lEcdFXeBX/jS7NR6HfIMOFQqwtvbzVJH4QbnW 5eAaKJ2Btz6EDiplEg7pNTEHzAVyU5kQFh+Had3EVkArXQkeEhZc+8Xu5s/fSXNTBYRd QxwDXvJLKzwpv0KLpWVLomVHNaTztUDtOmDZOUePP3FQAXx80QMYryGWp8Qtgtkq+rCS zMl46htgUuknSjojcasQ8VFXQgdYGTuGM8zLouDO2HoFeHfp3xTuqNCMdAVcyrwb89NO Puk4rmbUyqRCdbE9PptjU3xweuFiTOXTPnuBWJEMAtMUaphJsUh67rNB6zwD4fYTTNtY YpiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=OVfZryZDsn7EOmcZgQCBsExc88uptR2TDaptHz7Mkz0=; b=g5880/95r3hjNLespcQDpGIBUSrbqhtDq4wJASUBEWQzkhrks0sUGpn4p+SxH2cJ9u dx+6uCoN4pulhWnxB2aoDkasdFBlS9D4rCD9eC7wyMsuoLaL3hi4aDU3ahKVHsHoGB0L mZKqCEONtNM13KCkAn0yo7GXnbOeyby7K1iR2WGzXZ3igxryHzxPBIA9jjz5ASU29Pn3 Rzia3R4NWL4JTj2yBCP27vHYZ4PESUaRhs/Oa8JQDd1C/IlRpQwxXUzBtwBgy8tDXtoj BWWSZ6uCBdsHGqqgi5l6cMRbJhXOpl5Pfv5kKI3KASfowv65rMcwyx0aSjACOjrSNXiS 9Qww== X-Gm-Message-State: ACgBeo25Wq7lJdgH8hqPiblGX5uQ/IHZDP5+cav1W9ZKCDAdBctTdfAL 2Sn2G8/LTn0rdAkbeWnPA1o= X-Google-Smtp-Source: AA6agR6Idf7B+Ir3+C7s0CQ8UlH5pwxbWKYpAaeA415uduldic97z5mhuS5KFGWggWKjnL3sMq7imA== X-Received: by 2002:a63:dd51:0:b0:430:18d9:edf8 with SMTP id g17-20020a63dd51000000b0043018d9edf8mr21685454pgj.163.1662359471251; Sun, 04 Sep 2022 23:31:11 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042254fce5e7sm5710653pga.50.2022.09.04.23.31.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 23:31:10 -0700 (PDT) From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?utf-8?q?Pali_Roh=C3=A1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 01/11] PCI: tegra: switch to using devm_fwnode_gpiod_get Date: Sun, 4 Sep 2022 23:30:53 -0700 Message-Id: <20220903-gpiod_get_from_of_node-remove-v1-1-b29adfb27a6c@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220904_233113_467645_9610D128 X-CRM114-Status: GOOD ( 11.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I would like to limit (or maybe even remove) use of [devm_]gpiod_get_from_of_node in drivers so that gpiolib can be cleaned a bit, so let's switch to the generic device property API. It may even help with handling secondary fwnodes when gpiolib is taught to handle gpios described by swnodes. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c index 8e323e93be91..929f9363e94b 100644 --- a/drivers/pci/controller/pci-tegra.c +++ b/drivers/pci/controller/pci-tegra.c @@ -2202,10 +2202,11 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie) * and in this case fall back to using AFI per port register * to toggle PERST# SFIO line. */ - rp->reset_gpio = devm_gpiod_get_from_of_node(dev, port, - "reset-gpios", 0, - GPIOD_OUT_LOW, - label); + rp->reset_gpio = devm_fwnode_gpiod_get(dev, + of_fwnode_handle(port), + "reset", + GPIOD_OUT_LOW, + label); if (IS_ERR(rp->reset_gpio)) { if (PTR_ERR(rp->reset_gpio) == -ENOENT) { rp->reset_gpio = NULL; From patchwork Mon Sep 5 06:30:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12965546 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D9B16ECAAA1 for ; Mon, 5 Sep 2022 06:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=N4bmLiHXuK6fPnyyChKTGqPKWZTAAUqvIAtPYdahqWY=; b=0RxMI/34jeWznh xzwib6SWnRuNuVyUiSG3dhHs4A9r7AYTqA0cLNp11iIlkJO/lU4TdOp21gc2QfOzLBAu2ZxAh/ZLu tvZ0l9MIFOAgp1v6VBY5nZE28ZfgP7+GQlfqdG6zUDy16dqyI8wYWSKPv2KWeIHi7NiLKOYiNO6y2 J/95+TZ+sfU3HNWTF1UNvPKQMtHnbqYtAMmZuIU5BHCy2qOJjXNF8a5qIT+3n+FTX78t/mNi7w5IB dtwJFatN95CdJSTmsEvHwSD5ltTs8lQDl20lqc/kGnKet/zXZsPIzA3rEsRrAvB9q4yfBluMPHF4j MJPfknZWPGgUX/lorIjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5fi-00CIYv-KO; Mon, 05 Sep 2022 06:33:27 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5db-00CFuS-7q; Mon, 05 Sep 2022 06:31:24 +0000 Received: by mail-pf1-x432.google.com with SMTP id b144so2941690pfb.7; Sun, 04 Sep 2022 23:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=U194c+dv3L8PGxjQRUqmKsyVJlhonDrX8vTPY/i9hXs=; b=Fkbc/qOj6ZS7IqaqFcyPDPM8EDvYCU7OGChWB/9DpWkiWqS2dcKh9l1ojNoGhPTnaD njtjyQXo+Rn/WKjPbWSgQwcSRXqdDOgJDGXNJQq5SFjXCfctlSjW18o5uDca1l2zvr9s qI1PzrfdfgBUibYLHx0f78UFpIn7lM4srMFlpQG6GGUAs+9ir4zw3UO2CcA6EiK7Fjf1 bf4cjTs1g6ppz8vMIVX34VakImJ62Z/3L44MxW6WWlAwFP7SjkuSosBV+uw4t/dQJPMK jdTwvre314VlwpC1eofIVn09IiP/lYmwjM75pESkwXfDC4BXtIhlz1s+2S/HOBFZhOcr KREw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=U194c+dv3L8PGxjQRUqmKsyVJlhonDrX8vTPY/i9hXs=; b=zOSaYzVazDxoilpbY+C541azkDxbaJ48WZ5Hm8WqicuOWQL/ZJXTlDLpln48nSDgM6 W9+UUSELcva5K7i6WYj4noA+Bmye3cYjc8aMCOP8iWa0rqwGwzd8dd2dgidSs912Idks XRa/j8Liircfipwh3MuwsXhF985VkIszRzjZ2oaEWRx2Na175w5TUdTPu+rm5kuq4YS3 NL9dauzmRMB1K/fILEhbQqI/F0CUOxNo6qq8lYMHo9d2t8ZG6gNCfH7LTM04wVN3ZGyU 32z+xRPaty7AgBFKC1rLLnLuvWLabYu5A3hED/mg3F5TvltEQPjlQ6dZixuBCAnDTm+f vYEw== X-Gm-Message-State: ACgBeo04LpLcOgBnBxbRNQFhKEmUHNSBWFcnHZG+yV0HXZr1GaKNMt7/ ZT35e6Hktq9iETapJ4Duz3U= X-Google-Smtp-Source: AA6agR5AcoEUClPAM45JZ1w1Bqqw5txpdGe6Mc9rimWxG6gO38z3tQNrUedFo00QOImtqhFwVKAqJg== X-Received: by 2002:a63:914c:0:b0:42b:a8fa:eb4a with SMTP id l73-20020a63914c000000b0042ba8faeb4amr34343614pge.481.1662359473959; Sun, 04 Sep 2022 23:31:13 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042254fce5e7sm5710653pga.50.2022.09.04.23.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 23:31:13 -0700 (PDT) From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?utf-8?q?Pali_Roh=C3=A1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 02/11] drm/tegra: switch to using devm_fwnode_gpiod_get Date: Sun, 4 Sep 2022 23:30:54 -0700 Message-Id: <20220903-gpiod_get_from_of_node-remove-v1-2-b29adfb27a6c@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220904_233115_414972_67D26F03 X-CRM114-Status: GOOD ( 10.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I would like to limit (or maybe even remove) use of [devm_]gpiod_get_from_of_node in drivers so that gpiolib can be cleaned a bit, so let's switch to the generic device property API. It may even help with handling secondary fwnodes when gpiolib is taught to handle gpios described by swnodes. Signed-off-by: Dmitry Torokhov diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c index 47d26b5d9945..a8925dcd7edd 100644 --- a/drivers/gpu/drm/tegra/output.c +++ b/drivers/gpu/drm/tegra/output.c @@ -133,11 +133,11 @@ int tegra_output_probe(struct tegra_output *output) } } - output->hpd_gpio = devm_gpiod_get_from_of_node(output->dev, - output->of_node, - "nvidia,hpd-gpio", 0, - GPIOD_IN, - "HDMI hotplug detect"); + output->hpd_gpio = devm_fwnode_gpiod_get(output->dev, + of_fwnode_handle(output->of_node), + "nvidia,hpd", + GPIOD_IN, + "HDMI hotplug detect"); if (IS_ERR(output->hpd_gpio)) { if (PTR_ERR(output->hpd_gpio) != -ENOENT) return PTR_ERR(output->hpd_gpio); From patchwork Mon Sep 5 06:30:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12965549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3012FECAAA1 for ; Mon, 5 Sep 2022 06:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cFyfxJd/2VvTro+GkEys344haTelB3ukfrWTiVOCHic=; b=b1MKyR3modm278 3DczH//wnoy5EMIPyd+zQkc9ims3TbJ+PRF+ZEsrnDY723l3NmWL9Aexs5OTGQP/4i7/solun2+3f Tuk/BcPI4HpR5PF2ycH3sjUpoLZP97jNRAxJnHyJz02MwnU0GGgKqdkcNWcJaTYHMWKraCSjWx+Ss WKSt5Nu66FAI2UsFZlm/5yc6+PmlhtCYYHOgvoPuP6NKv3pU7IGKK1stMfD1/VJ5xnRTR/4Ev8Jd+ aoMYz7qkLSAU8VbYuuLb4/OLMYAtfSSGqvYncDjZUGXKeFrXZUer6jN4zQCib+eStetMaY/9Iuiak 1AByX28veTHvX/J3JP5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5iM-00CLDZ-A2; Mon, 05 Sep 2022 06:36:13 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5dd-00CFxS-S4; Mon, 05 Sep 2022 06:31:28 +0000 Received: by mail-pf1-x429.google.com with SMTP id b144so2941795pfb.7; Sun, 04 Sep 2022 23:31:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=JcNarHX5vDGjVT4u3bJlQD1+cgrqWKhTPjcJ8WgPV+Y=; b=DxvplDrIsh+KijXXFdPyzxvt874fwO8Mrl8/8AeOKCJE+XbHxvUZFRKCE2GWxXKh/D umFYRihOe+jne0ztML2y6mc0jbRPpGBhC1g0NvUfpp6EeLk7jk01cUaRoaJOQGKx5afd lMrQqjCzBLO0lmmWRuQTMiLdS80KFr2EMlRBbDQ43Cvwei0LgWRjAJ8gs1Hh7H+I8nL+ T7StbBazi7jgrWFhxeXo3Gac0AKQAJdX41kNsF1jErc6zj3GvAoSXS8rPqIvQoiy9CfD STWwhnuDN61n/ngUeJ4+XMum2eLhXHNuROQUxZWikj/bqGNqJIg0uK7dakXt3T7vhKRj +Zvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=JcNarHX5vDGjVT4u3bJlQD1+cgrqWKhTPjcJ8WgPV+Y=; b=46NJ66d3sYm6jivjTQPQUidK/wVRqcrGWjoRf6IYZ1lfVYJ1EXujpgTUB4KSqdZorI RwBipDx7bBgBGnyJSSWrNenl12OPpgyyzQZc1A/s9ui1TBsgt/h2XYZtR8kuAS7Z38T4 JH8iIlZQcbltvnlBBFnwW7CPqwC7xGc/BeJ4EOBWsgKZ8NwDPNk6CjqxGpaFDM7iA2bR NvhehAMbllOpx9xlw7qB9Dq2KK9DVsoSOPWH3NbsvvoKjm0TCJOR1AfX85m/RLafUoBQ ZqZXXZfNIbzlvhN2mC/zhrG0hOlD3OzBkNrbZnrf5saYtFdXp23mpV4j17Xp8HIPtvHF zMOw== X-Gm-Message-State: ACgBeo0aVEpxw0a6U0b9eMEuEOMKo4RWZnqVpuUBdi67nPK76ybQ3ZbB WDPMvcxbWdxbslNSl7zb8YQ= X-Google-Smtp-Source: AA6agR7ElJwXFJbXTWS13gywL0+xg7ynmUWpG94uiTchE1mDeAqtJvkeWg4KKm6lqy6WE6s/yuBdHA== X-Received: by 2002:a63:fc11:0:b0:430:41b4:acf5 with SMTP id j17-20020a63fc11000000b0043041b4acf5mr19872386pgi.408.1662359476546; Sun, 04 Sep 2022 23:31:16 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042254fce5e7sm5710653pga.50.2022.09.04.23.31.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 23:31:16 -0700 (PDT) From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?utf-8?q?Pali_Roh=C3=A1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 03/11] mtd: rawnand: stm32_fmc2: switch to using devm_fwnode_gpiod_get() Date: Sun, 4 Sep 2022 23:30:55 -0700 Message-Id: <20220903-gpiod_get_from_of_node-remove-v1-3-b29adfb27a6c@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220904_233118_089796_F44DBAF2 X-CRM114-Status: GOOD ( 10.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. Signed-off-by: Dmitry Torokhov diff --git a/drivers/mtd/nand/raw/stm32_fmc2_nand.c b/drivers/mtd/nand/raw/stm32_fmc2_nand.c index 87c1c7dd97eb..7e466b840368 100644 --- a/drivers/mtd/nand/raw/stm32_fmc2_nand.c +++ b/drivers/mtd/nand/raw/stm32_fmc2_nand.c @@ -1799,9 +1799,8 @@ static int stm32_fmc2_nfc_parse_child(struct stm32_fmc2_nfc *nfc, nand->cs_used[i] = cs; } - nand->wp_gpio = devm_gpiod_get_from_of_node(nfc->dev, dn, - "wp-gpios", 0, - GPIOD_OUT_HIGH, "wp"); + nand->wp_gpio = devm_fwnode_gpiod_get(nfc->dev, of_fwnode_handle(dn), + "wp", GPIOD_OUT_HIGH, "wp"); if (IS_ERR(nand->wp_gpio)) { ret = PTR_ERR(nand->wp_gpio); if (ret != -ENOENT) From patchwork Mon Sep 5 06:30:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12965550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 50605ECAAD5 for ; Mon, 5 Sep 2022 06:39:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=b0vE1K5DJIGw+jNdMXEhZI8TLpmqda8kZYc8vpNO7Zc=; b=KjKrekHJuaMEAN otqn990WGqFjGU+Yh8nId07bxUaMZmlIEwLNHhnZeWnGaMWo/Omg/LMkgwYhHeMruX0IFB1j6Sm0z xDOOp8fSp5fqyfsREq68vnb01rFzBzSiPtInYDAfjkZZPQQsdFLlJKPlxlUsf9XmHxE+tkSk/XeB1 FCb42ynVJG3DCOouYd7cjEdnnMAt8gSEWXzYu/uK/dYr+0vAB9vJBcWaCkMbSwQ+jrL4LakWmMxkT plXujegGZSZKICge//tJpGf3RFa7OAzzhMuAzjc/rs3gB0hch9M1FhXQEMqWU8y5NOEhRpnGCOp8R wSam9BfyS8ipiW3QrDIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5jS-00CMqW-MA; Mon, 05 Sep 2022 06:37:20 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5dg-00CG0c-IK; Mon, 05 Sep 2022 06:31:29 +0000 Received: by mail-pf1-x42c.google.com with SMTP id y127so7745128pfy.5; Sun, 04 Sep 2022 23:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=nEbjUfr7fwqueSmjAsD0W8GSCJGEGPrp4ULUwjjyEJA=; b=BwhSxhJHuNZubY5udVF0benef1V78QThc+I+5pdGaAhS9f7czmXQ0+lX6fLemCXOdl 3fHYh5mFxmh6vXpEgGgoJfSt54Hg8m+uS1Wxx8zGEMMd3IMEilC7XzLCelQyUpIGADDa eHrlp4RIUpSke6IDMjI2wRpqP3Xcu9nVikuwws6JGbz1bpaNy+xlA1aWhyGXSVM8Bgez rR7uraO+M+9xWjLBH/xW3NfDDpH5H4xC8AhL1rqmFoqQ1YQUTwU9vSojevfdF4bc76Qh TW0gqThzNTQaw7vPqkwkLSNXzYRvK/UJpAMinaSHE472WQuIkYWNlxKNX/l2rblcn6fr t2lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=nEbjUfr7fwqueSmjAsD0W8GSCJGEGPrp4ULUwjjyEJA=; b=M+4xx+jh/wDfMPTBQVoZtWDKT228i+Q57vg54Vx5TiSdVP0okrtA3BtAMtOg2AYt/U jLSEInP9VAND6pz+s/QbR+JI8HgfZoilhXUIlDr4sA5zhtPSfCTtYsdenOvVubQHqN0B /nHVLW3AMyEl4CZS5dr4HI3UPZ8Yw9G/56d/jCkpsWhrCm3gThPqNYVbVRG6jX66+4RL 94CUnh2IpzQpvtrZe3WEMJ0qJ9aqCStgbh330mLPDseWrPqG3VrmBYLGlITUTnfAzT2B wr5BOzn0RguQJ8nX+MlPIHjZhkDga9MT7QrTMNRmY4rYQXnQzmSCw16Bn1sn5MYba0Lx WIpw== X-Gm-Message-State: ACgBeo1jU4/znb+a+s6qVCg+efz2m5ZuC5azEzybP9Li5NzEOZyCYTO+ q1HrWBmQt/vnlnsTy5RanlV33t3Dgm8= X-Google-Smtp-Source: AA6agR7O3xsaJm3PXWVEz8pTAeV7SFmhqqPNXXBFz2iOIaqf7IbZO/oITkU5Ekfa+HSas+vh7tCo8A== X-Received: by 2002:a05:6a00:2293:b0:53b:93ec:1dc1 with SMTP id f19-20020a056a00229300b0053b93ec1dc1mr8858576pfe.62.1662359479124; Sun, 04 Sep 2022 23:31:19 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042254fce5e7sm5710653pga.50.2022.09.04.23.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 23:31:18 -0700 (PDT) From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?utf-8?q?Pali_Roh=C3=A1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 04/11] usb: phy: tegra: switch to using devm_gpiod_get() Date: Sun, 4 Sep 2022 23:30:56 -0700 Message-Id: <20220903-gpiod_get_from_of_node-remove-v1-4-b29adfb27a6c@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220904_233120_686082_60E42C0D X-CRM114-Status: GOOD ( 13.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic device property API. I believe that the only reason the driver, instead of the standard devm_gpiod_get(), used devm_gpiod_get_from_of_node() is because it wanted to set up a pretty consumer name for the GPIO, and we now have a special API for that. Signed-off-by: Dmitry Torokhov diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c index 68cd4b68e3a2..f0240107edb1 100644 --- a/drivers/usb/phy/phy-tegra-usb.c +++ b/drivers/usb/phy/phy-tegra-usb.c @@ -1440,16 +1440,22 @@ static int tegra_usb_phy_probe(struct platform_device *pdev) return err; } - gpiod = devm_gpiod_get_from_of_node(&pdev->dev, np, - "nvidia,phy-reset-gpio", - 0, GPIOD_OUT_HIGH, - "ulpi_phy_reset_b"); + gpiod = devm_gpiod_get(&pdev->dev, "nvidia,phy-reset", + GPIOD_OUT_HIGH); err = PTR_ERR_OR_ZERO(gpiod); if (err) { dev_err(&pdev->dev, "Request failed for reset GPIO: %d\n", err); return err; } + + err = gpiod_set_consumer_name(gpiod, "ulpi_phy_reset_b"); + if (err) { + dev_err(&pdev->dev, + "Failed to set up reset GPIO name: %d\n", err); + return err; + } + tegra_phy->reset_gpio = gpiod; phy = devm_otg_ulpi_create(&pdev->dev, From patchwork Mon Sep 5 06:30:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12965551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6296AECAAA1 for ; Mon, 5 Sep 2022 06:39:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=q7WJwA7y2VIyglm+whIBUPuQkndDFRXd7X7PEwFSKdY=; b=LtxcWtl5CXJABX ZTyjJDPmAj9gRcPLAgIFOuSyeMoMEDsMcmYlpg7MWT3Xp/668pPyxS170lCa1uR9Gn4FrU1uBSYuY qFXbNPlnrVdl15Gplec7r0mCT3Y+0K3No5yg+FIyLQwUtnl2MvZhOzMFnS5ZKYtd+Tjlo3QfC4noR /8ORv4DfjXsCbPS1I8o0UVw+BhLw6VMnx0vrUTpW78U3ZgRhcnIZJajkiiK7qPdU7sKnDqCMFNDa/ hAWqPctMOyqd9llaAmZKB0oMJY7TUlIB0FTqObDOXBXBlskBfo8SXMQCzxGElJA3Bu8N5bQLqkMlO 3qcO+JKF0QUvFaStTPnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5kC-00CNh6-As; Mon, 05 Sep 2022 06:38:06 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5di-00CG2I-SD; Mon, 05 Sep 2022 06:31:30 +0000 Received: by mail-pf1-x435.google.com with SMTP id 197so2184813pfy.6; Sun, 04 Sep 2022 23:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=f1PZzsaMnOlN09CVwbSU1GebwD1POC8hMtOU/HbCocM=; b=pdli+4eCvdWbxLZpx0O/e5Ud3wuQ5WWZPs7wxvLZ8aWyeshw5o3oRO/WG8ev2Aaq1m BX/Fr0/H0104qGs68GxhCwuFDG+PdZ2DrBRO+OPQVwRTpp7rdrBwbaXxSj0nC7vBM+b5 GXjvKR+R9YSnP5K560kQKQaswuG1HWEF9p6rBSHyfMHnnKCObj/NMkW/0nwlLU7coaJN lMlGTVarp6ddLZqLDpTSWdUVPPyTlQJyHZXKdGvmnZujDf4OJXr1QpZ4olhMYA2SJhx8 m53y0aRnHgIB7peKEuEd6JQIyv+D3WxGZ668VhcUTC58GT5LurfYxI/+Of47FfV3GuNG TzYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=f1PZzsaMnOlN09CVwbSU1GebwD1POC8hMtOU/HbCocM=; b=rt5qhU23D2dWxThSItEpziHEIjx6oXMXeAevatmWt76zIVvRg9RWNlKiy5ktXw/lNE y88WoF+uzMSFmwCn5Wp7/9iItl7NzDqbw9YgHVud1KHoP6C7dpalWSm4IyZLLEV2cP/R T/l6aYz7Y2BTI4uwjVWs6WRHOA2C6o/dD6AUiP+SKsf8ZyiUVtC5AmQQ/T7bWjLSWEKX OwGWTCpGXfN+eazuCjMMM24iANfPkx+4wBDtTANC2NEL8Kni76gATUwy7kjsZPM22s6I kPfEMvstCYrp7exc3KeGQfuWJ0DJgX3u1R3k205jUtHUQc+TIGVdzXq1OZWv1EYzIZLt hcfQ== X-Gm-Message-State: ACgBeo0HZ8kuCazU8M0PTNGk6r480s81sJweITPaISB4ueaUOZ63nYj1 pDJgXRKnzA4l/GlGkaOWPA4= X-Google-Smtp-Source: AA6agR5cvvg/UZg1XV6YqtMeu4gBydqn31I2YyYPcH2GdlFOcXWs2FB6+oFFKzKdNcI+NqL1V/14Sg== X-Received: by 2002:aa7:978c:0:b0:537:d68e:3a27 with SMTP id o12-20020aa7978c000000b00537d68e3a27mr28251047pfp.71.1662359481595; Sun, 04 Sep 2022 23:31:21 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042254fce5e7sm5710653pga.50.2022.09.04.23.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 23:31:21 -0700 (PDT) From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?utf-8?q?Pali_Roh=C3=A1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 05/11] usb: gadget: udc: at91: switch to using fwnode_gpiod_get_index() Date: Sun, 4 Sep 2022 23:30:57 -0700 Message-Id: <20220903-gpiod_get_from_of_node-remove-v1-5-b29adfb27a6c@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220904_233123_094685_10656442 X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I would like to stop exporting OF-specific gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. Signed-off-by: Dmitry Torokhov diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c index 728987280373..1db1dbbab79a 100644 --- a/drivers/usb/gadget/udc/at91_udc.c +++ b/drivers/usb/gadget/udc/at91_udc.c @@ -1779,12 +1779,14 @@ static void at91udc_of_init(struct at91_udc *udc, struct device_node *np) if (of_property_read_u32(np, "atmel,vbus-polled", &val) == 0) board->vbus_polled = 1; - board->vbus_pin = gpiod_get_from_of_node(np, "atmel,vbus-gpio", 0, - GPIOD_IN, "udc_vbus"); + board->vbus_pin = fwnode_gpiod_get_index(of_fwnode_handle(np), + "atmel,vbus", 0, GPIOD_IN, + "udc_vbus"); if (IS_ERR(board->vbus_pin)) board->vbus_pin = NULL; - board->pullup_pin = gpiod_get_from_of_node(np, "atmel,pullup-gpio", 0, + board->pullup_pin = fwnode_gpiod_get_index(of_fwnode_handle(np), + "atmel,pullup", 0, GPIOD_ASIS, "udc_pullup"); if (IS_ERR(board->pullup_pin)) board->pullup_pin = NULL; From patchwork Mon Sep 5 06:30:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12965660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B6A1ECAAA1 for ; Mon, 5 Sep 2022 07:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ujg//xK9KgYLiXRVkgp7lJtowiwgU8fDYuIntlTAczc=; b=SM4XGdRsg62WIy eKOTyeH5OTnJzpspc2OefK75czA9xv6LcnMzP05XVmiMG9vQQYV+ldYhiNW+B6SAZpGoDX6XRfLLI RFmIq4gqD676j9adI/0p/hMdEy5ZAH10HKxKzJuLtMPLXXAcgb6SajSXQbrKtnRftQYH0hbA85jXb CmWxjqrRppiojxAB0kV+B0o+yhOojIEfKoyVK+iIRIkZvWVmcETh0VZBeUHyMKPGjqb9xy8MCgx4p puGjUzV7pag5w5vj0KwKgO49ILrnfWDk1eK9dJvtJIWGFt1N7vG8kK4niewGkdTo3VfmwL7ELFsyP 3a4ikVek/xkVlK6pXwZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV6H2-00D1uB-6i; Mon, 05 Sep 2022 07:12:01 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5v2-00Ca4V-3z; Mon, 05 Sep 2022 06:49:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=wtbsIN0G6G4Rk7NZw280WIou3MxCBWt+mxKFWMG1Byk=; b=nivducxx0x8v4IGD+jL8zb+EjU BIS31uwyAVRD2u1RpmzMaHyuTIS9NNBC5Clc9McMlYMfzJgzIg9+SwGHbrC12OINUxpjvbfhCjhpx GeYzWxwVwClJid1YgJ7U/djIGCwMB+tJhMLwKAqHEJu7qiD4RqBC4LtQZAn9XUbLeDxTpq1s7UtA0 4Rvd05x/Ri8JjNBNmYta+XaPu6sNJnc+8fxnMosDTbkGiPyMg6GptsN1fSYmXsKKnrCxEh9L/O0hl WPQ4s5eptZcE1nZeIyEXk/+WBkltJ5ha8KZT/PYteDg6Z1EOPj0JpoHMoyOsq9zapVKIjFPRCfdwe z7UiLCgg==; Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5do-009SE0-LZ; Mon, 05 Sep 2022 06:31:32 +0000 Received: by mail-pg1-x531.google.com with SMTP id v4so7273540pgi.10; Sun, 04 Sep 2022 23:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=wtbsIN0G6G4Rk7NZw280WIou3MxCBWt+mxKFWMG1Byk=; b=V8iL1hdeCP411j7WuyV0RKuzlQrPJroM9XqkRFVvCrpK5bPAPTQyE3nfxPRzAf22UM NdSbdYACGTqUH/jKS6oq3P2avtZxFrHjmK+37r3HM6hSTlwP5zMTrLgtHcunRzXS7wMw MLZe8oKnvo6VJsVi46R1kynkLOywScoAoQvo19TSTMHFDsHauT8z363qjjda0HgeiYKj huXRCccitr3elT9rdkidc7YsLzXzhKdBuKVC9nAAEu81j9W3fv8DO1eNUEeEVii/KGJq 9BBdMvEozmLc0fRzk0Ub2eeNBu38hun0rdIUAhS3h9SBA/pWcydN9r0W5OPOyH/yn5ft K/4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=wtbsIN0G6G4Rk7NZw280WIou3MxCBWt+mxKFWMG1Byk=; b=J+AGOPzaN3DCw0Wt7B2dHpZFEXg/BjjXOIplPLh0I1fPg0VDK9I4FhguVwdTlzZ+x1 Vmdugcpmu8mUWixUebZ18XkGZPUqFAnOUqh1UY026tcSo99g7maZAZnb3bvwJhckg0rW 6JDmotYL9j9JDXpBAyyPEgp9Ks3YyHZ8OFfZtA091CGv5VXSNH5BhHZ1Tir+3swA32+/ kHW9WMJnAA8s+Z0h/d85CtWaPhkc3HpcHRp9fCH3YDhK+ksmkKQ1F1lJmYQk7YTYD2sz 9WUq2YenND8n0QR3MOPROsrszXmcFN0jNfhJrrkF2n64meKfcrAOBvL/xF6AsQSP5PnV HDsA== X-Gm-Message-State: ACgBeo0YfPoMvbTDUdNXCpkO73ccv2xcH1FCebW82MYBs6Kc9tis+g4a fXu5ul1Rb+yAx6VlYTGENrY= X-Google-Smtp-Source: AA6agR4FBFN+x/sadubmd0SYUEKWfxGwwbu9hv38iBqADEsB7NAUvJK2vZMuiOES3OuHFLGr7mqtfA== X-Received: by 2002:a62:4c2:0:b0:52e:bd4d:50e1 with SMTP id 185-20020a6204c2000000b0052ebd4d50e1mr49629750pfe.8.1662359484138; Sun, 04 Sep 2022 23:31:24 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042254fce5e7sm5710653pga.50.2022.09.04.23.31.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 23:31:23 -0700 (PDT) From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?utf-8?q?Pali_Roh=C3=A1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 06/11] PCI: aardvark: switch to using devm_gpiod_get_optional() Date: Sun, 4 Sep 2022 23:30:58 -0700 Message-Id: <20220903-gpiod_get_from_of_node-remove-v1-6-b29adfb27a6c@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_073128_976092_23496891 X-CRM114-Status: GOOD ( 15.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic device property API. I believe that the only reason the driver, instead of the standard devm_gpiod_get_optional(), used devm_gpiod_get_from_of_node() is because it wanted to set up a pretty consumer name for the GPIO, and we now have a special API for that. Signed-off-by: Dmitry Torokhov Acked-by: Pali Rohár Reviewed-by: Linus Walleij diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c index 4834198cc86b..4a8a4a8522cb 100644 --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -1856,20 +1856,19 @@ static int advk_pcie_probe(struct platform_device *pdev) return ret; } - pcie->reset_gpio = devm_gpiod_get_from_of_node(dev, dev->of_node, - "reset-gpios", 0, - GPIOD_OUT_LOW, - "pcie1-reset"); + pcie->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); ret = PTR_ERR_OR_ZERO(pcie->reset_gpio); if (ret) { - if (ret == -ENOENT) { - pcie->reset_gpio = NULL; - } else { - if (ret != -EPROBE_DEFER) - dev_err(dev, "Failed to get reset-gpio: %i\n", - ret); - return ret; - } + if (ret != -EPROBE_DEFER) + dev_err(dev, "Failed to get reset-gpio: %i\n", + ret); + return ret; + } + + ret = gpiod_set_consumer_name(pcie->reset_gpio, "pcie1-reset"); + if (ret) { + dev_err(dev, "Failed to set reset gpio name: %d\n", ret); + return ret; } ret = of_pci_get_max_link_speed(dev->of_node); From patchwork Mon Sep 5 06:30:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12965552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80CF1ECAAD5 for ; Mon, 5 Sep 2022 06:41:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pemvym7GxvlMieMu5MvRlPz2o7vvHLaFq15LNHGTeXU=; b=byWMxENQcoXH+J HsE8GyeDqVh+DRl0mj61VMPsO/+8KvFKQxR+NV3U6vuhamiRI5m/pFRb2aLc6B/9L0UU4er/wvzPO m35x2xpQDT2IEuRxxvVxCPJPxu3KoiojgPRtTt6fILcXoha0Sdv1bPOioOIA9nDv3mU+ao2WKp+cb lUhZ9amGtnC5kw5uxeq9lj5CHCBeRr0DciFCdme5ZZuKcEGZlAZVcfMqrxAIHlX0U7SN3J/9qhWir cZW4qVHDnyK8tnVWgKHpK6K4v2qJ7qWe0TKAMxMaY5GghQ9fVwYKhTRI5QEZfnHi6FO4vP3H0pzzw /fqVcFVSD9lPl9jkIAxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5lQ-00COxk-Gs; Mon, 05 Sep 2022 06:39:21 +0000 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5dn-00CG8T-W8; Mon, 05 Sep 2022 06:31:32 +0000 Received: by mail-pg1-x532.google.com with SMTP id t70so1478779pgc.5; Sun, 04 Sep 2022 23:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=ynLt5at1fPNx8OKjwAxE9TZqe0qSgR0LfMKd2/ukQyE=; b=o0c6aYKNJPicMxZzE1PkKtIkQSLJsOwJFh3bcl+LYHEmHr5TaY61x79o0SD+ivoxZk DPf8vEmv/G+sAfYEywkQmzYS8TqIgrCK6wSXSLFwKEAK7Cbw08AkpqBT96rMRzPEVa0T aMMtmW+0f9glO6/cQ8keV15iEPs13h8fVonila+4g/ocL46xIqfFx7rDdBBE/MrAjqtO 5sl8bIgqi3+F/6v0vHcDrNJ1k/oQaqO7VkvMD/DoMztr6Me8/am6pi66ZHOCMZneRwid Zb3n7NhsZprL3d7KX03DatOFU7DvGf4H7pflgVDpxL0aWedJ+FcdT7hgq54vmCH9Sgv5 7z2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=ynLt5at1fPNx8OKjwAxE9TZqe0qSgR0LfMKd2/ukQyE=; b=acq8Xr8XLHapZo7NDWBXL6UPIAz/eVZvN3qhxdbbzRlAIQGmLppeo+lwEotAmqgXbK KIVyVVd2/6V/xZ280BrUAoySwuWTASiXKSvkjcikn9N+YRg+f1p9sYknkw4o/Q7070yE EFDG+ydF2WUohIDGYUQX4PiHVPN/TL+yh3pWiR2tV1o/NiGQxUgYyDIq16ySYzD15PH7 yeJiC79dPmTc1wTVI5eApt+FSY6J9ZbZ8z3GI7cW4wrXYP+5uccBVnxXmL3fXRITSXrb 2lGZV/raB2PDXEXjUdZT6uNSMu6OEDWvtZXSU0E2iYUPbcAOqIyOhu0djmzy7FrI/1V7 bjfA== X-Gm-Message-State: ACgBeo19Fp/vnt7QBqYyj4kSlTV3lf6+p/5bEfL5QtgVr6rZHsZQ8wv/ ijii2Ow4SqCCoI11t/pucGTqwC2J54A= X-Google-Smtp-Source: AA6agR6nqqurcOlRTW5MwumdR49aUTj5edmtMHpG5pntto/Ic3d6LDisTkJ/i3KAH13zMjWGur9aVA== X-Received: by 2002:a63:62c3:0:b0:434:2b09:6f62 with SMTP id w186-20020a6362c3000000b004342b096f62mr6851828pgb.374.1662359486505; Sun, 04 Sep 2022 23:31:26 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042254fce5e7sm5710653pga.50.2022.09.04.23.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 23:31:26 -0700 (PDT) From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?utf-8?q?Pali_Roh=C3=A1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 07/11] PCI: apple: switch to using fwnode_gpiod_get_index() Date: Sun, 4 Sep 2022 23:30:59 -0700 Message-Id: <20220903-gpiod_get_from_of_node-remove-v1-7-b29adfb27a6c@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220904_233128_142525_4BD20B4E X-CRM114-Status: GOOD ( 10.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I would like to stop exporting OF-specific gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c index a2c3c207a04b..d83817d3ff86 100644 --- a/drivers/pci/controller/pcie-apple.c +++ b/drivers/pci/controller/pcie-apple.c @@ -516,8 +516,8 @@ static int apple_pcie_setup_port(struct apple_pcie *pcie, u32 stat, idx; int ret, i; - reset = gpiod_get_from_of_node(np, "reset-gpios", 0, - GPIOD_OUT_LOW, "PERST#"); + reset = fwnode_gpiod_get_index(of_fwnode_handle(np), + "reset", 0, GPIOD_OUT_LOW, "PERST#"); if (IS_ERR(reset)) return PTR_ERR(reset); From patchwork Mon Sep 5 06:31:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12965658 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86466ECAAD5 for ; Mon, 5 Sep 2022 07:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+XekkYeYT9B0p1pjsEhVhEpbnBfVTtaLddvaOBlR/9c=; b=VRTIRarhWoyFBM sT0iKwGhLVx+2eFoXwdfvM9mEmIQuqP7jlV92XlBOr24s2GAnMOlVIEZ39uIYAT/vE4BW8saePRXe 8/++RUXyHcYPZCT130otCg9fFNDZt1dMlOX6aiCFq+JMxjHcJ5Td7tcv+Z/HLoujaG8fQ3DGQeJkj OoXs2k2MX6r2zD79ZsGvfAeW2qdWfPAoM/tV0y6lxime3C3k2SW5ep1ILXxsVZP/SfVopai2Efo8V f5BR0VaNHBZNvscALQVDSTYyVQqa+YDUshWvGzZhAorDdO5nczlzVWD5r1VAlAUrCaeqlvv8RQSXI zgGwq/gLs/xmBXjV7gaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV6Eg-00CyU1-DZ; Mon, 05 Sep 2022 07:09:36 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5v0-00Ca4V-Ub; Mon, 05 Sep 2022 06:49:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=G2Q8X3FWNy+Mum1KFhHHSQCIItKgzpZiSb8mAdu3vck=; b=NPuupZuhE7/ho1QfmN3lqQMfim /UEAVBzUIqPl3C1SiQ45jvt51V54DgJMUUIT8/Gz68F9XRF/NSdVgwdxfpahitodDDtF5XKlgbzx8 p6PpIrqePM0qoS5lu+os7Wk5fOuZpHnMIHKkFP5FutLJ8tr8jnqaH0tzubu2BPKQIkeAuIAOs/uLV bNKy6yRQkT5W43bXqp/wYxdg+Nnx+7LK+ydJ9TF9bwvxiOgYTW/KTWwpw364BQepq/pdXglEF0Xau j9lmzuZZ1twD9pNZLL92eDLMKEv7JvmFnMJGA7m/H6oZLxcPQWkuJu+8OwUY8C1X/cnREh50z+dq+ cUfXHTGQ==; Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5dt-009SFR-43; Mon, 05 Sep 2022 06:31:35 +0000 Received: by mail-pg1-x535.google.com with SMTP id c24so7273111pgg.11; Sun, 04 Sep 2022 23:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=G2Q8X3FWNy+Mum1KFhHHSQCIItKgzpZiSb8mAdu3vck=; b=FBPmWKbk3BWYF+J3K1WZ+Ol82sdIUCowS0WjoBoeLJwP+LR5gAz/hqHX1gjYAVa5om NIgH7Qk6N5rigD1eJP5EuzqqWeBUI8rxO6FNbumER8jIOtzxax/MwNFhpzGpMzlxKr9x KHJ7i9RRjxYVABvDu4w+I2WlJTjEqjc2B4kijfECmGBvAZhSZMXJefbYqeLIph3SF4qn 3n1+0jSFCH68oN7ImYI32e/dUNgIUelohNCH+XyjOKvH1oHWOKxSKn7Uxut1MpeOF0oa OMMldcVIUk/MvfKw67fTrKU0zEyg6YlcDYcuroJpaBs56j1Djz+Q6Fl7tyyophfaU0TY Hgkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=G2Q8X3FWNy+Mum1KFhHHSQCIItKgzpZiSb8mAdu3vck=; b=W/Uv3DGsVLOvKsR0tICc3TezZ2KU1tWjfuG3oHPwV9yTWT3jz7SljT954FAjNNoWgu hthxjajwXhDKByjrtFjxVkOmhZb5vFDLyyhq6GuYpeRSy6oaEznUyYmVL99rfJH8CJ4t Yfrdirvb6p+iD/zkDhNpXN/1EsaTvMLjR7fA2vseSsvDrpcUn66OFG3BcF9OEi9S4y1F R6ZK19iTBc4oymxmbGzabilNnXaMv0vFzvcM/WtYXfzPA6c9Q4RgaD8QistYpyZXap60 KkzP0AmlUM3R8JfwqHej9MtNO0akOp11VIj2vE+0viHQa4T95AvSnVq+vj7aC+yR/xxD cwxg== X-Gm-Message-State: ACgBeo0aOemKdT8ovPSpMGJMaxY7QrsUgtogk4/JcS7aXiEOSLihm+F2 RTZuxPiLT1CrV1sWo1i9s/Q= X-Google-Smtp-Source: AA6agR5x3Cd2bUFdFVhQSgyMvYn8olPbDNMNhdGlpAAhOjZvTLjZqt1otHo2lVL9RBMjcQPiw4Cbsg== X-Received: by 2002:a05:6a00:10c7:b0:53b:5eb3:4648 with SMTP id d7-20020a056a0010c700b0053b5eb34648mr13563922pfu.67.1662359488945; Sun, 04 Sep 2022 23:31:28 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042254fce5e7sm5710653pga.50.2022.09.04.23.31.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 23:31:28 -0700 (PDT) From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?utf-8?q?Pali_Roh=C3=A1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 08/11] regulator: bd71815: switch to using devm_fwnode_gpiod_get() Date: Sun, 4 Sep 2022 23:31:00 -0700 Message-Id: <20220903-gpiod_get_from_of_node-remove-v1-8-b29adfb27a6c@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_073133_717366_4978A047 X-CRM114-Status: GOOD ( 11.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. Signed-off-by: Dmitry Torokhov Reviewed-by: Matti Vaittinen Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij diff --git a/drivers/regulator/bd71815-regulator.c b/drivers/regulator/bd71815-regulator.c index acaa6607898e..c2b8b8be7824 100644 --- a/drivers/regulator/bd71815-regulator.c +++ b/drivers/regulator/bd71815-regulator.c @@ -571,11 +571,10 @@ static int bd7181x_probe(struct platform_device *pdev) dev_err(&pdev->dev, "No parent regmap\n"); return -ENODEV; } - ldo4_en = devm_gpiod_get_from_of_node(&pdev->dev, - pdev->dev.parent->of_node, - "rohm,vsel-gpios", 0, - GPIOD_ASIS, "ldo4-en"); + ldo4_en = devm_fwnode_gpiod_get(&pdev->dev, + dev_fwnode(pdev->dev.parent), + "rohm,vsel", GPIOD_ASIS, "ldo4-en"); if (IS_ERR(ldo4_en)) { ret = PTR_ERR(ldo4_en); if (ret != -ENOENT) From patchwork Mon Sep 5 06:31:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12965553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6825CECAAD5 for ; Mon, 5 Sep 2022 06:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RM+GbGZfo0WvGZwGuBFR9vCX59McIQLPUxllu48dKy0=; b=dNQUHhy7MG630P 4FU+1dWDPgLZxYca9MOPH0OCyQGPz3ykDOguc9IkLw0/WK5mJbd4jLkS8qGi4P/VtP/AYA8KwO2yt Stgx90qeX/w+Chc02s93l+WtVem2xXphUA0NcLW1D2xuQuETg1ofZGQDV4WTX5wf4O6MNo8s8SlKh 0qpqb2RDKaeSH4864sFk9FvXtbJDy4taijvhoIhQbI6hOxcVHdKKnUfQ7EHCXGwKT4cpIar+zniD0 pFA3rB0Qh+yr+2G3bQYHrALkjPbJAchbeP8TBzFpE9zlomNf8OumfrSp4Kx4ZVmKAbp7ur6CBQWCz 9TfCTlXiUq0nDe0+Ms3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5nG-00CRQS-D2; Mon, 05 Sep 2022 06:41:16 +0000 Received: from mail-pj1-f52.google.com ([209.85.216.52]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5dt-00CGEm-FM; Mon, 05 Sep 2022 06:31:36 +0000 Received: by mail-pj1-f52.google.com with SMTP id fs14so2717793pjb.5; Sun, 04 Sep 2022 23:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=zVe7w76eC6bgTDoVT05JO9xbEs/H8FGbqX7haQWgZL4=; b=kACI45UuEBwpfjjyassFNG0U98Hr0eJu20A/vSxogzN+vfXjugJ8KzkYn5wwKX5gbB uJeLI0QAz/+xelvX3OGbdcJTSgu2dNpdrSGSQg4famb7eeB/AbL7WHoZEDiXHjg2hnUR 4PSFIifn7lLM+A5nAaRKBTzgdAw7qg0BfzTpJ86cTaNvjX02vYPt0RebiXWe/iwHmm8q zGwFv8Qb/Nc0B3WMsCOQ/E4dqsgR2yN3yxu1FOcDO2Kb6oKm+SyvVHxf73Na21XGjNsa qHG58A2uebJOTkVIVHXCa9lAAMCpYNCKRv84xKCdiCS3bEdL5OBKRFVk2atPS95mlJqb +oMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=zVe7w76eC6bgTDoVT05JO9xbEs/H8FGbqX7haQWgZL4=; b=7XMUqw6LD/GHzcc6yHDPPJ20xpq/GDfSWJx8CsDybrErVkJCwUZLZZJxmAAX3SWOhd vsPfrDlDqRauWzyIS8EMIETKKTRKWsp4bDcsevObGaZFXTOTMk/nsixjS8PrOtpa4Fmy 0VksxV+LkLnyT28SkqSrTlklUwYFuY13GmkrXhiSCHe6Lcabc7QevlNS9R6yC0GzozgZ uhZGQdKzTIZer0TfNWgoWKfXB/xSNBt3Di9gag6+U2Eq6Mpq2tV6BT1sYEBtoB2RfpMB PJa/stRqJ1c6CRk9UEInPTVI7JQflAucbRTvSuwNQGC0N9Zu/gtR142voNmdWn/lsQ9y Oogw== X-Gm-Message-State: ACgBeo1bIRkBTDWTummgrheYL63kbIQdcQUj1yd7UIvA6GrmtaBQPXQs 2lEwKvrn88e2y7VTLUNXfGQ= X-Google-Smtp-Source: AA6agR41wNIiOLemySzBG0aXdzuGwcXJzGb1vIFW9PWKwOZh9QVyUeHaIw4+NjnqDzJgWjv579LMTw== X-Received: by 2002:a17:902:b581:b0:172:a34e:18fd with SMTP id a1-20020a170902b58100b00172a34e18fdmr46918225pls.163.1662359491466; Sun, 04 Sep 2022 23:31:31 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042254fce5e7sm5710653pga.50.2022.09.04.23.31.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 23:31:31 -0700 (PDT) From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?utf-8?q?Pali_Roh=C3=A1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 09/11] regulator: bd9576: switch to using devm_fwnode_gpiod_get() Date: Sun, 4 Sep 2022 23:31:01 -0700 Message-Id: <20220903-gpiod_get_from_of_node-remove-v1-9-b29adfb27a6c@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220904_233133_594984_9E12FD4E X-CRM114-Status: GOOD ( 13.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. While at it switch the rest of the calls to read properties in bd957x_probe() to the generic device property API as well. Signed-off-by: Dmitry Torokhov Reviewed-by: Matti Vaittinen Reviewed-by: Andy Shevchenko diff --git a/drivers/regulator/bd9576-regulator.c b/drivers/regulator/bd9576-regulator.c index aa42da4d141e..393c8693b327 100644 --- a/drivers/regulator/bd9576-regulator.c +++ b/drivers/regulator/bd9576-regulator.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -939,8 +940,8 @@ static int bd957x_probe(struct platform_device *pdev) } ic_data->regmap = regmap; - vout_mode = of_property_read_bool(pdev->dev.parent->of_node, - "rohm,vout1-en-low"); + vout_mode = device_property_read_bool(pdev->dev.parent, + "rohm,vout1-en-low"); if (vout_mode) { struct gpio_desc *en; @@ -948,10 +949,10 @@ static int bd957x_probe(struct platform_device *pdev) /* VOUT1 enable state judged by VOUT1_EN pin */ /* See if we have GPIO defined */ - en = devm_gpiod_get_from_of_node(&pdev->dev, - pdev->dev.parent->of_node, - "rohm,vout1-en-gpios", 0, - GPIOD_OUT_LOW, "vout1-en"); + en = devm_fwnode_gpiod_get(&pdev->dev, + dev_fwnode(pdev->dev.parent), + "rohm,vout1-en", GPIOD_OUT_LOW, + "vout1-en"); if (!IS_ERR(en)) { /* VOUT1_OPS gpio ctrl */ /* @@ -986,8 +987,8 @@ static int bd957x_probe(struct platform_device *pdev) * like DDR voltage selection. */ platform_set_drvdata(pdev, ic_data); - ddr_sel = of_property_read_bool(pdev->dev.parent->of_node, - "rohm,ddr-sel-low"); + ddr_sel = device_property_read_bool(pdev->dev.parent, + "rohm,ddr-sel-low"); if (ddr_sel) ic_data->regulator_data[2].desc.fixed_uV = 1350000; else From patchwork Mon Sep 5 06:31:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12965554 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08A16ECAAD5 for ; Mon, 5 Sep 2022 06:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PKI+POtKDalylk4/JrrAhes+4NZxXpPIG8S/Zv3os+M=; b=wk4+2aZJto4/eq NMb9bMxcApVlvrDF/AJ8P1GY4F3AGJve7zyn3QHND7KzeL8Y8UVXmktKk9Sc4RdEpgGjtCbEg/agX GSutuDNprH/hGljZNuldMLB7V/f4xg3W6ozpVokXAQDwGvjmXnXsfEGsidaYLfVyrQY/51Q/DwCkb VfjcLHK7kGDDv5KBnpEMBWxtVjRPGopZhBxRtwt1lw0lYG6uesGRtd2iCfTBeBN3lsz9boITftG1z 7cRzE33fn68cFjV+rm5A/y5UPuwzFxTUj543R8w8jggAf7emPZakxLZy6Uchh3ZbQvDE1jxPTff3V uxujXsYme6tiUBmdaKkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5oh-00CTSN-68; Mon, 05 Sep 2022 06:42:45 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5du-00CG0c-I7; Mon, 05 Sep 2022 06:31:38 +0000 Received: by mail-pf1-x42c.google.com with SMTP id y127so7745618pfy.5; Sun, 04 Sep 2022 23:31:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=pAKqmxhI+oYn9rP6tb2/SpDfiCBIbZJKyeH2Ncx9Utw=; b=CHUpPUJQaZbtMHqPTyL16aZuu5dGfpUKyuTqpooxvmLk7vBdmb+3IZJQADg9TyuoAE 0cG8hAWaahDZkANpgUlWjfY5/vdmfKu1XvftcF1vV0Zw4fcd3kAN8/tSHuaMoO0zpNBm YXE0wZKHC9zPU4U9Xl7Yhd25Z9ZuxlTB5qduXGsQAWvctKwUZPCTxgudnP1CsA9Z4aVZ +tauvc8nl8DqsSgMpx3Neo+dDGPXdFjpkpvztqgpLzbV9vhTRQcq+q2v4AIEPo0McvJX Ku8OCbM6x0lGXNoU5zr7539SBCdoAztESfRlg7+222oUU+VMgGHfb3EsA6bKMFDi8B5B 6xJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=pAKqmxhI+oYn9rP6tb2/SpDfiCBIbZJKyeH2Ncx9Utw=; b=gRNVJgIQJkgV6V6ngF/88ganoVkOWd0rV7Jgx94pbfXIdtl+khk2n1rA9Ch1L2AqJ9 cheDs7Vh/yM3rk09W9Cf1qH105YW0GukzbFgP5P+dQZ/CPfD+XGLyd/0cgMSkXahH47x IBaMjnip8ZVby39KhtmMK0F1GcnvmgH22+vsqrL91UHE8sIbO2UGxfER6HudMPHHptcT /SAAYbdt4HBL+5SR/OR9jdh5qoYEFFfVZ8cWZ5Ty0IztgHIN5azk9F83dBQZ+x/+QFW7 j3Y1a+9e0R4bAu+DNB95G2aXiU9NAMzXveUPjQtyoQBnnfeqhtihGZGrP1NeIOVTeWJc pc5w== X-Gm-Message-State: ACgBeo3uOFMzAOw2O5Zyh56nK3/4mQ5WElz+mU0Jig+8sMlCyQEa73x3 UghZT9HFVrG/3QnbcRHwClY= X-Google-Smtp-Source: AA6agR5nG0upukGr31j35s6QedIco+3RyHqtesjnmbs5inKKkFPhSexvscm/vPmPhr8DelSSovnwog== X-Received: by 2002:a63:4c4f:0:b0:430:41b4:bfc3 with SMTP id m15-20020a634c4f000000b0043041b4bfc3mr19959819pgl.457.1662359493913; Sun, 04 Sep 2022 23:31:33 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042254fce5e7sm5710653pga.50.2022.09.04.23.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 23:31:33 -0700 (PDT) From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?utf-8?q?Pali_Roh=C3=A1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 10/11] watchdog: bd9576_wdt: switch to using devm_fwnode_gpiod_get() Date: Sun, 4 Sep 2022 23:31:02 -0700 Message-Id: <20220903-gpiod_get_from_of_node-remove-v1-10-b29adfb27a6c@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220904_233134_694167_276B53DC X-CRM114-Status: GOOD ( 18.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() so that gpiolib can be cleaned a bit, so let's switch to the generic fwnode property API. While at it switch the rest of the calls to read properties in bd9576_wdt_probe() to the generic device property API as well. Signed-off-by: Dmitry Torokhov Reviewed-by: Guenter Roeck Reviewed-by: Linus Walleij diff --git a/drivers/watchdog/bd9576_wdt.c b/drivers/watchdog/bd9576_wdt.c index 0b6999f3b6e8..4a20e07fbb69 100644 --- a/drivers/watchdog/bd9576_wdt.c +++ b/drivers/watchdog/bd9576_wdt.c @@ -9,8 +9,8 @@ #include #include #include -#include #include +#include #include #include @@ -202,10 +202,10 @@ static int bd957x_set_wdt_mode(struct bd9576_wdt_priv *priv, int hw_margin, static int bd9576_wdt_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *np = dev->parent->of_node; struct bd9576_wdt_priv *priv; u32 hw_margin[2]; u32 hw_margin_max = BD957X_WDT_DEFAULT_MARGIN, hw_margin_min = 0; + int count; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -221,40 +221,51 @@ static int bd9576_wdt_probe(struct platform_device *pdev) return -ENODEV; } - priv->gpiod_en = devm_gpiod_get_from_of_node(dev, dev->parent->of_node, - "rohm,watchdog-enable-gpios", - 0, GPIOD_OUT_LOW, - "watchdog-enable"); + priv->gpiod_en = devm_fwnode_gpiod_get(dev, dev_fwnode(dev->parent), + "rohm,watchdog-enable", + GPIOD_OUT_LOW, + "watchdog-enable"); if (IS_ERR(priv->gpiod_en)) return dev_err_probe(dev, PTR_ERR(priv->gpiod_en), "getting watchdog-enable GPIO failed\n"); - priv->gpiod_ping = devm_gpiod_get_from_of_node(dev, dev->parent->of_node, - "rohm,watchdog-ping-gpios", - 0, GPIOD_OUT_LOW, - "watchdog-ping"); + priv->gpiod_ping = devm_fwnode_gpiod_get(dev, dev_fwnode(dev->parent), + "rohm,watchdog-ping", + GPIOD_OUT_LOW, + "watchdog-ping"); if (IS_ERR(priv->gpiod_ping)) return dev_err_probe(dev, PTR_ERR(priv->gpiod_ping), "getting watchdog-ping GPIO failed\n"); - ret = of_property_read_variable_u32_array(np, "rohm,hw-timeout-ms", - &hw_margin[0], 1, 2); - if (ret < 0 && ret != -EINVAL) - return ret; + count = device_property_count_u32(dev->parent, "rohm,hw-timeout-ms"); + if (count < 0 && count != -EINVAL) + return count; + + if (count > 0) { + if (count > ARRAY_SIZE(hw_margin)) + return -EINVAL; - if (ret == 1) - hw_margin_max = hw_margin[0]; + ret = device_property_read_u32_array(dev->parent, + "rohm,hw-timeout-ms", + hw_margin, count); + if (ret < 0) + return ret; - if (ret == 2) { - hw_margin_max = hw_margin[1]; - hw_margin_min = hw_margin[0]; + if (count == 1) + hw_margin_max = hw_margin[0]; + + if (count == 2) { + hw_margin_max = hw_margin[1]; + hw_margin_min = hw_margin[0]; + } } ret = bd957x_set_wdt_mode(priv, hw_margin_max, hw_margin_min); if (ret) return ret; - priv->always_running = of_property_read_bool(np, "always-running"); + priv->always_running = device_property_read_bool(dev->parent, + "always-running"); watchdog_set_drvdata(&priv->wdd, priv); From patchwork Mon Sep 5 06:31:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12965659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68B1EECAAA1 for ; Mon, 5 Sep 2022 07:12:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f5VYh3BknZxQUcVNjEVUSBV1WhdDzItIWLxZbIhnlok=; b=la0ZW3ZkpWPpZo e4V4ABnRlpA6eyyy1p53JrONtOwYoWHB1Q48/DMM9480vm45K0htSTwF34cny8KuTHZbqpXEVvBok QiQhcjSMUqDxhxOGoZwpCEiyDUpNKqCAi0feeG2ySblY9MUnC8q/bJqgWddu0Oc4hOdmxatbxVItd 0+YDXLKxD2wVM2IN/mK3AbMSjZtcZcrHwsCGcCXp7E23KRPK1AHAU9XDUC8DFMuxMtBFYOI/MXDxh 1qgrlHoz7xuObMcr4HZzTW7CstA7BFm3Zo6tPLnfsNazf5Uw7L0BMej92lMJ3tfG3rt5jXKr6/CnA l9U1p2l+1bakbXOOmBhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV6Ft-00D0Iy-LW; Mon, 05 Sep 2022 07:10:50 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5uz-00Ca4V-VX; Mon, 05 Sep 2022 06:49:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=VWe/av2g9WxE2lj2h4x591V5ZwS8Z03/LcbryzxlkEA=; b=E5qBIfDs6a6SADTnBJ/czGxw1I QnLUKdJTsmD9iQcF+OEQ2bJ+gsOzCL4jg2gErxMighV0bhfnWSO0nZnrtc4foUeqGcJ25d8Y2YIM5 n8HrXZ/66HgeMzcc6K7ktaJUmNuvc2x7lQ/7DcCFhL7F0/4u5lrObNBa13FSpmTDQ2aL6h3UoEbMO c0LgEBCijef1Kn9GxwSfx+RVuru3duUjSN3AfuVavzYWIMkE/iF/Vsuj1r6HG2nGJARYwHrxPAXr1 hW51dwikJ7ljt+GF6CzCipa1Pj9UqSyxkJ/KkmbK1IIMQuz2uJsa+w+WCwc9P9uAQfDrWuqG6JDUh jpb/7rKw==; Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV5dx-009SE0-4X; Mon, 05 Sep 2022 06:31:39 +0000 Received: by mail-pg1-x531.google.com with SMTP id v4so7273871pgi.10; Sun, 04 Sep 2022 23:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=VWe/av2g9WxE2lj2h4x591V5ZwS8Z03/LcbryzxlkEA=; b=FPP2yq86L9skh15r7N1HDwfFXjfhwE04FqrGjpXWX3EoG+Hta/Nx22nPNJ/t8eL/IT 995FRGeW2izU3ZnDl/g+qs7wv607HJhxhJLRKhjQySVeaGd/rcyGmQ5Dnqfcl11T18SW tf06zMMGUVVb++nYk6FQAZT51RRJv/TCyfcjagu1UIV6LyzKxdrLT9hwDVqC4uGAz5a0 Be7w67SFlgs3U+MWq7aHprynEe0YTcQJZYCSCVTHuqqVBhC3GEdGsE0TTMUlhYcEurCk eJSLHJEc2TiP9THpBZ0gy6OAl61D32MouWj48AMltgxfb2ZvbZEmZcLtFm/YfFBmGpit 62Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=VWe/av2g9WxE2lj2h4x591V5ZwS8Z03/LcbryzxlkEA=; b=1yELVaH92Q/UyiZAKLAI9qAZCHFND1DRDFazLeqf7/fpFZaf+YjR5ekOqmtr78UIWH Uci6LFU+YtLE0UkD6Q3cHWPOyw6um4NAw6RBeqn+vL5+rs97G2s1WW6cj3C0vttnKzRM DK1Ah8Y5mqFoddcIMCyDCGoGb4ex7KFFFypCvAS21DGGcDuW0HJm4Qr2lPEGQNCVywiy 63KH5apcFaDAP0dGTmVoZswbqk2IgSSmPeUsMwXsDjxWABloope64TqiaZYOilUBaP0H 3OheRZbEXHCo2IRMxUVAVPhFMM5N2lLbG0uU0F7UlVVQb5dqwneDRhdlyfHfcogqHCSY CjfA== X-Gm-Message-State: ACgBeo15iyyOGTW2F8VGCTbvCPGaNAVvajyWPVH4O+GdwvCz4Wjw785r fyXnWh/3L8xKc5VCaIyNNq4= X-Google-Smtp-Source: AA6agR4W3IsValNDHTekJxMuYb/OG6bI5CbZaz1XpSVwcU2T/joFwOJw522EfWiYj1A+GUqUQaJ/Zw== X-Received: by 2002:a65:588d:0:b0:42a:2778:164f with SMTP id d13-20020a65588d000000b0042a2778164fmr42341736pgu.616.1662359496367; Sun, 04 Sep 2022 23:31:36 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id d197-20020a6336ce000000b0042254fce5e7sm5710653pga.50.2022.09.04.23.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Sep 2022 23:31:35 -0700 (PDT) From: Dmitry Torokhov To: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , =?utf-8?q?Pali_Roh=C3=A1r?= Cc: linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v1 11/11] gpiolib: of: remove [devm_]gpiod_get_from_of_node() APIs Date: Sun, 4 Sep 2022 23:31:03 -0700 Message-Id: <20220903-gpiod_get_from_of_node-remove-v1-11-b29adfb27a6c@gmail.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-fc921 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_073137_761307_902340C0 X-CRM114-Status: GOOD ( 16.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that everyone is using [devm_]fwnode_gpiod_get[_index]() APIs, we no longer need to expose OF-specific [devm_]gpiod_get_from_of_node(). Note that we are keeping gpiod_get_from_of_node() but only as a private to gpiolib function. Signed-off-by: Dmitry Torokhov Reviewed-by: Linus Walleij diff --git a/drivers/gpio/gpiolib-devres.c b/drivers/gpio/gpiolib-devres.c index 16a696249229..fe9ce6b19f15 100644 --- a/drivers/gpio/gpiolib-devres.c +++ b/drivers/gpio/gpiolib-devres.c @@ -129,61 +129,6 @@ struct gpio_desc *__must_check devm_gpiod_get_index(struct device *dev, } EXPORT_SYMBOL_GPL(devm_gpiod_get_index); -/** - * devm_gpiod_get_from_of_node() - obtain a GPIO from an OF node - * @dev: device for lifecycle management - * @node: handle of the OF node - * @propname: name of the DT property representing the GPIO - * @index: index of the GPIO to obtain for the consumer - * @dflags: GPIO initialization flags - * @label: label to attach to the requested GPIO - * - * Returns: - * On successful request the GPIO pin is configured in accordance with - * provided @dflags. - * - * In case of error an ERR_PTR() is returned. - */ -struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev, - const struct device_node *node, - const char *propname, int index, - enum gpiod_flags dflags, - const char *label) -{ - struct gpio_desc **dr; - struct gpio_desc *desc; - - desc = gpiod_get_from_of_node(node, propname, index, dflags, label); - if (IS_ERR(desc)) - return desc; - - /* - * For non-exclusive GPIO descriptors, check if this descriptor is - * already under resource management by this device. - */ - if (dflags & GPIOD_FLAGS_BIT_NONEXCLUSIVE) { - struct devres *dres; - - dres = devres_find(dev, devm_gpiod_release, - devm_gpiod_match, &desc); - if (dres) - return desc; - } - - dr = devres_alloc(devm_gpiod_release, sizeof(struct gpio_desc *), - GFP_KERNEL); - if (!dr) { - gpiod_put(desc); - return ERR_PTR(-ENOMEM); - } - - *dr = desc; - devres_add(dev, dr); - - return desc; -} -EXPORT_SYMBOL_GPL(devm_gpiod_get_from_of_node); - /** * devm_fwnode_gpiod_get_index - get a GPIO descriptor from a given node * @dev: GPIO consumer diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index a037b50bef33..b0e0723b12ab 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -365,7 +365,6 @@ struct gpio_desc *gpiod_get_from_of_node(const struct device_node *node, return desc; } -EXPORT_SYMBOL_GPL(gpiod_get_from_of_node); /* * The SPI GPIO bindings happened before we managed to establish that GPIO diff --git a/drivers/gpio/gpiolib-of.h b/drivers/gpio/gpiolib-of.h index 8af2bc899aab..e0da568d6da3 100644 --- a/drivers/gpio/gpiolib-of.h +++ b/drivers/gpio/gpiolib-of.h @@ -3,6 +3,7 @@ #ifndef GPIOLIB_OF_H #define GPIOLIB_OF_H +struct device_node; struct gpio_chip; enum of_gpio_flags; @@ -16,6 +17,10 @@ void of_gpiochip_remove(struct gpio_chip *gc); int of_gpio_get_count(struct device *dev, const char *con_id); bool of_gpio_need_valid_mask(const struct gpio_chip *gc); void of_gpio_dev_init(struct gpio_chip *gc, struct gpio_device *gdev); +struct gpio_desc *gpiod_get_from_of_node(const struct device_node *node, + const char *propname, int index, + enum gpiod_flags dflags, + const char *label); #else static inline struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, @@ -38,6 +43,14 @@ static inline void of_gpio_dev_init(struct gpio_chip *gc, struct gpio_device *gdev) { } +static inline +struct gpio_desc *gpiod_get_from_of_node(const struct device_node *node, + const char *propname, int index, + enum gpiod_flags dflags, + const char *label) +{ + return ERR_PTR(-ENOSYS); +} #endif /* CONFIG_OF_GPIO */ extern struct notifier_block gpio_of_notifier; diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h index fe0f460d9a3b..37448ee17e81 100644 --- a/include/linux/gpio/consumer.h +++ b/include/linux/gpio/consumer.h @@ -615,54 +615,6 @@ struct gpio_desc *devm_fwnode_get_gpiod_from_child(struct device *dev, return devm_fwnode_gpiod_get_index(dev, child, con_id, 0, flags, label); } -#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_OF_GPIO) -struct device_node; - -struct gpio_desc *gpiod_get_from_of_node(const struct device_node *node, - const char *propname, int index, - enum gpiod_flags dflags, - const char *label); - -#else /* CONFIG_GPIOLIB && CONFIG_OF_GPIO */ - -struct device_node; - -static inline -struct gpio_desc *gpiod_get_from_of_node(const struct device_node *node, - const char *propname, int index, - enum gpiod_flags dflags, - const char *label) -{ - return ERR_PTR(-ENOSYS); -} - -#endif /* CONFIG_GPIOLIB && CONFIG_OF_GPIO */ - -#ifdef CONFIG_GPIOLIB -struct device_node; - -struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev, - const struct device_node *node, - const char *propname, int index, - enum gpiod_flags dflags, - const char *label); - -#else /* CONFIG_GPIOLIB */ - -struct device_node; - -static inline -struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev, - const struct device_node *node, - const char *propname, int index, - enum gpiod_flags dflags, - const char *label) -{ - return ERR_PTR(-ENOSYS); -} - -#endif /* CONFIG_GPIOLIB */ - struct acpi_gpio_params { unsigned int crs_entry_index; unsigned int line_index;