Skip to content

Commit f955c8b

Browse files
committed
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap into regulator-next
2 parents ed4bf4f + e8b15c0 commit f955c8b

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎drivers/base/regmap/regmap.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,19 @@ struct regmap *dev_get_regmap(struct device *dev, const char *name)
10731073
}
10741074
EXPORT_SYMBOL_GPL(dev_get_regmap);
10751075

1076+
/**
1077+
* regmap_get_device(): Obtain the device from a regmap
1078+
*
1079+
* @map: Register map to operate on.
1080+
*
1081+
* Returns the underlying device that the regmap has been created for.
1082+
*/
1083+
struct device *regmap_get_device(struct regmap *map)
1084+
{
1085+
return map->dev;
1086+
}
1087+
EXPORT_SYMBOL_GPL(regmap_get_device);
1088+
10761089
static int _regmap_select_page(struct regmap *map, unsigned int *reg,
10771090
struct regmap_range_node *range,
10781091
unsigned int val_num)

‎include/linux/regmap.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ void regmap_exit(struct regmap *map);
396396
int regmap_reinit_cache(struct regmap *map,
397397
const struct regmap_config *config);
398398
struct regmap *dev_get_regmap(struct device *dev, const char *name);
399+
struct device *regmap_get_device(struct regmap *map);
399400
int regmap_write(struct regmap *map, unsigned int reg, unsigned int val);
400401
int regmap_write_async(struct regmap *map, unsigned int reg, unsigned int val);
401402
int regmap_raw_write(struct regmap *map, unsigned int reg,
@@ -729,6 +730,12 @@ static inline struct regmap *dev_get_regmap(struct device *dev,
729730
return NULL;
730731
}
731732

733+
static inline struct device *regmap_get_device(struct regmap *map)
734+
{
735+
WARN_ONCE(1, "regmap API is disabled");
736+
return NULL;
737+
}
738+
732739
#endif
733740

734741
#endif

0 commit comments

Comments
 (0)