Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp6081565imb; Fri, 8 Mar 2019 08:54:41 -0800 (PST) X-Google-Smtp-Source: APXvYqyXCaclYvPEdwhb1/HQt+7zyItjg++UTNDtz4xPMmBu/uXiCeLjvE76q+ckEwn8PXjhq0GE X-Received: by 2002:a17:902:e01:: with SMTP id 1mr19931712plw.66.1552064081147; Fri, 08 Mar 2019 08:54:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552064081; cv=none; d=google.com; s=arc-20160816; b=sOV6+11X2NYqOTPETdCG6MXMA4QrPI+Aq4As9KA0Ky6mzq5XjsA9QpZATarLHQ4OSl RwqF5qqLsdRRSQ42tgeVa72UFzelHB0U4k5luhtawczqNkqLjxgxKtbU0haI/yKg4/88 /aROwdQKuR0fMjiolU3/GE/OH6fHhU3NBP2dlsprEvnl7C7kNiYUHFQ8fknSpvpJsTcw om6J/SxPfBuTGyWLc3ldCQhSelLPkyYnpOGCi2LmNcDSyqdWWXV+N1tRGNe05im9+Lm0 +DQXqitBWhV3vezusB59OXrsaBgBDaa8rxEluSI/szSCgG6N2NFf0RsKgA2QhwgxJuqf J1eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=PnKBd589/zWdx/gBqyFuX1nQSSTvcEg0kUWTLVVkFz0=; b=rnuxtB+RtJvX8pg3VpdYB+Fc2INYtnC9cFpQBNAjRtAhx5vU2kftXbY4akTFQU8DRn LheX0NwoIxdOeCEaol2yT6AEr5D27t4mTKivk0DdmKZTML3anRJAYYn+4via4s4oEHSY KB4YYEDpYQOkQdssD7jmpJx907duE+wpGVtiKrhQDGU5XoTX5CshpR9YHBGsTbhJCHgy NQ939Ky0rc4YORJg2rbvYAZgsZ0SRoL68DGV9w3tTtlPIIEdx9LLhS8DJ1G0VGKpx3B9 s6vyJpk/SS9r7ySGrXxAcZ3U3mpwg6UqfZPYQgz7W0NANF9B4M65okHn7lDPvgor1+cf jC2A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si7289101plo.129.2019.03.08.08.54.25; Fri, 08 Mar 2019 08:54:41 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726838AbfCHQyE (ORCPT + 99 others); Fri, 8 Mar 2019 11:54:04 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:63212 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727186AbfCHQyE (ORCPT ); Fri, 8 Mar 2019 11:54:04 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x28Gq5d7026298; Fri, 8 Mar 2019 17:54:02 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2r2ng2cqky-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 08 Mar 2019 17:54:02 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B7CE631; Fri, 8 Mar 2019 16:54:01 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 98185A5A9; Fri, 8 Mar 2019 16:54:01 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 8 Mar 2019 17:54:01 +0100 Received: from localhost (10.201.23.25) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 8 Mar 2019 17:54:01 +0100 From: Fabien Dessenne To: Ohad Ben-Cohen , Bjorn Andersson , , CC: Fabien Dessenne , Benjamin Gaignard Subject: [PATCH v2] hwspinlock: ignore disabled device Date: Fri, 8 Mar 2019 17:53:46 +0100 Message-ID: <1552064026-11415-1-git-send-email-fabien.dessenne@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.25] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-08_14:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Do not wait for hwspinlock device registration if it is not available for use. Signed-off-by: Fabien Dessenne --- V2: use 'goto out' instead of 'return' drivers/hwspinlock/hwspinlock_core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c index 2bad40d..d806307 100644 --- a/drivers/hwspinlock/hwspinlock_core.c +++ b/drivers/hwspinlock/hwspinlock_core.c @@ -333,6 +333,11 @@ int of_hwspin_lock_get_id(struct device_node *np, int index) if (ret) return ret; + if (!of_device_is_available(args.np)) { + ret = -ENOENT; + goto out; + } + /* Find the hwspinlock device: we need its base_id */ ret = -EPROBE_DEFER; rcu_read_lock(); -- 2.7.4