Re: [PATCH v11 02/10] i2c: i2c-smbus: Move i2c_setup_smbus_alert from i2c-smbus to i2c-core-smbus

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

 



On 29/10/2017 23:44, Wolfram Sang wrote:
On Thu, Aug 24, 2017 at 05:31:02PM +0800, Phil Reid wrote:
In preparation to adding of_i2c_setup_smbus_alert() move
i2c_setup_smbus_alert() to core module. of_i2c_setup_smbus_alert()
will call i2c_setup_smbus_alert() and this avoid module dependecy issues.

I am not very happy with this but don't want to cause another delay. So,
I hope we can discuss and fix it incrementally.

 From what it does, I really think both setup_alert functions belong to
i2c-smbus.c. Three possibilities come to my mind (untested, though):

a) use try_then_request_module somehow

b) add to CONFIG_I2C something like:
	select I2C_SMBUS if OF

c) get rid of i2c-smbus.c entirely and move it all into the core

Dunno if a) or b) have been tried in the course of this series already?

G'day Wolfram, Thanks for reviewing.

Nope hadn't tried either a) or b).
a) is not something I was aware of.
Had a brief play and not sure how to make this work. This gives me the same linking problem.

A variant of b) was tried by selecting I2C_SMBUS from driver modules having smbalert support,
but that caused problems if the i2c core was builtin and the driver was a module. But this looks
to work for me.

A variant of c) with option to exclude the i2c-smbus code still.
Add i2c-smbus to the i2c-core module by:
Change Kconfig I2C_SMBUS to a bool
add i2c-smbus to i2c-core object.
fixup duplicate init_module calls etc.
Possibly also rename i2c-smbus to i2c-smbus-alert?

Let me know your preference and I'll put something together.


--
Regards
Phil Reid




[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