Merge remote-tracking branches 'regmap/topic/const', 'regmap/topic/flat', 'regmap...
authorMark Brown <broonie@kernel.org>
Fri, 12 Jan 2018 20:03:57 +0000 (20:03 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 12 Jan 2018 20:03:57 +0000 (20:03 +0000)
1  2  3  4  5 
drivers/base/regmap/regmap.c
include/linux/regmap.h

index 9fb3a792642b086c40f2e5d741750b166f4dc207,84b5784e171b4da72966e96bfebde109b4cc8913,8d516a9bfc01722567588523b92e7fdcc2b75339,d23a5c99b639bcd45451dbf9118459cbb60c7819,df9ca36753ffdbddac5d261cfa0b0f44ceaa59ed..be55e5a0e38c0d9406896dadbc96c267c60adda3
@@@@@@ -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);
Simple merge