summaryrefslogtreecommitdiffstats
path: root/drivers/hwspinlock/omap_hwspinlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwspinlock/omap_hwspinlock.c')
-rw-r--r--drivers/hwspinlock/omap_hwspinlock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hwspinlock/omap_hwspinlock.c b/drivers/hwspinlock/omap_hwspinlock.c
index d0583480fe33..2044d181e49d 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;