From e467b6421435f467e274d4f25d62900e1e0e4286 Mon Sep 17 00:00:00 2001 From: Ohad Ben-Cohen Date: Mon, 5 Sep 2011 16:42:36 +0300 Subject: hwspinlock/core: simplify 'owner' handling Use struct device_driver's owner member instead of asking drivers to explicitly pass the owner again. This simplifies drivers and also save some memory, since there's no point now in maintaining a separate owner pointer per hwspinlock. Signed-off-by: Ohad Ben-Cohen --- drivers/hwspinlock/hwspinlock_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/hwspinlock/hwspinlock_core.c') diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c index 43a6271..af5175c 100644 --- a/drivers/hwspinlock/hwspinlock_core.c +++ b/drivers/hwspinlock/hwspinlock_core.c @@ -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); -- cgit v1.1