From patchwork Mon Apr 25 14:33:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Glauber X-Patchwork-Id: 614509 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3qtpky119vz9s3T for ; Tue, 26 Apr 2016 00:39:06 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754873AbcDYOeA (ORCPT ); Mon, 25 Apr 2016 10:34:00 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34171 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754824AbcDYOd7 (ORCPT ); Mon, 25 Apr 2016 10:33:59 -0400 Received: by mail-wm0-f65.google.com with SMTP id n3so25455416wmn.1; Mon, 25 Apr 2016 07:33:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W1oSrLK8A0OOmUuI0RxRQZTj20POZ/aot17WMd4DKv4=; b=hRnDEOcSrXsAYNu766GFez22Zf+cri9KuWox6rJ5bOUdjAdYaxPIgI266Z8vQrR3q1 qEFfMHBPkolFjtkLbW1kciTqgFc4Z6RcKMfrSzbCpEPpyAROTNCIzdp4sd8/KURom1br U7+0+lI/ok/m9rGmTn2EkcTkBzBAMXzXoL2bYwTowBY0pGnO5GRYt0M7pcOuTyivM61U WgJc5FBUm+4kFOwpiG4c7jCOKMlCsD3ouCjshpj1/JiaaVzf+gn7VdDiE9Dv2vIsmUNZ 6b/dJuDLh6dLPCVW4nFrUasZL7qcGdvEZ+zYTnr7w+O0EWqqhRI9qRD3BufMI3iqML6R r30w== X-Gm-Message-State: AOPr4FUTOQidhAOLlNYl6AA0KxgEi+g426xOqthCUWy+BJwFDgYOwGxQXz3aWGYC0HD2ng== X-Received: by 10.28.113.218 with SMTP id d87mr13448423wmi.52.1461594838045; Mon, 25 Apr 2016 07:33:58 -0700 (PDT) Received: from wintermute.fritz.box (HSI-KBW-46-223-170-19.hsi.kabel-badenwuerttemberg.de. [46.223.170.19]) by smtp.gmail.com with ESMTPSA id o73sm19084272wme.16.2016.04.25.07.33.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Apr 2016 07:33:57 -0700 (PDT) From: Jan Glauber To: Wolfram Sang Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, David Daney , Jan Glauber Subject: [PATCH v7 03/15] i2c: octeon: Remove I2C_FUNC_SMBUS_QUICK support Date: Mon, 25 Apr 2016 16:33:32 +0200 Message-Id: <1461594824-7215-4-git-send-email-jglauber@cavium.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461594824-7215-1-git-send-email-jglauber@cavium.com> References: <1461594824-7215-1-git-send-email-jglauber@cavium.com> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org SMBUS QUICK never worked for the read case, because EINVAL was returned for a zero length message. The hardware does not support SMBUS QUICK messages so disable the support and remove the zero length check. Signed-off-by: Jan Glauber --- drivers/i2c/busses/i2c-octeon.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c index 0f536a1..ad563cf 100644 --- a/drivers/i2c/busses/i2c-octeon.c +++ b/drivers/i2c/busses/i2c-octeon.c @@ -459,9 +459,6 @@ static int octeon_i2c_read(struct octeon_i2c *i2c, int target, int i, result, length = *rlength; bool final_read = false; - if (length < 1) - return -EINVAL; - octeon_i2c_data_write(i2c, (target << 1) | 1); octeon_i2c_ctl_write(i2c, TWSI_CTL_ENAB); @@ -597,7 +594,7 @@ static struct i2c_bus_recovery_info octeon_i2c_recovery_info = { static u32 octeon_i2c_functionality(struct i2c_adapter *adap) { - return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | + return I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK) | I2C_FUNC_SMBUS_READ_BLOCK_DATA | I2C_SMBUS_BLOCK_PROC_CALL; }