From patchwork Wed Nov 23 14:41:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 25023 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2834008wrr; Wed, 23 Nov 2022 06:48:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Tji+ZZmeg3nOp/fMiGSqcQIDXPh9bdKiPtkSca5p8EDzBFLkKblEuJugxHLX2tymS8cVE X-Received: by 2002:aa7:9045:0:b0:56c:a321:eecb with SMTP id n5-20020aa79045000000b0056ca321eecbmr30545635pfo.19.1669214899679; Wed, 23 Nov 2022 06:48:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669214899; cv=none; d=google.com; s=arc-20160816; b=Ka6V17R8NCwjs6IrhFpXqWa9RFihyHuadFjKY10yjOoSCr3yErOQoaNWhrnSTUHqzX gEduLtsAlCIh4qhnfuAKC/+DGGcivF4YN7mTUDE8LoK5WdAu86g56YgVws8K7sArqgKm aiK/osOueKYB5KaBhZI3cF/g2c3aot5o///DXl+/4xe4Pu3PWM0nek56EyKP1gC34q1L 3nLUy9dt6ceyrke1lYIrHTjRcfMZgQrhBliIQCMvoGhnkTr5GLXVrlR7Pjm9jhVAfdY1 LBrQJlocF/idb1FzK+nV4HvQWVY1ixB4iZjv2Fw6j0GDdLWIOxU/aTPCr2/cVPrEeuz1 ygmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=epM7ihmg2Sp3Ga9d0ILj3Fm9FFx2G/K8T7olctjIfLc=; b=imt/fzrdZJa5SpLFl/3O7Oereu0mZtBjwexITkdBkdtpwJEtUX1UOe+ZEqoD6SpJ8j dHbF/HqkFGajP7SsfFcV1h7SaLKObIRemSyXabWzy+J5E4Jl7JLlWvC3NLZ/I8dCg8rR gEWugNfm8nrq4xtGqrS75RgMa7KHPJapBUva6crTQAvxR5Yru6eD4rWdzZ2NJqMrHolX xKHNB6xNxunCVk5FycbcVUVzQrn3g8GYk7dkpEVHjb41OfhRm5FqAFNBu4Sn+3z4tSoi 8KH4axu3/6ikrbjPVPdwIM0htxAWvMPYcjpmntIy1xT3Ath2/PPDOMjc3Lim6LQ1+ADL DI0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a170902740800b00179faf5c34asi15876071pll.379.2022.11.23.06.48.06; Wed, 23 Nov 2022 06:48:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238526AbiKWOlm (ORCPT + 99 others); Wed, 23 Nov 2022 09:41:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238477AbiKWOlg (ORCPT ); Wed, 23 Nov 2022 09:41:36 -0500 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 541FD58039 for ; Wed, 23 Nov 2022 06:41:33 -0800 (PST) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed10:881b:815b:474d:c3fd]) by laurent.telenet-ops.be with bizsmtp id nqhS2800e49U0Rd01qhSaN; Wed, 23 Nov 2022 15:41:30 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1oxqwI-001Rqi-06; Wed, 23 Nov 2022 15:41:26 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1oxqwH-0012HT-3W; Wed, 23 Nov 2022 15:41:25 +0100 From: Geert Uytterhoeven To: Krzysztof Kozlowski , Vignesh Raghavendra , Miquel Raynal , Richard Weinberger , Mark Brown Cc: Philipp Zabel , Sergey Shtylyov , Wolfram Sang , linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 3/6] memory: renesas-rpc-if: Always use dev in rpcif_probe() Date: Wed, 23 Nov 2022 15:41:19 +0100 Message-Id: <298009c43ad119703f564c0f1864743914b4beeb.1669213027.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750298682628255084?= X-GMAIL-MSGID: =?utf-8?q?1750298682628255084?= rpcif_probe() already has a "dev" variable pointing to the right device structure, so there is no need to take a detour through the platform device. Signed-off-by: Geert Uytterhoeven --- v2: - Combination of the old "memory: renesas-rpc-if: Always use dev in rpcif_sw_init()" and "memory: renesas-rpc-if: Add dev helper to rpcif_probe()" after rebasing on top of the two fixes. --- drivers/memory/renesas-rpc-if.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c index 42c5f9f10135b86a..83171242f9514c22 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -688,9 +688,9 @@ static int rpcif_probe(struct platform_device *pdev) const char *name; int ret; - flash = of_get_next_child(pdev->dev.of_node, NULL); + flash = of_get_next_child(dev->of_node, NULL); if (!flash) { - dev_warn(&pdev->dev, "no flash node found\n"); + dev_warn(dev, "no flash node found\n"); return -ENODEV; } @@ -700,12 +700,12 @@ static int rpcif_probe(struct platform_device *pdev) name = "rpc-if-hyperflash"; } else { of_node_put(flash); - dev_warn(&pdev->dev, "unknown flash type\n"); + dev_warn(dev, "unknown flash type\n"); return -ENODEV; } of_node_put(flash); - rpc = devm_kzalloc(&pdev->dev, sizeof(*rpc), GFP_KERNEL); + rpc = devm_kzalloc(dev, sizeof(*rpc), GFP_KERNEL); if (!rpc) return -ENOMEM; @@ -734,9 +734,9 @@ static int rpcif_probe(struct platform_device *pdev) vdev = platform_device_alloc(name, pdev->id); if (!vdev) return -ENOMEM; - vdev->dev.parent = &pdev->dev; + vdev->dev.parent = dev; - rpc->dev = &pdev->dev; + rpc->dev = dev; rpc->vdev = vdev; platform_set_drvdata(pdev, rpc);