Re: Device match data and DT compatible string fallback

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

 



Hi Wolfram,

On Mon, Jun 28, 2021 at 05:55:01PM +0200, Wolfram Sang wrote:
> 
> > I could fix this in the driver by calling of_device_get_match_data() in
> > the probe function with dev->of_node is not NULL, but I feel this is
> > really an issue that should be handled by the framework. Has anyone ever
> > given it a thought ?
> 
> The of entries should also have .data entries and use that.

That doesn't help unfortunately, as the i2c_device_id passed to probe()
comes from the i2c_device_id table, the of_device_id table isn't
involved.

> The driver could also be converted to probe_new to become independent of
> the i2c_device_id.

Sure, but that doesn't solve the problem, it only forces the driver to
basically implement

	if (dev->of_node)
		get data using of_device_get_match_data();
	else
		get data using i2c_match_id();

Shouldn't the I2C subsystem provide a single function to let the driver
retrieve the match data, regardless of where it comes from ?

-- 
Regards,

Laurent Pinchart



[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