hwspinlock/core: simplify 'owner' handling
[firefly-linux-kernel-4.4.55.git] / drivers / hwspinlock / hwspinlock_core.c
index 43a62714b4fba1d4799df6166caf27031082cf00..af5175c5d5f420f18613f9f2d532f3cdcdbfc7dc 100644 (file)
@@ -352,7 +352,7 @@ static int __hwspin_lock_request(struct hwspinlock *hwlock)
        int ret;
 
        /* prevent underlying implementation from being removed */
-       if (!try_module_get(hwlock->owner)) {
+       if (!try_module_get(hwlock->dev->driver->owner)) {
                dev_err(hwlock->dev, "%s: can't get owner\n", __func__);
                return -EINVAL;
        }
@@ -535,7 +535,7 @@ int hwspin_lock_free(struct hwspinlock *hwlock)
        /* sanity check (this shouldn't happen) */
        WARN_ON(tmp != hwlock);
 
-       module_put(hwlock->owner);
+       module_put(hwlock->dev->driver->owner);
 
 out:
        spin_unlock(&hwspinlock_tree_lock);