From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A2ECC32789 for ; Sun, 4 Nov 2018 12:30:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 351DF2085A for ; Sun, 4 Nov 2018 12:30:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 351DF2085A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729735AbeKDVo5 (ORCPT ); Sun, 4 Nov 2018 16:44:57 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:40554 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729232AbeKDVo4 (ORCPT ); Sun, 4 Nov 2018 16:44:56 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 7869B8092E; Sun, 4 Nov 2018 13:30:01 +0100 (CET) Date: Sun, 4 Nov 2018 13:30:02 +0100 From: Pavel Machek To: Lubomir Rintel Cc: Mark Brown , Geert Uytterhoeven , Darren Hart , 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 07/15] Platform: OLPC: Avoid a warning if the EC didn't register yet Message-ID: <20181104123002.GA23864@amd> References: <20181010172300.317643-1-lkundrak@v3.sk> <20181010172300.317643-8-lkundrak@v3.sk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qD80nKKiJWXm4UaL" Content-Disposition: inline In-Reply-To: <20181010172300.317643-8-lkundrak@v3.sk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qD80nKKiJWXm4UaL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2018-10-10 19:22:52, Lubomir Rintel wrote: > Just return ENODEV, so that whoever attempted to use the EC call can > defer their work. >=20 > Signed-off-by: Lubomir Rintel Acked-by: Pavel Machek > --- > drivers/platform/olpc/olpc-ec.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc= -ec.c > index 35a21c66cd0d..342f5bb7f7a8 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 -ENODEV; > + > + if (WARN_ON(!ec_driver->ec_cmd)) > return -ENODEV; > =20 > if (!ec) --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --qD80nKKiJWXm4UaL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlve5koACgkQMOfwapXb+vJDaQCfXwsCUx2xiRgXIhiHvPnPwPqQ Us4An0hLBD7YIVuG4f3P3NA4xmx4xkj8 =1czk -----END PGP SIGNATURE----- --qD80nKKiJWXm4UaL--