Re: [PATCH v7 04/10] i2c: i2c-smbus: add of_i2c_setup_smbus_alert

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

 




On Jun 28 2017 or thereabouts, Phil Reid wrote:
> > > > diff --git a/include/linux/i2c-smbus.h b/include/linux/i2c-smbus.h
> > > > index 19efbd1..b5261c1 100644
> > > > --- a/include/linux/i2c-smbus.h
> > > > +++ b/include/linux/i2c-smbus.h
> > > > @@ -49,4 +49,13 @@ struct i2c_client *i2c_setup_smbus_alert(struct i2c_adapter *adapter,
> > > >   					 struct i2c_smbus_alert_setup *setup);
> > > >   int i2c_handle_smbus_alert(struct i2c_client *ara);
> > > > +#if IS_ENABLED(CONFIG_I2C_SMBUS)
> > 
> > Can't we have:
> > #if IS_ENABLED(CONFIG_I2C_SMBUS) && IS_ENABLED(*whatever OF config symbol is*)
> > 
> > Because otherwise, even if the code works from what I understand, we
> > will pull in i2c-smbus from i2c-core all the time.
> 
> Sorry I'm lost here.
> CONFIG_I2C_SMBUS looks to the be symbol that enables i2c-smbus in the makefile.
> I thought this would be enough to keep it out of the core.
> 

Assuming CONFIG_I2C_SMBUS is set, my concerns are regarding the fact
that i2c-smbus.ko will now be pulled in by i2c-core.ko no matter what.
There is nothing wrong per se in the code, just that now i2c-core
depends on i2c_smbus given that you call i2c_setup_smbus_alert() in
i2c-core. So that makes the whole point of having a separate module
for i2c-smbus moot.

If of_i2c_setup_smbus_alert() is masked by IS_ENABLED(OF), then the call
for i2c_setup_smbus_alert() will only be done with OF enabled, meaning
that i2c-smbus.ko will only be pulled in by i2c-core when OF is in use.

But maybe that is too much of thinking from my part :)

Cheers,
Benjamin
--
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