From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Subject: Re: [PATCH 07/15] Platform: OLPC: Avoid a warning if the EC didn't register yet Date: Sun, 4 Nov 2018 13:30:02 +0100 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/mixed; boundary="===============4805704156633539024==" Return-path: In-Reply-To: <20181010172300.317643-8-lkundrak@v3.sk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Lubomir Rintel Cc: Mark Rutland , devicetree@vger.kernel.org, devel@driverdev.osuosl.org, Eric Miao , James Cameron , Geert Uytterhoeven , linux-pm@vger.kernel.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Sebastian Reichel , Rob Herring , linux-spi@vger.kernel.org, Mark Brown , Haojian Zhuang , Daniel Mack , Darren Hart , platform-driver-x86@vger.kernel.org, Robert Jarzmik , Andy Shevchenko , linux-arm-kernel@lists.infradead.org List-Id: devicetree@vger.kernel.org --===============4805704156633539024== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qD80nKKiJWXm4UaL" Content-Disposition: inline --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-- --===============4805704156633539024== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel --===============4805704156633539024==--