From patchwork Tue Aug 1 18:21:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 129478 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp17675vqx; Tue, 1 Aug 2023 14:14:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlHzCl6keHiNatjRr9Jh2T1V7vNmXhyTE0B8Oa47GnF8l+I+Djg311WanvVOEuP9Jzaj55Jh X-Received: by 2002:a17:906:dd:b0:99b:f465:9b8c with SMTP id 29-20020a17090600dd00b0099bf4659b8cmr3080965eji.20.1690924469332; Tue, 01 Aug 2023 14:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690924469; cv=none; d=google.com; s=arc-20160816; b=CxyhjhpCJryWqFLhfhSYO0eltQLrsdhWM/tsT0nNcBMEXixbvjQcP3TrXc3dXf/2Ys +AHwq1mX+0m2mdNY4MBZ7D5oKFYqKAaF+qX/ENSXnOVRaKQcZx/iV7Ag+ZTHsAYKILxd 6pAeFNQ70NawuWEARdi0rBBt79nHsn03v3MoZe1TySLc63+5+lZBDK/q0jiPnF3PPBnR oY5qwYFmQ+zaRziTXS0S2LJXLwXAfu6s+mc2Q9zO+Grnb5XafKWhguyyLdYKTcw1v61F 0ERr7g2p3bURP0mlVqJVZ9UdqPgBIhD6x3/zJgIHteRPxsG123oUsEZa3f0kmeVW8gYt tjTg== 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 :dkim-signature; bh=X3Zr5zi6oiutEUY5SskrgH9VYy6BX6UnhftLaueXlCU=; fh=OHS2tDwbcHt81zFnYeyYq8ynDfpjq+e2h9R20vebRfM=; b=c5cLDPLFphTtHkOw34upJMxDNxNzUWkJgEFS1FeJjBuH+LNEQ0YB3M3YharVf8C7B3 dO8XjbCdJ20mLGSIHpDh9ABJ1H5ze30f7tp034QmCCoJWjNcdUNiPlRDxoWoLAWXGIfC DXkYmTdPdpRjn4EvRQvFsp4JQqwYBhAAXhbddnW8aLCS8sRYaEZ+G7KScH07huFPvS0f unqg7GID2f+wYUrdfnVsbta81fJns8BRSv98pnTO43AatAQdYkqn5EhsoCZodqTThHsh WC/xC7SDbtlmfbOgs53zSuRVCL+RnWrFw7x0tfU+1zcdi8TSrq3MwRQCOPd/ErfS4bsg XAdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Qwc4xWMh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j17-20020a170906279100b0098dd7b3684csi6594469ejc.994.2023.08.01.14.14.05; Tue, 01 Aug 2023 14:14:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Qwc4xWMh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232045AbjHASVw (ORCPT + 99 others); Tue, 1 Aug 2023 14:21:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231789AbjHASVo (ORCPT ); Tue, 1 Aug 2023 14:21:44 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6445D269A for ; Tue, 1 Aug 2023 11:21:41 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5BE8CE0008; Tue, 1 Aug 2023 18:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1690914099; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X3Zr5zi6oiutEUY5SskrgH9VYy6BX6UnhftLaueXlCU=; b=Qwc4xWMhuvilEC8gbcLTJ38MSm192xYthNDF4cItf+Qlz+MmsgOA28ca3z/PmVV4hIIbGo /p77PON4HbCwGxBD36wYi/Iybj1PHNX6XKCu+CIB2or+zKU8dzSw7K+i6jMWfFXwBUOuk/ EEt8umo6taoe7vA1wcbpE4gJQ85/unuyYegiy3Y4oDdL5G5q0pKO4LSajU/zZvpkyLKfNk /Nu/NYxPne1XMEZL4DBnEM2WfCtnkTMzLGdF3RsuRRDOj2EdR4WGHxAeXoH9ecUQrbT7aA jCMpph1MLWPtg9xi5MWFRe8ebWYaB8LJuMUt2V/i8lXkOBgJDOViGKs2h+m/gA== From: Miquel Raynal To: Srinivas Kandagatla Cc: Greg Kroah-Hartman , Thomas Petazzoni , Robert Marko , Luka Perkov , Michael Walle , , Randy Dunlap , Chen-Yu Tsai , Daniel Golle , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Miquel Raynal Subject: [PATCH v7 2/7] nvmem: core: Do not open-code existing functions Date: Tue, 1 Aug 2023 20:21:27 +0200 Message-Id: <20230801182132.1058707-3-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230801182132.1058707-1-miquel.raynal@bootlin.com> References: <20230801182132.1058707-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: miquel.raynal@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: INBOX X-GMAIL-THRID: 1773062816749117677 X-GMAIL-MSGID: 1773062816749117677 Use of_nvmem_layout_get_container() instead of hardcoding it. Signed-off-by: Miquel Raynal --- drivers/nvmem/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 48659106a1e2..257328887263 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -786,10 +786,10 @@ EXPORT_SYMBOL_GPL(nvmem_layout_unregister); static struct nvmem_layout *nvmem_layout_get(struct nvmem_device *nvmem) { - struct device_node *layout_np, *np = nvmem->dev.of_node; + struct device_node *layout_np; struct nvmem_layout *l, *layout = ERR_PTR(-EPROBE_DEFER); - layout_np = of_get_child_by_name(np, "nvmem-layout"); + layout_np = of_nvmem_layout_get_container(nvmem); if (!layout_np) return NULL;