Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756576Ab3FGQWH (ORCPT ); Fri, 7 Jun 2013 12:22:07 -0400 Received: from mail.free-electrons.com ([94.23.35.102]:50418 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756518Ab3FGQWF (ORCPT ); Fri, 7 Jun 2013 12:22:05 -0400 Date: Fri, 7 Jun 2013 18:21:57 +0200 From: Thomas Petazzoni To: Gregory CLEMENT Cc: Wolfram Sang , linux-i2c@vger.kernel.org, Ezequiel Garcia , Sebastian Hesselbarth , linux-arm-kernel@lists.infradead.org, Jason Cooper , Andrew Lunn , Nicolas Pitre , Lior Amsalem , Maen Suleiman , Tawfik Bayouk , Shadi Ammouri , Eran Ben-Avi , Yehuda Yitschak , Nadav Haklai , Ike Pan , Chris Van Hoof , Dan Frazier , Leif Lindholm , Jon Masters , David Marlin , linux-kernel@vger.kernel.org, Zbigniew Bodek , Piotr Ziecik Subject: Re: [PATCH 1/2] i2c-mv64xxx: Add I2C Transaction Generator support Message-ID: <20130607182157.34188f72@skate> In-Reply-To: <1370619743-15245-2-git-send-email-gregory.clement@free-electrons.com> References: <1370619743-15245-1-git-send-email-gregory.clement@free-electrons.com> <1370619743-15245-2-git-send-email-gregory.clement@free-electrons.com> Organization: Free Electrons X-Mailer: Claws Mail 3.9.1 (GTK+ 2.24.17; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1619 Lines: 58 Dear Gregory CLEMENT, On Fri, 7 Jun 2013 17:42:22 +0200, Gregory CLEMENT wrote: > /* Driver states */ > enum { > MV64XXX_I2C_STATE_INVALID, > @@ -110,6 +133,7 @@ struct mv64xxx_i2c_data { > spinlock_t lock; > struct i2c_msg *msg; > struct i2c_adapter adapter; > + int bridge_enabled; bool ? > @@ -528,6 +652,7 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data, > { > u32 bus_freq, tclk; > int rc = 0; > + const char *bridge_status; > > /* CLK is mandatory when using DT to describe the i2c bus. We > * need to know tclk in order to calculate bus clock > @@ -554,6 +679,15 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data, > * So hard code the value to 1 second. > */ > drv_data->adapter.timeout = HZ; > + > + /* > + * Acquire information on Transaction Generator support. > + */ > + bridge_status = of_get_property(np, "", NULL); It is not clear to me what this new bridge_status local variable is doing. > + if (of_property_read_bool(np, "i2c,i2c-bridge")) > + drv_data->bridge_enabled = 1; > + else > + drv_data->bridge_enabled = 0; This could be written directly as: drv_data->bridge_enabled = of_property_read_bool(np, "i2c,i2c-bridge"); Thanks, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com -- 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/