Re: Dynamically-allocated i2c_device_id vs MODULE_DEVICE_TABLE

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

 



On Sat, Jan 24, 2009 at 10:50 AM, Ben Dooks <ben-linux@xxxxxxxxx> wrote:
> you seem to have managed to short-circuit part of the device
> creation process. You do not need to pass the data via the device
> driver, you should pass it when creating the device.

Yes, I think my code is broken.

> If you look at i2c_board_info which can be passed into i2c_new_device
> or similar functions, there is a platform_data field you can fill out
> and this is passed in to your probe routine in the i2c device.

I don't think this will work for me.  I'm running this on a PowerPC
system, and we use a device tree to represent the I2C devices on the
various I2C buses.  My driver does not call i2c_new_device.  This is
done for me in of_register_i2c_devices().  As soon as my driver calls
i2c_add_driver(), my I2C probe function will be called, once for each
I2C device defined in the device tree.  So I don't think I can update
the i2c_board_info structure.

>
> --
> Ben (ben@xxxxxxxxx, http://www.fluff.org/)
>
>  'a smiley only costs 4 bytes'
> --
> 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
>



-- 
Timur Tabi
Linux kernel developer at Freescale
--
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