Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3246391ybh; Mon, 16 Mar 2020 19:06:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtL8KTN4ClDZTR2VkjNVGaUTwNUsO2zsSQ8IdxXGgaRkwoyLHd6TLZIQw9K7FJXCSwo78uC X-Received: by 2002:a9d:3a62:: with SMTP id j89mr1749540otc.45.1584410799614; Mon, 16 Mar 2020 19:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584410799; cv=none; d=google.com; s=arc-20160816; b=hjdjE+M/UqIOkftV5sZROmm9D49P+J4jiERLhr4vJ1VORBhJymmrrmXyB8p6vbuk6R rnC5IUNB0v5wBW/2GYSEe+I33pX9doIEf3k7i6z+3F7+9syV5G6prbpOvIBrxLAFUiI6 uc981coom09zUi4DgBKYIFG3HDloItqm5YLascOUEOzbsYNEvt+sbdlutOGfTiz2/1dX 4gANEzi5WG5Ulp5X86ia/nEjQZ4XPv5TaXjTbxxFpBLGR6QLK6g8NkS0HiZVG9vksNjb yt8kLr961l5ZqADXQrfaS4GUpxouosyYM6nPLISD67bRiPgj79vUP0m/LsgnJJzXgV9K gAJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=A8+AmKZTa3P/vx9tOo6VpGaNRmqeM3XjvYy9V37ym/w=; b=j/5R+icdG7RbwZfkrurXe5+0kUoVlWHa2BiB786MnibtMXCjwvjDWJFCRngRhgKjxa dF7fCmOE/eFUaunsxhsRuSrdyZ2Qkoj/CefelblOBrhmvTC6VUKRfS4tng87n3GkDDPo OwiwSH0Wr/HSshyq4CLCUB7IvJYDoz7U1uRtNDvd0B8wBRybDW45W5ogMmwPdFfulP7b VK24CTbp7nxZEg06iVbedRleXJ1v9qKuc6038kDX4JY3Vs6R8s4TtlMjzoWLQYZJ3iz/ zWP7Vvlzglt40nZ1Rdb6p9xnmDhH21vmCGDmGtSEG57GsUQqF9DC1vQ2l+39Kx22GKZB uQIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q137si935929oic.139.2020.03.16.19.06.27; Mon, 16 Mar 2020 19:06:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726706AbgCQBoX (ORCPT + 99 others); Mon, 16 Mar 2020 21:44:23 -0400 Received: from inva020.nxp.com ([92.121.34.13]:37080 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726559AbgCQBoX (ORCPT ); Mon, 16 Mar 2020 21:44:23 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B173C1A0CD2; Tue, 17 Mar 2020 02:44:21 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0661F1A0CD1; Tue, 17 Mar 2020 02:44:16 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5C659402C4; Tue, 17 Mar 2020 09:44:09 +0800 (SGT) From: Anson Huang To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, leonard.crestez@nxp.com, abel.vesa@nxp.com, l.stach@pengutronix.de, peng.fan@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] soc: imx8m: No need to put node when of_find_compatible_node() failed Date: Tue, 17 Mar 2020 09:37:33 +0800 Message-Id: <1584409053-23116-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No need to put node when of_find_compatible_node() failed, return immediately to simplify the code. Signed-off-by: Anson Huang --- drivers/soc/imx/soc-imx8m.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/soc/imx/soc-imx8m.c b/drivers/soc/imx/soc-imx8m.c index 719e1f18..7b0759a 100644 --- a/drivers/soc/imx/soc-imx8m.c +++ b/drivers/soc/imx/soc-imx8m.c @@ -53,11 +53,11 @@ static u32 __init imx8mq_soc_revision(void) struct device_node *np; void __iomem *ocotp_base; u32 magic; - u32 rev = 0; + u32 rev; np = of_find_compatible_node(NULL, NULL, "fsl,imx8mq-ocotp"); if (!np) - goto out; + return 0; ocotp_base = of_iomap(np, 0); WARN_ON(!ocotp_base); @@ -78,9 +78,8 @@ static u32 __init imx8mq_soc_revision(void) soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW); iounmap(ocotp_base); - -out: of_node_put(np); + return rev; } -- 2.7.4