From patchwork Tue Sep 20 10:30:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianqun Xu X-Patchwork-Id: 12981867 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 CC00DC54EE9 for ; Tue, 20 Sep 2022 10:31:52 +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=0pU87buIl3yomtjveKtV+JsVQDCD9tullBXZe11Ksgk=; b=t0w0RGc9D+wB9o /7zX+BG9kfkywpDUbENek09Y5OYbHXkrh52bp1KaPuMnIvMD2rUg+LJCu4ZVaJGjDMWYtn9Zp2f8x tA8W3lbaZCezuaivPsLhNd7OhCA1lkotpwZkWKjBes7L1ZCEWmnAdjC40QyYKGc9AbJ7n5ReriIPA gkkNYWoJypt3y7puB/cZPFx2B394X5ik/xVKt3RWVPfn4a5oLWdapIshMtO1G+8bZMvThkPAG8y5e um+F1vIV4g0EcB5kssFb/ybfZ0njsSm5EnVyFV46FAK57mbdIcHr/7tjA8cv1cqoo1/bh9qcpuTKc JUKQDA4R/MTKLuHXn+ZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaaXP-002yV0-5P; Tue, 20 Sep 2022 10:31:35 +0000 Received: from mail-m11875.qiye.163.com ([115.236.118.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaaX5-002yHd-LZ for linux-rockchip@lists.infradead.org; Tue, 20 Sep 2022 10:31:28 +0000 Received: from localhost.localdomain (unknown [58.22.7.114]) by mail-m11875.qiye.163.com (Hmail) with ESMTPA id 3F483280AB7; Tue, 20 Sep 2022 18:31:12 +0800 (CST) From: Jianqun Xu To: linus.walleij@linaro.org, heiko@sntech.de, brgl@bgdev.pl, andriy.shevchenko@linux.intel.com Cc: robert.moore@intel.com, robh@kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, lenb@kernel.org, rafael@kernel.org, Jianqun Xu Subject: [PATCH 03/20] pinctrl/rockchip: use fwnode instead of of_node Date: Tue, 20 Sep 2022 18:30:51 +0800 Message-Id: <20220920103108.23074-4-jay.xu@rock-chips.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220920103108.23074-1-jay.xu@rock-chips.com> References: <20220920103108.23074-1-jay.xu@rock-chips.com> MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFJSktLSjdXWS1ZQUlXWQ8JGhUIEh9ZQVkZTh5IVkpIGU9KT0pITkxLH1UTARMWGhIXJB QOD1lXWRgSC1lBWU5DVUlJVUxVSkpPWVdZFhoPEhUdFFlBWU9LSFVKSktISkxVSktLVUtZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6ORg6ARw6ED0YURxCLQpNLyhD PhVPFD5VSlVKTU1ITU1CQ0xJQ0JNVTMWGhIXVREaAlUDDjsJFBgQVhgTEgsIVRgUFkVZV1kSC1lB WU5DVUlJVUxVSkpPWVdZCAFZQUhJT083Bg++ X-HM-Tid: 0a835a73a7882eb1kusn3f483280ab7 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220920_033118_670093_55311BAD X-CRM114-Status: GOOD ( 11.38 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Switch the pinctrl driver to use fwnode instead of the of_node. Signed-off-by: Jianqun Xu --- drivers/pinctrl/pinctrl-rockchip.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 25633c7b4244..723b44edc1f2 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -3033,8 +3033,8 @@ static int rockchip_pinctrl_parse_dt(struct platform_device *pdev, struct rockchip_pinctrl *info) { struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node; - struct device_node *child; + struct fwnode_handle *fwnode = dev_fwnode(dev); + struct device_node *np = to_of_node(fwnode), *child; int ret; int i; @@ -3129,7 +3129,8 @@ static struct rockchip_pin_ctrl *rockchip_pinctrl_get_soc_data( struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *node = dev->of_node; + struct fwnode_handle *fwnode = dev_fwnode(dev); + struct device_node *node = to_of_node(fwnode); const struct of_device_id *match; struct rockchip_pin_ctrl *ctrl; struct rockchip_pin_bank *bank; @@ -3291,15 +3292,16 @@ static SIMPLE_DEV_PM_OPS(rockchip_pinctrl_dev_pm_ops, rockchip_pinctrl_suspend, static int rockchip_pinctrl_probe(struct platform_device *pdev) { - struct rockchip_pinctrl *info; struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node, *node; + struct fwnode_handle *fwnode = dev_fwnode(dev); + struct device_node *np = to_of_node(fwnode), *node; + struct rockchip_pinctrl *info; struct rockchip_pin_ctrl *ctrl; struct resource *res; void __iomem *base; int ret; - if (!dev->of_node) + if (!is_of_node(fwnode)) return dev_err_probe(dev, -ENODEV, "device tree node not found\n"); ret = of_platform_populate(np, NULL, NULL, dev);