Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp671360imu; Fri, 16 Nov 2018 08:26:18 -0800 (PST) X-Google-Smtp-Source: AJdET5ce45BQuuNRiHMLgdNIjmEPRMYj99JlhDBVPd0ZdFlG8UQBeXSiBzNgZ26p7SIIjVt1zXiM X-Received: by 2002:a63:224f:: with SMTP id t15mr10519352pgm.69.1542385578352; Fri, 16 Nov 2018 08:26:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542385578; cv=none; d=google.com; s=arc-20160816; b=xoVAGPTJlzb5ncOLkPWb0HDnXo/ClD5fLvCOsbjzDx8EcAsdE2/0E8Tl/w1k4v3c2e mZ+jd4CDUxhK/JvePlrDoAT1QOlrSmkOBGfj/vdgUij3VqdTN47yo0zlVyJiu2SkdI2d vf8oVO8eW1GUfC9YsvaEgnrT5ewbRxKV778UHTlU/M4U4Ajeb/6L5GancduwS/4oLjIn 1M/j5qZLJUrezmf7zfFL4+hS+Hp2VucLw4m9c+VgKY3CqP0k7Q9793goXhts1nr3pi5y PE5wbsILVW7fUxsZ6c+1/MIFq2FWRb9Va8VTObybuIjTuCdCDLWppb6kxNbJFxGBH1dN Z+Kw== 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=ZclOR5GzQLPpffWq2RK/u5E6TrzG9IzH796nAezZsWo=; b=QENn5550Rq26prUeIweRQbAgTt+FlWp0M4qRiaC6SQhuGH1wazWpzfLBAWDmo4JpeJ ovs9JhIR8Q33hC2FD8KI45mPcACXIzge2Q6m6lV2QIROZHuGy/XDbo0o6tzruHVWCwB4 /jk4b2+OUNFm/TU9YPL4mkmXnAqeho5R0uYrgP5gb9lataZcLgrntbSLJyQktyJFY0XS OLJjLNwbBcK6lsqeu2TqIaeKTNylqNRXYE2It0sL9H1uTdCq0n4GsY1bW/onTEvDmYEc uv5krACpCqtZ4GOPRblSp3uUimYfuN50FUirVCPvgWJXIZmd227C2OYKvatLSeOeal2Z VgRg== 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 u34si29027560pgk.24.2018.11.16.08.26.04; Fri, 16 Nov 2018 08:26:18 -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 S2390200AbeKQCh7 (ORCPT + 99 others); Fri, 16 Nov 2018 21:37:59 -0500 Received: from shell.v3.sk ([90.176.6.54]:57076 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390089AbeKQCh6 (ORCPT ); Fri, 16 Nov 2018 21:37:58 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id AD08152CB7; Fri, 16 Nov 2018 17:24:52 +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 lhvz6fNpul9U; Fri, 16 Nov 2018 17:24:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 3AED95287F; Fri, 16 Nov 2018 17:24:23 +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 DKmwPl1z8mx4; Fri, 16 Nov 2018 17:24:18 +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 7B0FE52C9A; Fri, 16 Nov 2018 17:24:16 +0100 (CET) From: Lubomir Rintel To: Mark Brown , Geert Uytterhoeven , Darren Hart , Andy Shevchenko Cc: Greg Kroah-Hartman , James Cameron , Sebastian Reichel , Rob Herring , Mark Rutland , Eric Miao , Haojian Zhuang , Daniel Mack , Robert Jarzmik , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, devel@driverdev.osuosl.org, linux-pm@vger.kernel.org, Lubomir Rintel Subject: [PATCH v2 07/17] Platform: OLPC: Avoid a warning if the EC didn't register yet Date: Fri, 16 Nov 2018 17:23:53 +0100 Message-Id: <20181116162403.49854-8-lkundrak@v3.sk> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181116162403.49854-1-lkundrak@v3.sk> References: <20181116162403.49854-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 ENODEV, so that whoever attempted to use the EC call can defer their work. Signed-off-by: Lubomir Rintel Acked-by: Pavel Machek --- 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 35a21c66cd0d..9ee993d5d54b 100644 --- a/drivers/platform/olpc/olpc-ec.c +++ b/drivers/platform/olpc/olpc-ec.c @@ -116,8 +116,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.19.1