Dear Ben Dooks,

On Tue, 03 Sep 2013 13:56:46 +0100, Ben Dooks wrote:

> > +static int em_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
> > +   int num)
> > +{
> > +   struct em_i2c_device *i2c_dev =
> > +           (struct em_i2c_device *)(i2c_get_adapdata(adap));
> 
> if this is used enough it may have been easier to add an to_em_i2c()
> macro.

Or simply realize that i2c_get_adapdata() returns a 'void *' and that
therefore the cast is unnecessary, which makes a to_em_i2c() macro
useless, no?

I.e, you should be able to write:

        struct em_i2c_device *i2c_dev = i2c_get_adapdata(adap);

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-i2c" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to