Re: [PATCH v8 3/9] i2c: core: call of_i2c_setup_smbus_alert in i2c_register_adapter

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

 




G'day Jean,
On 21/07/2017 22:33, Jean Delvare wrote:
Hi Phil,

On Thu, 20 Jul 2017 12:44:52 +0800, Phil Reid wrote:
Calling a function in i2c-smbus (module) from i2c-core (builtin) is then a problem.

However there doesn't seem to be a way (that I can see) to have select statement force I2C_SMBUS=y if I2C=y

Can I get a hint on what the correct course of action is.

Well, i2c-smbus is supposed to go on top of i2c-core. This means
i2c-smbus can make use of functions from i2c-core but not the other way
around.

So far, the split worked fine because i2c_setup_smbus_alert() was
always called from individual device drivers (typically built as
modules.) It was not supposed to be called from core code, but this is
what you are trying to do now (indirectly.)

I can think of 3 ways to sort it out:
1* (Part of) the code you added (and possibly dependencies thereof)
    should be in i2c-core instead of i2c-smbus.
2* The call you added to i2c-core should in fact be somewhere else (for
    example a dedicated module, which would depend on both i2c-core and
    i2c-smbus).
3* The whole idea of splitting the i2c-smbus code to a separate module
    no longer flies, and i2c-core should be built from i2c-core.c +
    i2c-smbus.c (and CONFIG_I2C_SMBUS becomes a boolean.)

Thanks for the detailed response. That really clears things up for me.

Moving i2c_setup_smbus_alert & of_i2c_setup_smbus_alert to i2c-core-smbus, as per 1*,
seems to fix the problem.



--
Regards
Phil Reid

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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux