]> git.baikalelectronics.ru Git - kernel.git/commitdiff
regulator: fan53880: Add support for COMPILE_TEST
authorChristoph Fritz <chf.fritz@googlemail.com>
Tue, 7 Jul 2020 10:57:31 +0000 (12:57 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 7 Jul 2020 12:50:46 +0000 (13:50 +0100)
This patch adds support for COMPILE_TEST while fixing a warning when
no support for device tree is there.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Link: https://lore.kernel.org/r/1c437154873ace65ff738a0ebca511308f1cecc1.camel@googlemail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/Kconfig
drivers/regulator/fan53880.c

index 8f9bef574af29816a54bd5a742ef94775045033b..64dc71c1e3d753de6fa987cdb312c02a13d96b3d 100644 (file)
@@ -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
index 575d289b8e041a106c87d2ae82ba8faa33611885..e83eb4fb1876a04cfcf7523c3f3f37a2ff32664e 100644 (file)
@@ -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", },