aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwspinlock
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwspinlock')
-rw-r--r--drivers/hwspinlock/hwspinlock_core.c2
-rw-r--r--drivers/hwspinlock/omap_hwspinlock.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index af5175c5d5f..4eb85b4a320 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -282,6 +282,8 @@ int hwspin_lock_register(struct hwspinlock *hwlock)
spin_lock(&hwspinlock_tree_lock);
ret = radix_tree_insert(&hwspinlock_tree, hwlock->id, hwlock);
+ if (ret == -EEXIST)
+ pr_err("hwspinlock id %d already exists!\n", hwlock->id);
if (ret)
goto out;
diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
index d0583480fe3..2044d181e49 100644
--- a/drivers/hwspinlock/omap_hwspinlock.c
+++ b/drivers/hwspinlock/omap_hwspinlock.c
@@ -94,12 +94,16 @@ static const struct hwspinlock_ops omap_hwspinlock_ops = {
static int __devinit omap_hwspinlock_probe(struct platform_device *pdev)
{
+ struct hwspinlock_pdata *pdata = pdev->dev.platform_data;
struct omap_hwspinlock *omap_lock;
struct omap_hwspinlock_state *state;
struct resource *res;
void __iomem *io_base;
int i, ret;
+ if (!pdata)
+ return -ENODEV;
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
@@ -141,7 +145,7 @@ static int __devinit omap_hwspinlock_probe(struct platform_device *pdev)
omap_lock = &state->lock[i];
omap_lock->lock.dev = &pdev->dev;
- omap_lock->lock.id = i;
+ omap_lock->lock.id = pdata->base_id + i;
omap_lock->lock.ops = &omap_hwspinlock_ops;
omap_lock->addr = io_base + LOCK_BASE_OFFSET + sizeof(u32) * i;