[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130607182157.34188f72@skate>
Date: Fri, 7 Jun 2013 18:21:57 +0200
From: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
To: Gregory CLEMENT <gregory.clement@...e-electrons.com>
Cc: Wolfram Sang <wsa@...-dreams.de>, linux-i2c@...r.kernel.org,
Ezequiel Garcia <ezequiel.garcia@...e-electrons.com>,
Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
linux-arm-kernel@...ts.infradead.org,
Jason Cooper <jason@...edaemon.net>,
Andrew Lunn <andrew@...n.ch>, Nicolas Pitre <nico@...xnic.net>,
Lior Amsalem <alior@...vell.com>,
Maen Suleiman <maen@...vell.com>,
Tawfik Bayouk <tawfik@...vell.com>,
Shadi Ammouri <shadi@...vell.com>,
Eran Ben-Avi <benavi@...vell.com>,
Yehuda Yitschak <yehuday@...vell.com>,
Nadav Haklai <nadavh@...vell.com>,
Ike Pan <ike.pan@...onical.com>,
Chris Van Hoof <vanhoof@...onical.com>,
Dan Frazier <dann.frazier@...onical.com>,
Leif Lindholm <leif.lindholm@....com>,
Jon Masters <jcm@...hat.com>,
David Marlin <dmarlin@...hat.com>,
linux-kernel@...r.kernel.org, Zbigniew Bodek <zbb@...ihalf.com>,
Piotr Ziecik <kosmo@...ihalf.com>
Subject: Re: [PATCH 1/2] i2c-mv64xxx: Add I2C Transaction Generator support
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists