From patchwork Thu May 16 20:37:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 244420 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 DC6C62C0089 for ; Fri, 17 May 2013 06:37:59 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884Ab3EPUh7 (ORCPT ); Thu, 16 May 2013 16:37:59 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:52083 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751481Ab3EPUh6 (ORCPT ); Thu, 16 May 2013 16:37:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Date:Sender:Message-Id:Subject:Cc:To:From:References:In-Reply-To; bh=AblrspPekrYk1tHKvFy6r3gJUopcNqxiU2dvp0tpncM=; b=enWFWYoi4ESMjaFiEUPiGTj/WnrjLofuZdjZOgf7CF/wv8K0oRDDL+E4QHNQqNSxv7s2cWopFrTGsBEQhtQe8gpa7e7GCoWMz+LQT7tm6fAV00tAo+ubNUIjV7gMy/WiqwSU8JTN3IaRb5QX0MG/xVHvkv5zLUmWJFWt8u8e+u4=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:34849 helo=rmk-PC.arm.linux.org.uk) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Ud4vI-00081R-Bj; Thu, 16 May 2013 21:37:12 +0100 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1Ud4vH-0004Jz-F6; Thu, 16 May 2013 21:37:11 +0100 In-Reply-To: <20130516202921.GW18614@n2100.arm.linux.org.uk> References: <20130516202921.GW18614@n2100.arm.linux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org Cc: Jason Cooper , Sebastian Hesselbarth , "Mark A. Greer" , Wolfram Sang , "Ben Dooks (embedded platforms)" , linux-i2c@vger.kernel.org Subject: [PATCH 7/9] I2C: mv64xxx: remove I2C_M_NOSTART code Message-Id: Date: Thu, 16 May 2013 21:37:11 +0100 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org As this driver does not advertise protocol mangling support (I2C_FUNC_PROTOCOL_MANGLING is not set), having code to act on I2C_M_NOSTART is illogical, and in any case isn't supportable on anything but the first message - which makes no sense. Remove the I2C_M_NOSTART code. Signed-off-by: Russell King --- drivers/i2c/busses/i2c-mv64xxx.c | 26 +++++--------------------- 1 files changed, 5 insertions(+), 21 deletions(-) diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index a82ab25..d160f8c 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c @@ -419,28 +419,12 @@ mv64xxx_i2c_execute_msg(struct mv64xxx_i2c_data *drv_data, struct i2c_msg *msg, spin_lock_irqsave(&drv_data->lock, flags); mv64xxx_i2c_prepare_for_io(drv_data, msg); - if (unlikely(msg->flags & I2C_M_NOSTART)) { /* Skip start/addr phases */ - if (drv_data->msg->flags & I2C_M_RD) { - /* No action to do, wait for slave to send a byte */ - drv_data->action = MV64XXX_I2C_ACTION_CONTINUE; - drv_data->state = - MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA; - } else { - drv_data->action = MV64XXX_I2C_ACTION_SEND_DATA; - drv_data->state = - MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK; - drv_data->bytes_left--; - } + if (is_first) { + drv_data->action = MV64XXX_I2C_ACTION_SEND_START; + drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_START_COND; } else { - if (is_first) { - drv_data->action = MV64XXX_I2C_ACTION_SEND_START; - drv_data->state = - MV64XXX_I2C_STATE_WAITING_FOR_START_COND; - } else { - drv_data->action = MV64XXX_I2C_ACTION_SEND_ADDR_1; - drv_data->state = - MV64XXX_I2C_STATE_WAITING_FOR_ADDR_1_ACK; - } + drv_data->action = MV64XXX_I2C_ACTION_SEND_ADDR_1; + drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_ADDR_1_ACK; } drv_data->send_stop = is_last;