Re: Dynamically-allocated i2c_device_id vs MODULE_DEVICE_TABLE

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

 



Mark Brown wrote:

Really what
you're having to do here is fairly nasty and there's no good reason for
it to be supported - if something is being registered dynamically and
passing instantiation specific data around it really should be the
device and not the driver.

What we need is a way for the codec driver to do its stuff without needing a socdev.

I think I see your point, though. I'm calling i2c_add_driver, which technically could result in my i2c_probe function being called multiple times, if there are multiple matches in the device tree. I'll have to check that out on Monday.

> The fact that attempting to do this looks
bad is a win on the part of the I2C core.

For now an idiomatic solution for ASoC drivers is to have a single
static variable that you use to get the socdev through.

Well, that's what I do today. I was hoping to avoid that, but if I'm right about i2c_add_driver, then this trick doesn't really work either.

--
Timur Tabi
Linux Kernel Developer @ 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