From patchwork Fri Dec 15 13:40:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loys Ollivier X-Patchwork-Id: 10115137 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D949A60231 for ; Fri, 15 Dec 2017 13:41:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE57829F44 for ; Fri, 15 Dec 2017 13:41:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C316729F62; Fri, 15 Dec 2017 13:41:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 56DF929F44 for ; Fri, 15 Dec 2017 13:41:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=vb7F6Q9LimLjdQGxpv5I/uw+3rQNbOOG554SU/fJXGU=; b=ZvM F8ismcY1h3iKwJ6MNN5euvL1XYNKuW91O6Yv7Ckg+sG/H4fuc/SAVNudJzi50vn9elb6jLNQwUPv1 FKOkAggyiMPnHPD+GgS+mmfQMno+Qb5u2KptbDd2CHmqLEkyLCjDVCt2SazgpT/RPhzjEdxWkIcUV pgF70TL/bTjgZb9QjFfHO7QkZZTZgjFCti4ZHWM1uKs8sPQnuKHR+4rqqunNXm3h1nHN7Us2Kc8Fa NY1KIkS0NQNc7usPusgEC8xD8JDFv8qThhosxz3CoTZEkEOGxfA7v7L2Xznz6w90O4sj8CJrLqbHb YIQKV/BYM2uWHwkLmFad9T063weRUGw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePqEb-0003vo-IF; Fri, 15 Dec 2017 13:41:05 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ePqEV-0003tU-VD for linux-arm-kernel@lists.infradead.org; Fri, 15 Dec 2017 13:41:03 +0000 Received: by mail-wm0-x243.google.com with SMTP id t8so17528893wmc.3 for ; Fri, 15 Dec 2017 05:40:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=UoIeVQenElUpcUfYTzjOIMbbV7JtLcFlvDVUv5q2mBA=; b=NsVPghcYS68O7PIh08Ndcb4VH5us0P8WnudSBeBY/kZiH/CSrxjbpB8zQITTJvTWkF q9VGtsPy4gmzb3gv8viAa/ymWlISzNoSec1T3vc9FVi+sdvikErvFFuC3pqXKc7WZj/i G7Z35WjGT6sK7vEmRLq51CcuMN3MNPubVR/La4tyjtNg/WSZLCMpfy9as7oduijmWlfr 7DMlZj4DjbvXf60210CccxEaslR11J7LTvdeVkc1zldeymu160CCmxWloJjd/kBkWR+U HXCTmKkTGPTgzdN41p4qvCQDSxzY1vmDxTslfT4znFDWT+iJsc54XrO5ua3pWT2WXKMD HATA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=UoIeVQenElUpcUfYTzjOIMbbV7JtLcFlvDVUv5q2mBA=; b=K/ng5Ej5PBe+FF9U8WhtTTO0BwqKKLt9YT7lOpivTahKS+eZVs7Z2tyZxqKmsYAawn wteuYg9iB7GP87QDfD32KbJ3v2dswOgdLmOdncO3n4KTVSHAVX3wuWCHFQAZs5VApb7f REN7bp3gAraJ86zgv7Vzk5rr2sxCI63S5yILfCGJxo5dI72II8j4RZkQS/RQ6OhoiTjM FSsjFI2nI/d6ARUzVjaij0oqyK/kQBZvZQs5lxETmm2dZcawIMs+9Zp3Q9wVDlUqaCG/ RfrIuvnfGRa8o8lvKAwmuzMK7in5kxlRtvKw6R+8jzGHGrb8dpXB+Kw/Q74gDuIwPbZe p9MQ== X-Gm-Message-State: AKGB3mJr/WHIE6m69UoZ6HXvsPmE/WASAl0bK9WFs+qFUZHrLA48BG2W JPGlOVjycxpDhRy5tZxS+/Npkg== X-Google-Smtp-Source: ACJfBot79VnvPL8MreqO5lwXjwBhZqikHDEJ+OfN80vtOrkKmzJ1dOMEmUrrUl+3XNUo5YSZ3SUG7A== X-Received: by 10.28.111.146 with SMTP id c18mr5555956wmi.123.1513345237772; Fri, 15 Dec 2017 05:40:37 -0800 (PST) Received: from loys-XPS-13-9360.home (ANice-251-1-1-224.w86-203.abo.wanadoo.fr. [86.203.10.224]) by smtp.googlemail.com with ESMTPSA id t138sm11289281wme.16.2017.12.15.05.40.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Dec 2017 05:40:37 -0800 (PST) From: Loys Ollivier To: Andy Gross , David Brown Subject: [PATCH v3] firmware: qcom: scm: Fix incorrect of_node_put calls in scm_init Date: Fri, 15 Dec 2017 14:40:14 +0100 Message-Id: <1513345214-22835-1-git-send-email-lollivier@baylibre.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171215_054100_201839_3D265B0F X-CRM114-Status: GOOD ( 10.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, Loys Ollivier , Stephen Boyd , linux-kernel@vger.kernel.org, linux-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When using other platform architectures, in the init of the qcom_scm driver, of_node_put is called on /firmware if no qcom dt is found. This results in a kernel error: Bad of_node_put() on /firmware. These calls to of_node_put from the qcom_scm init are unnecessary as of_find_matching_node and of_platform_populate are calling it automatically. Remove the calls to of_node_put() on fw_np. Fixes: d0f6fa7ba2d6 ("firmware: qcom: scm: Convert SCM to platform driver") Suggested-by: Stephen Boyd Signed-off-by: Loys Ollivier --- drivers/firmware/qcom_scm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index af4c75217ea6..f6d7b7cffe0c 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -632,17 +632,13 @@ static int __init qcom_scm_init(void) np = of_find_matching_node(fw_np, qcom_scm_dt_match); - if (!np) { - of_node_put(fw_np); + if (!np) return -ENODEV; - } of_node_put(np); ret = of_platform_populate(fw_np, qcom_scm_dt_match, NULL, NULL); - of_node_put(fw_np); - if (ret) return ret;