Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751206AbbDZBeU (ORCPT ); Sat, 25 Apr 2015 21:34:20 -0400 Received: from mail-vn0-f43.google.com ([209.85.216.43]:32858 "EHLO mail-vn0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751023AbbDZBeT (ORCPT ); Sat, 25 Apr 2015 21:34:19 -0400 MIME-Version: 1.0 In-Reply-To: <1428336906-14906-3-git-send-email-javier.martinez@collabora.co.uk> References: <1428336906-14906-1-git-send-email-javier.martinez@collabora.co.uk> <1428336906-14906-3-git-send-email-javier.martinez@collabora.co.uk> From: Gwendal Grignou Date: Sat, 25 Apr 2015 18:33:56 -0700 X-Google-Sender-Auth: PyDZfgCF73Tt1dPLqv7hQNz1HsA Message-ID: Subject: Re: [RESEND PATCH 2/8] platform/chrome: cros_ec_lpc - Use existing function to check EC result To: Javier Martinez Canillas Cc: Olof Johansson , Lee Jones , Doug Anderson , Bill Richardson , Simon Glass , Stephen Barber , Filipe Brandenburger , Todd Broch , linux-samsung-soc@vger.kernel.org, Linux Kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1933 Lines: 50 Reviewed-by: Gwendal Grignou Tested-by: Gwendal Grignou On Mon, Apr 6, 2015 at 9:15 AM, Javier Martinez Canillas wrote: > Commit 6db07b633658 ("mfd: cros_ec: Check result code from EC messages") > added a common cros_ec_check_result() function that can be used to check > the ec_msg->result for errors and warns about them. > > Use the existing function instead of duplicating same check in the driver. > > Signed-off-by: Javier Martinez Canillas > --- > drivers/platform/chrome/cros_ec_lpc.c | 14 ++------------ > 1 file changed, 2 insertions(+), 12 deletions(-) > > diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c > index 860310513cf0..3a675817c95d 100644 > --- a/drivers/platform/chrome/cros_ec_lpc.c > +++ b/drivers/platform/chrome/cros_ec_lpc.c > @@ -95,19 +95,9 @@ static int cros_ec_cmd_xfer_lpc(struct cros_ec_device *ec, > > /* Check result */ > msg->result = inb(EC_LPC_ADDR_HOST_DATA); > - > - switch (msg->result) { > - case EC_RES_SUCCESS: > - break; > - case EC_RES_IN_PROGRESS: > - ret = -EAGAIN; > - dev_dbg(ec->dev, "command 0x%02x in progress\n", > - msg->command); > + ret = cros_ec_check_result(ec, msg); > + if (ret) > goto done; > - default: > - dev_dbg(ec->dev, "command 0x%02x returned %d\n", > - msg->command, msg->result); > - } > > /* Read back args */ > args.flags = inb(EC_LPC_ADDR_HOST_ARGS); > -- > 2.1.4 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/