Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'ib-mfd-mediatek-5.11' into ibs-for-mfd-merged

+29
+18
drivers/mfd/syscon.c
··· 255 255 } 256 256 EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_phandle_args); 257 257 258 + /* 259 + * It behaves the same as syscon_regmap_lookup_by_phandle() except where 260 + * there is no regmap phandle. In this case, instead of returning -ENODEV, 261 + * the function returns NULL. 262 + */ 263 + struct regmap *syscon_regmap_lookup_by_phandle_optional(struct device_node *np, 264 + const char *property) 265 + { 266 + struct regmap *regmap; 267 + 268 + regmap = syscon_regmap_lookup_by_phandle(np, property); 269 + if (IS_ERR(regmap) && PTR_ERR(regmap) == -ENODEV) 270 + return NULL; 271 + 272 + return regmap; 273 + } 274 + EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_phandle_optional); 275 + 258 276 static int syscon_probe(struct platform_device *pdev) 259 277 { 260 278 struct device *dev = &pdev->dev;
+11
include/linux/mfd/syscon.h
··· 28 28 const char *property, 29 29 int arg_count, 30 30 unsigned int *out_args); 31 + extern struct regmap *syscon_regmap_lookup_by_phandle_optional( 32 + struct device_node *np, 33 + const char *property); 31 34 #else 32 35 static inline struct regmap *device_node_to_regmap(struct device_node *np) 33 36 { ··· 62 59 { 63 60 return ERR_PTR(-ENOTSUPP); 64 61 } 62 + 63 + static inline struct regmap *syscon_regmap_lookup_by_phandle_optional( 64 + struct device_node *np, 65 + const char *property) 66 + { 67 + return NULL; 68 + } 69 + 65 70 #endif 66 71 67 72 #endif /* __LINUX_MFD_SYSCON_H__ */