From patchwork Fri Nov 16 16:23:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 10686623 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA25717EE for ; Fri, 16 Nov 2018 16:26:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5AC72CE4E for ; Fri, 16 Nov 2018 16:26:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A74B22D607; Fri, 16 Nov 2018 16:26:48 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 A76482D26D for ; Fri, 16 Nov 2018 16:26:47 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=0OFRt5jc/GoOFN/r7PAXnYRDx5TrVdktKaXvp7SQ7dA=; b=N3s8rALxKzwINf zn0tF37qK8DvaLgn9K+UYkG+YjD0/8UXu31kwe6kqYD6IOXFJ1u7+5CadE0T3a/gslJ5dMZ2sidmp OR0M4/HgeE2aCEdSm4CrJYdKIhgU1rFHPEbJfvhMSasYjgeM62fsg1nvKqAfLhtZDiYz68gweM2aV Vij0D0qNR/oLdhLdYYVLP1y0OKu3LylfkpEPLzR+vf+CPxjubltb2NeZVrWlYl5vz9Pk0wwmREJ3p SHRycwVnKew4WrszyoO0vtuh2mcW92Dmk4ugRow/i2BpAYwoZT9r1T4AOR26RYXyJcF0lNy3+LZQI V2e94Y2b+aeKG6ztJsuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNgxC-0006oy-1i; Fri, 16 Nov 2018 16:26:46 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNgva-0004A0-GB for linux-arm-kernel@bombadil.infradead.org; Fri, 16 Nov 2018 16:25:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type: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=ZclOR5GzQLPpffWq2RK/u5E6TrzG9IzH796nAezZsWo=; b=areSpwIVOC+m0EeLklfvbJEnPq IZdBw5D9PXNz6l5Y8au120hGYqMtfHeiu0dR8kH6KVpFWpqvDivZXUEvhYKouWLc2lle41X/EQy/n xytsYqxtJJJpPZWnNcuGNVDqgXU//mDrpwfrFA42bnSOLU3CQX2VBtGncx9YqCzGA5reMkRbjkTBE j15lHKqXS7zULzpQz3j/GJUj0EkOX8wqv7+3HzdaQ9oSsFQfTVBXy2wZPq5qN+aEkLnoGFUCB6ZUG WIvJGVE576EHiVUwxlKClIFYIuiH5cLzqS67X1iyR21thWDufJ0LKEypC3p6Aqn4q2hyr6tYDUs3Y rgDISzAQ==; Received: from shell.v3.sk ([90.176.6.54]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNgvX-0001pe-6G for linux-arm-kernel@lists.infradead.org; Fri, 16 Nov 2018 16:25:03 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181116_112503_423699_916CCB0B X-CRM114-Status: GOOD ( 11.92 ) 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: Mark Rutland , devicetree@vger.kernel.org, devel@driverdev.osuosl.org, Eric Miao , James Cameron , linux-pm@vger.kernel.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Sebastian Reichel , Haojian Zhuang , linux-spi@vger.kernel.org, Lubomir Rintel , Rob Herring , linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, Robert Jarzmik , Daniel Mack 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 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 = 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)