diff --git a/drivers/base/regmap/Kconfig b/drivers/base/regmap/Kconfig
index 8cd2ac650b50551bf716b8d9fd699bbec6d5b42f..46b459d4449727f4599ff8a5a2348e4280f91927 100644
--- a/drivers/base/regmap/Kconfig
+++ b/drivers/base/regmap/Kconfig
@@ -4,9 +4,8 @@
 # subsystems should select the appropriate symbols.
 
 config REGMAP
-	default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ)
 	select IRQ_DOMAIN if REGMAP_IRQ
-	bool
+	tristate
 
 config REGCACHE_COMPRESSED
 	select LZO_COMPRESS
@@ -18,6 +17,7 @@ config REGMAP_AC97
 
 config REGMAP_I2C
 	tristate
+	select REGMAP
 	depends on I2C
 
 config REGMAP_SLIMBUS
@@ -26,20 +26,26 @@ config REGMAP_SLIMBUS
 
 config REGMAP_SPI
 	tristate
+	select REGMAP
+	depends on SPI_MASTER
 	depends on SPI
 
 config REGMAP_SPMI
+	select REGMAP
 	tristate
 	depends on SPMI
 
 config REGMAP_W1
+	select REGMAP
 	tristate
 	depends on W1
 
 config REGMAP_MMIO
 	tristate
+	select REGMAP
 
 config REGMAP_IRQ
+	select REGMAP
 	bool
 
 config REGMAP_SOUNDWIRE
diff --git a/drivers/base/regmap/Makefile b/drivers/base/regmap/Makefile
index f5b4e8851d00d7f470ffa0e92396505f124d348b..8126487cc2edc491b4d6623bd9e00f378e324636 100644
--- a/drivers/base/regmap/Makefile
+++ b/drivers/base/regmap/Makefile
@@ -2,10 +2,14 @@
 # For include/trace/define_trace.h to include trace.h
 CFLAGS_regmap.o := -I$(src)
 
-obj-$(CONFIG_REGMAP) += regmap.o regcache.o
-obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-flat.o
-obj-$(CONFIG_REGCACHE_COMPRESSED) += regcache-lzo.o
-obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o
+regmap-core-objs = regmap.o regcache.o regcache-rbtree.o regcache-flat.o
+ifdef CONFIG_DEBUG_FS
+regmap-core-objs += regmap-debugfs.o
+endif
+ifdef CONFIG_REGCACHE_COMPRESSED
+regmap-core-objs += regcache-lzo.o
+endif
+obj-$(CONFIG_REGMAP) += regmap-core.o
 obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o
 obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o
 obj-$(CONFIG_REGMAP_SLIMBUS) += regmap-slimbus.o
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index e8b3353c18eb850572efa3d233d1b67038926e88..a03c42c05f730cb8a40e23d873fe851f3dad09c4 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -13,6 +13,7 @@
 #include <linux/device.h>
 #include <linux/slab.h>
 #include <linux/export.h>
+#include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/err.h>
 #include <linux/of.h>
@@ -3032,3 +3033,5 @@ static int __init regmap_initcall(void)
 	return 0;
 }
 postcore_initcall(regmap_initcall);
+
+MODULE_LICENSE("GPL");
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 379505a53722fdeef727edc9c9d6c58cdbef4d4d..e513caeafcd368bd5fc3dad6c7223609b67895af 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -187,7 +187,7 @@ struct reg_sequence {
 	pollret ?: ((cond) ? 0 : -ETIMEDOUT); \
 })
 
-#ifdef CONFIG_REGMAP
+#if IS_REACHABLE(CONFIG_REGMAP)
 
 enum regmap_endian {
 	/* Unspecified -> 0 -> Backwards compatible default */