[PATCH 3/5] iio: adc: xilinx-xadc: Replace module macro with custom init/exit functions

Andy Shevchenko andriy.shevchenko at intel.com
Fri Feb 20 00:09:34 PST 2026


On Fri, Feb 20, 2026 at 08:54:26AM +0100, Michal Simek wrote:
> On 2/20/26 08:52, Andy Shevchenko wrote:
> > On Fri, Feb 20, 2026 at 11:09:39AM +0530, Sai Krishna Potthuri wrote:
> > > Replace module_platform_driver() macro with custom init and exit functions
> > > to prepare for supporting multiple bus interfaces (platform + I2C).
> > 
> > No, this is not how it should be done.
> 
> And how should it be done? separate file?

I answered somewhere else, but I can elaborate here as well.

The idea, yes, to have the driver in the parts:
 _core.c
 _platform.c
 _i2c.c

To achieve that, it needs first to split the driver followed by likely
conversion to regmap. With that done it may be used in i2c with a little
code added into _i2c.c.

We have examples in kernel for that.

0daede80f870 ("i2c: designware: Convert driver to using regmap API")
fcb82a939df8 ("i2c: designware: Add Baikal-T1 System I2C support")



-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list