Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2205272imu; Thu, 10 Jan 2019 10:00:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN6qMdvh1ntnl1wp4AmMVWvH4rHOLtTx+Rl1LTNdTxSN/oalpCQjB4vYcOv3aToiq9MVsHp5 X-Received: by 2002:a63:c503:: with SMTP id f3mr9945161pgd.431.1547143245810; Thu, 10 Jan 2019 10:00:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547143245; cv=none; d=google.com; s=arc-20160816; b=gRAPbjmHf1jUgVKRGs5yx7rOGFlFH+slC/ZnwDl8EhbwkaxSy4n8oLX+4UoeoTrHdp PUSOXcAKb9GuaDB6A0GHLt/u2TiMtciRtzxMrTBvwrPzuRG05PDC9MO6VyudnbCKm0oh 6el7YXrhF+tOp2WAWfauyvR/7xiFeIwn3m21F8402+p4OWGOIqFW+I1AAV0i068lBU9d aCjiGOf9ntHPyXiYiq6ZdvI9crneplh9kZ0E+QO0x+UnX5xDinoUZ340LJrQktkaGZQ+ z9mqqbr1fk9K1lomIBB96zvgbD7WGD+vRI6wALmN+c2BZjKsFJyLRpS0uLOTOMMmzIWa +ERg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=xgZekK4RqwlwAOxY7tDd0tUEzvs9kW0yCYX7604Swsw=; b=0MWfPw2hpNNzB3XKpcb5CEeOvTFo7xobZT4uiaXnXqprnpCQv9scZBQQQY0+WgboOR PDC4Pb49JiX4oDi1H5smLvh90KKijrT3JHsWufJ11FqdaeGN4Of6JThwXNkRvjGMEWY9 sOic3m4UgM69HOrKnoomWfU/McAxgssjUI7QVgKi4gPoGNzLK6L5iNoP9vU4haEyVled 13CRWC3QejxhHURWlZzSIcmS9kElR7MDwCzZrtMDNB/ZfrOfbuD1GLVMoRk51fsQX6qc +6n15ZXh0PSG3OoliOJ74xRKAjljR+uAjWFk49b7kVqs1I2ZWm7hS2FizQC6ZFvToQXD /28A== 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 h3si2701092pll.116.2019.01.10.10.00.30; Thu, 10 Jan 2019 10:00:45 -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 S1730825AbfAJR7U (ORCPT + 99 others); Thu, 10 Jan 2019 12:59:20 -0500 Received: from shell.v3.sk ([90.176.6.54]:58577 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730703AbfAJR7T (ORCPT ); Thu, 10 Jan 2019 12:59:19 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 53F7D1002F8; Thu, 10 Jan 2019 18:59:16 +0100 (CET) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 9P_664rwX-dS; Thu, 10 Jan 2019 18:59:05 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id E88BB1002F5; Thu, 10 Jan 2019 18:58:58 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YswE2QpCw7nS; Thu, 10 Jan 2019 18:58:55 +0100 (CET) Received: from belphegor.brq.redhat.com (nat-pool-brq-t.redhat.com [213.175.37.10]) by zimbra.v3.sk (Postfix) with ESMTPSA id 4E7B21002F6; Thu, 10 Jan 2019 18:58:54 +0100 (CET) From: Lubomir Rintel To: Andy Shevchenko , Darren Hart Cc: Rob Herring , Russell King , Mark Rutland , platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Lubomir Rintel , Pavel Machek Subject: [PATCH v5 04/10] Platform: OLPC: Avoid a warning if the EC didn't register yet Date: Thu, 10 Jan 2019 18:58:39 +0100 Message-Id: <20190110175845.1203986-5-lkundrak@v3.sk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190110175845.1203986-1-lkundrak@v3.sk> References: <20190110175845.1203986-1-lkundrak@v3.sk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just return EPROBE_DEFER, so that whoever attempted to use the EC call ca= n defer their work. Signed-off-by: Lubomir Rintel Acked-by: Pavel Machek --- Changes since v2: - Adjust the commit message for the s/ENODEV/EPROBE_DEFER/ change Changes since v1: - EPROBE_DEFER instead of ENODEV drivers/platform/olpc/olpc-ec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc= -ec.c index 2a647455a368..a91f78245f5e 100644 --- a/drivers/platform/olpc/olpc-ec.c +++ b/drivers/platform/olpc/olpc-ec.c @@ -125,8 +125,11 @@ int olpc_ec_cmd(u8 cmd, u8 *inbuf, size_t inlen, u8 = *outbuf, size_t outlen) struct olpc_ec_priv *ec =3D ec_priv; struct ec_cmd_desc desc; =20 - /* Ensure a driver and ec hook have been registered */ - if (WARN_ON(!ec_driver || !ec_driver->ec_cmd)) + /* Driver not yet registered. */ + if (!ec_driver) + return -EPROBE_DEFER; + + if (WARN_ON(!ec_driver->ec_cmd)) return -ENODEV; =20 if (!ec) --=20 2.20.1