mfd mc34708: Separate I2C and SPI probe
Upcoming patches will put I2C/SPI on their own busses with spi_register_driver / i2c_register_driver which will only be available if the subsystem is enabled. We could provide static inlines, but it wouldn't make much sense to compile a spi/i2c driver if the corresponding subsystem is disabled. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
0757da6802
commit
4def29f141
|
@ -266,31 +266,40 @@ static int mc_probe(struct device_d *dev, enum mc34708_mode mode)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_I2C
|
||||
static int mc_i2c_probe(struct device_d *dev)
|
||||
{
|
||||
return mc_probe(dev, MC34708_MODE_I2C);
|
||||
}
|
||||
|
||||
static int mc_spi_probe(struct device_d *dev)
|
||||
{
|
||||
return mc_probe(dev, MC34708_MODE_SPI);
|
||||
}
|
||||
|
||||
static struct driver_d mc_i2c_driver = {
|
||||
.name = "mc34708-i2c",
|
||||
.probe = mc_i2c_probe,
|
||||
};
|
||||
|
||||
static int mc_i2c_init(void)
|
||||
{
|
||||
return register_driver(&mc_i2c_driver);
|
||||
}
|
||||
|
||||
device_initcall(mc_i2c_init);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SPI
|
||||
static int mc_spi_probe(struct device_d *dev)
|
||||
{
|
||||
return mc_probe(dev, MC34708_MODE_SPI);
|
||||
}
|
||||
|
||||
static struct driver_d mc_spi_driver = {
|
||||
.name = "mc34708-spi",
|
||||
.probe = mc_spi_probe,
|
||||
};
|
||||
|
||||
static int mc_init(void)
|
||||
static int mc_spi_init(void)
|
||||
{
|
||||
register_driver(&mc_i2c_driver);
|
||||
register_driver(&mc_spi_driver);
|
||||
return 0;
|
||||
return register_driver(&mc_spi_driver);
|
||||
}
|
||||
|
||||
device_initcall(mc_init);
|
||||
device_initcall(mc_spi_init);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue