diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 8f9bef574af2..64dc71c1e3d7 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -338,7 +338,7 @@ config REGULATOR_FAN53555 config REGULATOR_FAN53880 tristate "Fairchild FAN53880 Regulator" - depends on I2C + depends on I2C && (OF || COMPILE_TEST) select REGMAP_I2C help This driver supports Fairchild (ON Semiconductor) FAN53880 diff --git a/drivers/regulator/fan53880.c b/drivers/regulator/fan53880.c index 575d289b8e04..e83eb4fb1876 100644 --- a/drivers/regulator/fan53880.c +++ b/drivers/regulator/fan53880.c @@ -155,11 +155,13 @@ static int fan53880_i2c_probe(struct i2c_client *i2c, return 0; } +#ifdef CONFIG_OF static const struct of_device_id fan53880_dt_ids[] = { { .compatible = "onnn,fan53880", }, {} }; MODULE_DEVICE_TABLE(of, fan53880_dt_ids); +#endif static const struct i2c_device_id fan53880_i2c_id[] = { { "fan53880", },