From: Mark Brown Date: Fri, 12 Jan 2018 20:03:57 +0000 (+0000) Subject: Merge remote-tracking branches 'regmap/topic/const', 'regmap/topic/flat', 'regmap... X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=757b65285f366cb8d410333b03a502aab0c3689a;p=openwrt%2Fstaging%2Fblogic.git Merge remote-tracking branches 'regmap/topic/const', 'regmap/topic/flat', 'regmap/topic/hwspinlock' and 'regmap/topic/nolock' into regmap-next --- 757b65285f366cb8d410333b03a502aab0c3689a diff --cc drivers/base/regmap/regmap.c index 9fb3a792642b,84b5784e171b,8d516a9bfc01,d23a5c99b639,df9ca36753ff..be55e5a0e38c --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@@@@@ -457,8 -456,12 -457,8 -456,7 -457,13 +456,12 @@@@@@ static void regmap_unlock_hwlock_irqres hwspin_unlock_irqrestore(map->hwlock, &map->spinlock_flags); } - - -#endif + + + ++ static void regmap_lock_unlock_none(void *__map) + ++ { + ++ + ++ } + static void regmap_lock_mutex(void *__map) { struct regmap *map = __map; @@@@@@ -669,12 -672,22 -669,12 -667,11 -674,15 +672,22 @@@@@@ struct regmap *__regmap_init(struct dev goto err; } - -- if (config->lock && config->unlock) { + +++ if (config->name) { + +++ map->name = kstrdup_const(config->name, GFP_KERNEL); + +++ if (!map->name) { + +++ ret = -ENOMEM; + +++ goto err_map; + +++ } + +++ } + +++ + ++ if (config->disable_locking) { + ++ map->lock = map->unlock = regmap_lock_unlock_none; + ++ regmap_debugfs_disable(map); + ++ } else if (config->lock && config->unlock) { map->lock = config->lock; map->unlock = config->unlock; map->lock_arg = config->lock_arg; --- - } else if (config->hwlock_id) { - - -#ifdef REGMAP_HWSPINLOCK +++ + } else if (config->use_hwlock) { map->hwlock = hwspin_lock_request_specific(config->hwlock_id); if (!map->hwlock) { ret = -ENXIO; @@@@@@ -1116,8 -1124,10 -1116,8 -1109,8 -1124,8 +1124,10 @@@@@@ err_range regmap_range_exit(map); kfree(map->work_buf); err_hwlock: - - - if (IS_ENABLED(REGMAP_HWSPINLOCK) && map->hwlock) + + + if (map->hwlock) hwspin_lock_free(map->hwlock); + +++err_name: + +++ kfree_const(map->name); err_map: kfree(map); err: @@@@@@ -1305,8 -1315,9 -1305,8 -1298,8 -1313,8 +1315,9 @@@@@@ void regmap_exit(struct regmap *map kfree(async->work_buf); kfree(async); } - - - if (IS_ENABLED(REGMAP_HWSPINLOCK) && map->hwlock) + + + if (map->hwlock) hwspin_lock_free(map->hwlock); + +++ kfree_const(map->name); kfree(map); } EXPORT_SYMBOL_GPL(regmap_exit);