diff options
author | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-04-03 20:21:20 +0200 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-04-12 12:44:57 +0200 |
commit | 8a2118e1b44fd2f385d621683927fdf3ae713379 (patch) | |
tree | ed0a4b676433e5094cd4a97a93a087beecdea576 /target/linux/bcm63xx/patches-5.4 | |
parent | 43d3ef91f14ea2353cbc7b6d7271a496017c6bc2 (diff) | |
download | upstream-8a2118e1b44fd2f385d621683927fdf3ae713379.tar.gz upstream-8a2118e1b44fd2f385d621683927fdf3ae713379.tar.bz2 upstream-8a2118e1b44fd2f385d621683927fdf3ae713379.zip |
bcm63xx: 5.4: add removed helper syscon_regmap_lookup_by_pdevname
The helper syscon_regmap_lookup_by_pdevname has been removed in kernel patch
29d14b668d2f ("mfd: Remove unused helper syscon_regmap_lookup_by_pdevname")
due to lack of users.
However, we use this function in our local pinctrl drivers for BCM6358 and
BCM6368. Thus, we have to add it locally.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/bcm63xx/patches-5.4')
-rw-r--r-- | target/linux/bcm63xx/patches-5.4/144-add-removed-syscon_regmap_lookup_by_pdevname.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/target/linux/bcm63xx/patches-5.4/144-add-removed-syscon_regmap_lookup_by_pdevname.patch b/target/linux/bcm63xx/patches-5.4/144-add-removed-syscon_regmap_lookup_by_pdevname.patch new file mode 100644 index 0000000000..ef246fafd4 --- /dev/null +++ b/target/linux/bcm63xx/patches-5.4/144-add-removed-syscon_regmap_lookup_by_pdevname.patch @@ -0,0 +1,64 @@ +From: Adrian Schmutzler <freifunk@adrianschmutzler.de> +Date: Fri, 03 Apr 2020 19:50:03 +0200 +Subject: add removed helper syscon_regmap_lookup_by_pdevname + +The helper syscon_regmap_lookup_by_pdevname has been removed in 29d14b668d2f +("mfd: Remove unused helper syscon_regmap_lookup_by_pdevname") due to lack +of users. + +Thus, we have to maintain it locally. + +Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> + +--- a/drivers/mfd/syscon.c ++++ b/drivers/mfd/syscon.c +@@ -204,6 +204,27 @@ struct regmap *syscon_regmap_lookup_by_c + } + EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_compatible); + ++static int syscon_match_pdevname(struct device *dev, void *data) ++{ ++ return !strcmp(dev_name(dev), (const char *)data); ++} ++ ++struct regmap *syscon_regmap_lookup_by_pdevname(const char *s) ++{ ++ struct device *dev; ++ struct syscon *syscon; ++ ++ dev = driver_find_device(&syscon_driver.driver, NULL, (void *)s, ++ syscon_match_pdevname); ++ if (!dev) ++ return ERR_PTR(-EPROBE_DEFER); ++ ++ syscon = dev_get_drvdata(dev); ++ ++ return syscon->regmap; ++} ++EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_pdevname); ++ + struct regmap *syscon_regmap_lookup_by_phandle(struct device_node *np, + const char *property) + { +--- a/include/linux/mfd/syscon.h ++++ b/include/linux/mfd/syscon.h +@@ -20,6 +20,7 @@ struct device_node; + extern struct regmap *device_node_to_regmap(struct device_node *np); + extern struct regmap *syscon_node_to_regmap(struct device_node *np); + extern struct regmap *syscon_regmap_lookup_by_compatible(const char *s); ++extern struct regmap *syscon_regmap_lookup_by_pdevname(const char *s); + extern struct regmap *syscon_regmap_lookup_by_phandle( + struct device_node *np, + const char *property); +@@ -38,6 +39,11 @@ static inline struct regmap *syscon_regm + { + return ERR_PTR(-ENOTSUPP); + } ++ ++static inline struct regmap *syscon_regmap_lookup_by_pdevname(const char *s) ++{ ++ return ERR_PTR(-ENOTSUPP); ++} + + static inline struct regmap *syscon_regmap_lookup_by_phandle( + struct device_node *np, |