Re: I2C device board info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Russell,

On Sat, 18 Jul 2009 11:56:00 +0100, Russell King - ARM Linux wrote:
> Sascha,
> 
> I've noticed the following in i2c_board_info initializers:
> 
> arch/arm/mach-mx2/pcm038.c:             I2C_BOARD_INFO("rtc-pcf8563", 0x51),
> arch/arm/mach-mx2/pcm038.c-             .type = "pcf8563"
> 
> However, I2C_BOARD_INFO is defined as:
> 
> #define I2C_BOARD_INFO(dev_type, dev_addr) \
>         .type = dev_type, .addr = (dev_addr)
> 
> so you're initializing .type twice.  Only one of these will be used,
> so you may want to correct these entries.  (Looking at Realview, the
> one which is used is the second - so in the above case, .type will
> be initialized with current gcc to "pcf8563" not "rtc-pcf8563".)

Most probably for historical reasons - the initial implementation of
I2C_BOARD_INFO did define the driver name, and setting the device type
was optional. Apparently the above piece of code was forgotten when
I2C_BOARD_INFO() was modified.

The correct type name for this chip is "pcf8563" so the two lines above
should be turned into:

		I2C_BOARD_INFO("pcf8563", 0x51),

Note that this is not an isolated case, although this one is worse
because I2C_BOARD_INFO() and .type do not agree on the chip name. But
there are several redundant .type definitions in arch/arm/mach-* and
one in arch/blackfin/mach-bf527. Time to fix them?

-- 
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux