Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752026AbdHKEGc (ORCPT ); Fri, 11 Aug 2017 00:06:32 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:33201 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbdHKEGb (ORCPT ); Fri, 11 Aug 2017 00:06:31 -0400 Date: Thu, 10 Aug 2017 21:06:27 -0700 From: Benson Leung To: Thierry Escande Cc: Benson Leung , Lee Jones , linux-kernel@vger.kernel.org, vpalatin@chromium.org, bleung@google.com Subject: Re: [PATCH 5/8] mfd: cros_ec: fail early if we cannot identify the EC Message-ID: <20170811040627.GC13907@decatoncale.mtv.corp.google.com> References: <1502403410-5233-1-git-send-email-thierry.escande@collabora.com> <1502403410-5233-6-git-send-email-thierry.escande@collabora.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="vOmOzSkFvhd7u8Ms" Content-Disposition: inline In-Reply-To: <1502403410-5233-6-git-send-email-thierry.escande@collabora.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2464 Lines: 78 --vOmOzSkFvhd7u8Ms Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Thierry, On Fri, Aug 11, 2017 at 12:16:47AM +0200, Thierry Escande wrote: > From: Vincent Palatin >=20 > If we cannot communicate with the EC chip to detect the protocol version > and its features, it's very likely useless to continue. Else we will > commit all kind of uninformed mistakes (using the wrong protocol, the > wrong buffer size, mixing the EC with other chips). >=20 > Signed-off-by: Vincent Palatin > Signed-off-by: Thierry Escande Acked-by: Benson Leung > --- > drivers/mfd/cros_ec.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c > index b0ca5a4c..c5528ae 100644 > --- a/drivers/mfd/cros_ec.c > +++ b/drivers/mfd/cros_ec.c > @@ -112,7 +112,11 @@ int cros_ec_register(struct cros_ec_device *ec_dev) > =20 > mutex_init(&ec_dev->lock); > =20 > - cros_ec_query_all(ec_dev); > + err =3D cros_ec_query_all(ec_dev); > + if (err) { > + dev_err(dev, "Cannot identify the EC: error %d\n", err); > + return err; > + } > =20 > if (ec_dev->irq) { > err =3D request_threaded_irq(ec_dev->irq, NULL, ec_irq_thread, > --=20 > 2.7.4 >=20 --=20 Benson Leung Staff Software Engineer Chrome OS Kernel Google Inc. bleung@google.com Chromium OS Project bleung@chromium.org --vOmOzSkFvhd7u8Ms Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJZjS1DAAoJEB8J9XsKL+ZYt9cP/0GqwjHaQK8fzr5Y/2EqnRt9 W8rQ7dPLDwTrHyRjVBw66saRxuZJdSq/qW16GtlsOi7Dqjz+ZtpMr3Cb4E3t1aeg M1C+njvkqyZC1mr4zkG3yVjBvdC4/+wC04rehVL+eJpLT9LyX3MJ1SNqyxXq9dav VRJDSEAs2MnyRtJ9VSrP1J+fsM99hDAFNRfTNfnoMVn+4XvGF8vbs1Gw79YzNWeC 7YNmoXTaeCYMWILW4WOALS861WG0f8OC53PXIgJLpHeGTC4TYcdIZL9waIckK7KX MQ7fZz0yM7UCNrg9mCqbEwsdP4LxrV9Hn6LpIRtJgxHpaawoHa4nUY8eepUw7VWG /RvfnN+jMnejb3Bta0mPvxa1kW7Q2Er/kglf5bIrBaSDf246v9ISJgCAes0NPWvy MIhdlfaET1zEoWx6GKUYbLTBxTACYS2apV+029x31MY8HordHYbqvzWC8q8xbMVl /38SXF+g3jvoJNgIe6JMh7pumw0oKPhtulYSfd2oxNYCY0HNoeh6vPyL7KMakEfO jGwer4LUuOFiASYVgqNB70+UsdBw3ofBZU6ntHC2D4PtQHFDsrHSsY+JAUxMvFKl I5/YUmhNuC1fnDK8yRQTBnORwLckEvojnqjJ8xEC+bOVo3Ogf/EErtQhpIZUoIBq Fqp0zaTh63fFA5yJXTZL =8P0R -----END PGP SIGNATURE----- --vOmOzSkFvhd7u8Ms--