[i2c] [RFC, PATCH] Split mv643xx I2C platform support

Jean Delvare khali at linux-fr.org
Tue Nov 20 21:36:53 CET 2007


On 19 Nov 2007 13:34:46 -0700, Dale Farnsworth wrote:
> In article <20071118215101.1761f5fc at hyperion.delvare> you write:
> > On Wed, 14 Nov 2007 10:37:09 +0200, Tzachi Perelstein wrote:
> > >  mv64xxx_i2c_map_regs(struct platform_device *pd,
> > >  	struct mv64xxx_i2c_data *drv_data)
> > >  {
> > > -	struct resource	*r;
> > > +	int size;
> > > +	struct resource	*r = platform_get_resource(pd, IORESOURCE_MEM, 0);
> > >  
> > > -	if ((r = platform_get_resource(pd, IORESOURCE_MEM, 0)) &&
> > > -		request_mem_region(r->start, MV64XXX_I2C_REG_BLOCK_SIZE,
> > > -			drv_data->adapter.name)) {
> > > +	if (!r)
> > > +		return -ENOMEM;
> > 
> > Wrong error code. -ENODEV would be more suitable.
> 
> Note that the driver currently returns -ENOMEM for this case.
> The other drivers also aren't as consistent as we would like.
> For this condition, one returns -ENXIO, one returnw -EINVAL,
> two return -ENOENT, and the rest return -ENODEV.  It looks
> like -ENODEV is the consensus.

Well, the correct error would be -EBOGUSCODE but it doesn't appear
to have been defined yet ;)

-- 
Jean Delvare



More information about the i2c mailing list