Message ID | 20240410124628.171783-11-brgl@bgdev.pl (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 9A92BCD11C2 for <linux-arm-kernel@archiver.kernel.org>; Wed, 10 Apr 2024 12:47:38 +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=jzTqASRPh3Df9e5M9FOcGgqt+aotmra2KD0FGAuDTOk=; b=Dj9mBEeVzHlJEx c34Hjf52vROSTlD8/J/gRkiXI9xsJF/ugtQWClbAJkH/jnQamKvWiaJknwwCAol2EUuLgVK9tgnrs xhMMeyFENCV+firDy2KNos3WM8beRcjKPUxoHpra7EvpRB/aywuMP3GILdW88kOTUaiaox3HbRUCB N/G7DNqWpO1/qupwqXpZweSzIb/O1tDaZgQp4wvFDQQyyDx9sfELO8ywaGk/e+zWdIawqzSkl7Hy0 cRc0UqWIbJzMgJ3pzAQITDnh0/h8BO3p6HOazKNqwRT21CijgAU9zsm2AXJgw4WkuJDzT/BoOorSH u4+509kXb9xw1D9n+k5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruXMN-00000006x3o-3Rcl; Wed, 10 Apr 2024 12:47:27 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruXM8-00000006wwy-0mEI for linux-arm-kernel@bombadil.infradead.org; Wed, 10 Apr 2024 12:47:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=VPKtETY44L+sLLhmL3uaX4nFnllKG+8eyvkbzTNtgX4=; b=p7Mj18ff6jG6y6xVHIC+sV3fwz SGMBxsFjdcwK3GbdgLRUBkI5WWn4Imwy9vUuyRo6rCaEQ7pVphIUcO57plp21EN2FO0pcwKN1PN67 F+WfvS5ik8bZBF1oBuNdFGRx97NvSfQLOAymOAkzpE1OThUL0b0thgrSm7D5NwHkhAh5zOwkCEbqw naJzBy2UAAly01deAQ5lcd1obv3Fx32zj2LclA2Mc7Be2aRrXqdgkKKSaDZPhf9p6J3HP2+gvHlhe /cEJAYZkluJhQ/+tCRjQNLuBPKnWnh7UDuIR5hC1v7OuXxEJvRlp7OZRjBiKTs5TNuQRH6j7WNcNc ZoEy2MOQ==; Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruXM3-000000085B0-43Qu for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2024 12:47:10 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-41735439872so3002905e9.2 for <linux-arm-kernel@lists.infradead.org>; Wed, 10 Apr 2024 05:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1712753225; x=1713358025; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VPKtETY44L+sLLhmL3uaX4nFnllKG+8eyvkbzTNtgX4=; b=WjFMl2HENPROh2S2M0Ig1GloKhnzp5mO14UztRoZAzeLzU6D6eP+upA8IBhns/vBv2 YwJoP9plmkD4PaQvS2MyhH6mBiy51gkhDtfRbW5h/G2rviwkuS/p0w7jZwradya6yesE Os3UwhON8pINTm+EH/iqxuRkvRASTvUMK+PIAPJPAH55kdOI7vX4oeGjmsKwo07q9TBB Vell8aZm5x7w46kkZIXMaKUoMBwvElFtKg8iObD7mrualMQc1RE6xqCzjk/yc2k1lH0a t1ci4A4NbCUDeKhs1AExsKYQFob6qwakGVicdS4+TcSAojuGlFr6xlRiBFMRsfjcYoeb L3Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712753225; x=1713358025; 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:message-id:reply-to; bh=VPKtETY44L+sLLhmL3uaX4nFnllKG+8eyvkbzTNtgX4=; b=DGdakriaWOFLe1IsfJMD0TpCedeI9pQpjDov+Y169e90mmKSkn87QGPH5FZXhV5Ht6 KWY3ru9Yjaml/lUVx+orQbShgfviw50bUGZA6AzUUSPN6tcSoXve5mSie927Blqg/CB1 66tBbnfxkW9FLtwYjHfJ7RIjABgjXjXXvOR76cPcmxanRVfOM6eVr6WDxl8ALEHkIEWV 9HJ6VA+UGWuDKuNR7u0EHzHonlxsvMclX8JERhBG81YPaAOgfOqNWzDwZxusabLd8o0o RZdgd6J5sMwbR1Jv8ewvYrzFwDkSXz2SzMtEHbrE+aamLJfmEH2RIjVJ0KsyRSsSYlMa NB/g== X-Forwarded-Encrypted: i=1; AJvYcCUaTdWjxYHI+R2fVyVk55sq+P8NnTtJanTIgXHEV3xDqmq1jC3ysOYsIJTsRVOQVVR36bcdOeJreuEO7zEsQxPPK27aREQ5PfuC8YwZ2fDQfoLe9Yc= X-Gm-Message-State: AOJu0YyCAYlX9I0O++JoS37dHAvoTwI/e6unK4ZlHAiox0nWeRAs+Z8P kPtbCWZ+EHK/DxW1cd6qmL1q88X5gMQnNgFjIFWhXMOsQnAxnSeZ2v6FlDV0eZ0= X-Google-Smtp-Source: AGHT+IEJEixdHehBfMp+jzL2CRJ1R/XZVbko53cUIaZrL4a3OQkcOBk74DAFhpPjF+7rdj1jqQT+Wg== X-Received: by 2002:a05:600c:1913:b0:416:9c95:b712 with SMTP id j19-20020a05600c191300b004169c95b712mr1689271wmq.20.1712753225367; Wed, 10 Apr 2024 05:47:05 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:75a:e000:6908:7e99:35c9:d585]) by smtp.gmail.com with ESMTPSA id v13-20020a05600c444d00b0041663450a4asm2150929wmn.45.2024.04.10.05.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 05:47:05 -0700 (PDT) From: Bartosz Golaszewski <brgl@bgdev.pl> To: Marcel Holtmann <marcel@holtmann.org>, Luiz Augusto von Dentz <luiz.dentz@gmail.com>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Kalle Valo <kvalo@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Bartosz Golaszewski <brgl@bgdev.pl>, Saravana Kannan <saravanak@google.com>, Geert Uytterhoeven <geert+renesas@glider.be>, Arnd Bergmann <arnd@arndb.de>, Neil Armstrong <neil.armstrong@linaro.org>, Marek Szyprowski <m.szyprowski@samsung.com>, Alex Elder <elder@linaro.org>, Srini Kandagatla <srinivas.kandagatla@linaro.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Abel Vesa <abel.vesa@linaro.org>, Manivannan Sadhasivam <mani@kernel.org>, Lukas Wunner <lukas@wunner.de>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Amit Pundir <amit.pundir@linaro.org>, Xilin Wu <wuxilin123@gmail.com> Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Subject: [PATCH v7 10/16] PCI/pwrctl: reuse the OF node for power controlled devices Date: Wed, 10 Apr 2024 14:46:22 +0200 Message-Id: <20240410124628.171783-11-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240410124628.171783-1-brgl@bgdev.pl> References: <20240410124628.171783-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_134708_784085_3CFB2C0B X-CRM114-Status: GOOD ( 16.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
power: sequencing: implement the subsystem and add first users
|
expand
|
diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 51e3dd0ea5ab..b908fe1ae951 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -6,6 +6,7 @@ */ #define pr_fmt(fmt) "PCI: OF: " fmt +#include <linux/cleanup.h> #include <linux/irqdomain.h> #include <linux/kernel.h> #include <linux/pci.h> @@ -13,6 +14,7 @@ #include <linux/of_irq.h> #include <linux/of_address.h> #include <linux/of_pci.h> +#include <linux/platform_device.h> #include "pci.h" #ifdef CONFIG_PCI @@ -25,16 +27,20 @@ */ int pci_set_of_node(struct pci_dev *dev) { - struct device_node *node; - if (!dev->bus->dev.of_node) return 0; - node = of_pci_find_child_device(dev->bus->dev.of_node, dev->devfn); + struct device_node *node __free(device_node) = + of_pci_find_child_device(dev->bus->dev.of_node, dev->devfn); if (!node) return 0; - device_set_node(&dev->dev, of_fwnode_handle(node)); + struct device *pdev __free(put_device) = + bus_find_device_by_of_node(&platform_bus_type, node); + if (pdev) + dev->bus->dev.of_node_reused = true; + + device_set_node(&dev->dev, of_fwnode_handle(no_free_ptr(node))); return 0; }