Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp827994pxb; Wed, 3 Nov 2021 13:05:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv3/dsbHngMRGOGp4MjQCGUbH+6AIkJrRyv1YQUGlPQY/7jLq4H3bwVjeXtT5+0+3elbO9 X-Received: by 2002:a17:906:d553:: with SMTP id cr19mr55201863ejc.128.1635969954965; Wed, 03 Nov 2021 13:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635969954; cv=none; d=google.com; s=arc-20160816; b=tyu2XLiCj0QglWqUv4cDgRsff7MqJiAdf+vUpNg3KWaTRWRZYf7K667+lX97eRsVka XxnoeP8ERzS8ktV/tEgpQb6yjjGD0/z3FB4wVxtXm9IZP9a4f4dGfezSCSdpe4s5Zm3r Tt6UMZgtYuxDY1ocGQhhTYGdTmPyamWbiPx+UxGwr3chQ1aEXg9ff0nIQOXMusgSmzsq s9MxAY87z+NSvDGfYEn5XGh4pn5q7cTxy0FTMzIymLMuB3pV98Bp7PIPtqct90OM9BpN CoMUe8/1eN2+N93Qsha+A0eDGTJBgEP4d/XbKObhs4slC+XfSlQJIEwZ/AM/FyUIRvzR dQ9g== 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 :message-id:date:subject:cc:to:from; bh=H6lkg/yo1aO2SIyf+45+jg5X/wO6T1X32C41Oik3YGg=; b=K2xQc6bP5yyR0BErw/wzGfmYJmwtr6DZxQPgcLQHy1eToL0ByB95hSAd0z+XCqjIzZ G7xpBFm8LBPinWYV09uWU30XV5IAgbbpJ80bi1WEb3DRqMW1x7EjS/s/vaaxIcFnipTJ ebNWutB7BVdvq3/XvPJRwxQ04oisOQfwmPJJ9Bt6Ebuwntl90SwGAD4XkvPgHl8/MZS2 6AFrZ6Z0ZsIBSmJrrBEQvvtVJ7/Z6v0ngHRQT8d0r4k+y6WV9dM1uPctdmE1Xc38xUas 2bmVQkywWvo8j0tBZX5bMgtex5eqjb6CYSdNFYh3NLO4AbhEv4sy0Oz0hfnw/yhJdjU5 mAMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 9si6156917edw.603.2021.11.03.13.05.31; Wed, 03 Nov 2021 13:05:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231305AbhKCUDA (ORCPT + 99 others); Wed, 3 Nov 2021 16:03:00 -0400 Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:49938 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231325AbhKCUC7 (ORCPT ); Wed, 3 Nov 2021 16:02:59 -0400 Received: from pop-os.home ([86.243.171.122]) by smtp.orange.fr with ESMTPA id iMQlmtl2MUGqliMQlmsAS1; Wed, 03 Nov 2021 21:00:21 +0100 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Wed, 03 Nov 2021 21:00:21 +0100 X-ME-IP: 86.243.171.122 From: Christophe JAILLET To: leoyang.li@nxp.com, tyreld@linux.ibm.com Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 1/2] soc: fsl: guts: Revert commit 3c0d64e867ed Date: Wed, 3 Nov 2021 21:00:17 +0100 Message-Id: <1063e5a4738d897adcaffce2ab8e4e45f07998ff.1635969326.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 3c0d64e867ed ("soc: fsl: guts: reuse machine name from device tree"). A following patch will fix the missing memory allocation failure check instead. Suggested-by: Tyrel Datwyler Signed-off-by: Christophe JAILLET --- This is a follow-up of discussion in: https://lore.kernel.org/kernel-janitors/b12e8c5c5d6ab3061d9504de8fbaefcad6bbc385.1629321668.git.christophe.jaillet@wanadoo.fr/ --- drivers/soc/fsl/guts.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index 072473a16f4d..af7741eafc57 100644 --- a/drivers/soc/fsl/guts.c +++ b/drivers/soc/fsl/guts.c @@ -28,7 +28,6 @@ struct fsl_soc_die_attr { static struct guts *guts; static struct soc_device_attribute soc_dev_attr; static struct soc_device *soc_dev; -static struct device_node *root; /* SoC die attribute definition for QorIQ platform */ @@ -138,7 +137,7 @@ static u32 fsl_guts_get_svr(void) static int fsl_guts_probe(struct platform_device *pdev) { - struct device_node *np = pdev->dev.of_node; + struct device_node *root, *np = pdev->dev.of_node; struct device *dev = &pdev->dev; const struct fsl_soc_die_attr *soc_die; const char *machine; @@ -159,8 +158,9 @@ static int fsl_guts_probe(struct platform_device *pdev) root = of_find_node_by_path("/"); if (of_property_read_string(root, "model", &machine)) of_property_read_string_index(root, "compatible", 0, &machine); + of_node_put(root); if (machine) - soc_dev_attr.machine = machine; + soc_dev_attr.machine = devm_kstrdup(dev, machine, GFP_KERNEL); svr = fsl_guts_get_svr(); soc_die = fsl_soc_die_match(svr, fsl_soc_die); @@ -195,7 +195,6 @@ static int fsl_guts_probe(struct platform_device *pdev) static int fsl_guts_remove(struct platform_device *dev) { soc_device_unregister(soc_dev); - of_node_put(root); return 0; } -- 2.30.2