]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/base/regmap/regmap-spi.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[mv-sheeva.git] / drivers / base / regmap / regmap-spi.c
index 2560658de344ddee800eaeaf8b506c9728a2715f..7c0c35a39c331afa9e5c5d940e8bf16354aa4a10 100644 (file)
@@ -70,4 +70,21 @@ struct regmap *regmap_init_spi(struct spi_device *spi,
 }
 EXPORT_SYMBOL_GPL(regmap_init_spi);
 
+/**
+ * devm_regmap_init_spi(): Initialise register map
+ *
+ * @spi: Device that will be interacted with
+ * @config: Configuration for register map
+ *
+ * The return value will be an ERR_PTR() on error or a valid pointer
+ * to a struct regmap.  The map will be automatically freed by the
+ * device management code.
+ */
+struct regmap *devm_regmap_init_spi(struct spi_device *spi,
+                                   const struct regmap_config *config)
+{
+       return devm_regmap_init(&spi->dev, &regmap_spi, config);
+}
+EXPORT_SYMBOL_GPL(devm_regmap_init_spi);
+
 MODULE_LICENSE("GPL");