Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6317366imu; Sun, 2 Dec 2018 15:16:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/WHcWEHI2bh6hERv/RlqefwbBJTCGzwaI9bMQ8RVjhQl0owYrZkLn4Ll8NF6jiUYak7Y2Kl X-Received: by 2002:a65:6392:: with SMTP id h18mr11631571pgv.107.1543792614935; Sun, 02 Dec 2018 15:16:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543792614; cv=none; d=google.com; s=arc-20160816; b=RJS21WjQccAS4inpSrf3bifj/4u3MrulosI4FMK975b96xSaAI70IUP8bwUgHCRpgF ZDF+iO8JAMreJAsF5HhI0iI4NHaGgRVU6egIyZuZo8yVNGWzcIUg9bqgrILndm0KCr9x GwQGH08av/eJMZCMEH9WyHZqr9HShdERXjtNL4JQEgd9VbTrD5zP8ZDwn15qocFqHz45 XOPr7VuA/vBqgwZkBjhox8eR2COK083L+b0dNV78B8CtSemBtPpuarOtmbFX5UpqLK55 vx77sp6FK7smCozUN7He4l40amd7Q1yjT52L7qKwNjvYF1nslKtBE5iOhrtdr1KEs8Rj ZvPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=HN9Odmodg2EUo9OFRGgQeJSEImyNlltj7Ro9/yh7mAw=; b=L7llHPNw1FAqSwTXR/7ZRacDkx07QYdvHiinKYWvqR7T2G5bGPCk7Shdlh6GjgvfvS VhbofK5iNvJd64zX4yt4QCuOrgx5597F0YehZzQLTdKrE3kyrlCLkR+VjIej5V52Zy5l clIqSCt+jAABIxv2VRP7sguUrLJfpRnOBTbmYeEqKHDwFvKc36Opv4TxKuwMxp6LPtZs 6hnj1PteWQKUdP1icaEi+nCg16a7uoAckkmx6TZUNX0iSlwNncszYiVq8znExhpeFV+E nBrs8bhg+U+Uw0Z8s+hdiwFXNy2KSGxdoOhFkofFdKU+B6hxplcSPXm5mT60b4gYJPGs lnxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OPhDIotE; 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 h68si13094598plb.375.2018.12.02.15.16.39; Sun, 02 Dec 2018 15:16:54 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OPhDIotE; 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 S1725845AbeLBXQA (ORCPT + 99 others); Sun, 2 Dec 2018 18:16:00 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:59300 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbeLBXQA (ORCPT ); Sun, 2 Dec 2018 18:16:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HN9Odmodg2EUo9OFRGgQeJSEImyNlltj7Ro9/yh7mAw=; b=OPhDIotEp5DSirgdQz6ZL5F/3 AMwqS8APLazXMMbrom/DKuLp3skw9DUdleUj9xzWDf5cuT9lveEXfK8ewBo9389xsqKxNW0FXNQO1 cu9sNWsYWgmZtqaEDsNHE6tew5uG2z4TxlejzyGBJPNbkyvSUD+QZIrnzRC1CAM0jJfVhm6/aFxA2 ctLNebQFCbYWGloK4BWT29q+0OF9Y51UovBa9KWAk+Hue2l6N3flV1AkQS3jLB+LrVvFl0/TabESy uuc25SGY726h2Fo56HAZbtn6gtAl+azptmNnJZlKg4K7RavIfZpcBnTJDU+ZHJjRwDAG/l1WZfBpy sC6299q7g==; Received: from dvhart by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gTaxq-0007OP-ET; Sun, 02 Dec 2018 23:15:50 +0000 Date: Sun, 2 Dec 2018 15:15:49 -0800 From: Darren Hart To: Lubomir Rintel Cc: Mark Brown , Geert Uytterhoeven , Andy Shevchenko , 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 Subject: Re: [PATCH v2 07/17] Platform: OLPC: Avoid a warning if the EC didn't register yet Message-ID: <20181202231549.GC23087@wrath> References: <20181116162403.49854-1-lkundrak@v3.sk> <20181116162403.49854-8-lkundrak@v3.sk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181116162403.49854-8-lkundrak@v3.sk> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 16, 2018 at 05:23:53PM +0100, Lubomir Rintel wrote: > Just return ENODEV, so that whoever attempted to use the EC call can I think you meant EPROBE_DEFER here, but the language in the commit message is a bit ambiguous here... > 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 = ec_priv; > struct ec_cmd_desc desc; > > - /* 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; > > if (!ec) > -- > 2.19.1 > > -- Darren Hart VMware Open Source Technology Center