From: 21cnbao@gmail.com (Barry Song)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] hwspinlock: sirf: fix the memory base and move to devm_ioremap
Date: Mon, 13 Jul 2015 09:28:49 +0000 [thread overview]
Message-ID: <1436779729-3052-2-git-send-email-21cnbao@gmail.com> (raw)
In-Reply-To: <1436779729-3052-1-git-send-email-21cnbao@gmail.com>
From: Wei Chen <Wei.Chen@csr.com>
this patch moves to the right base since we fix the dts, then
we can use devm_ioremap now.
Cc: Suman Anna <s-anna@ti.com>
Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Wei Chen <Wei.Chen@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
drivers/hwspinlock/sirf_hwspinlock.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/hwspinlock/sirf_hwspinlock.c b/drivers/hwspinlock/sirf_hwspinlock.c
index 1601854..692ac41 100644
--- a/drivers/hwspinlock/sirf_hwspinlock.c
+++ b/drivers/hwspinlock/sirf_hwspinlock.c
@@ -29,7 +29,7 @@ struct sirf_hwspinlock {
#define HW_SPINLOCK_NUMBER 30
/* Hardware spinlock register offsets */
-#define HW_SPINLOCK_BASE 0x404
+#define HW_SPINLOCK_BASE 0x04
#define HW_SPINLOCK_OFFSET(x) (HW_SPINLOCK_BASE + 0x4 * (x))
static int sirf_hwspinlock_trylock(struct hwspinlock *lock)
@@ -57,6 +57,7 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev)
{
struct sirf_hwspinlock *hwspin;
struct hwspinlock *hwlock;
+ struct resource *res;
int idx, ret;
if (!pdev->dev.of_node)
@@ -68,7 +69,8 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev)
return -ENOMEM;
/* retrieve io base */
- hwspin->io_base = of_iomap(pdev->dev.of_node, 0);
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ hwspin->io_base = devm_ioremap_resource(&pdev->dev, res);
if (!hwspin->io_base)
return -ENOMEM;
@@ -91,7 +93,6 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev)
reg_failed:
pm_runtime_disable(&pdev->dev);
- iounmap(hwspin->io_base);
return ret;
}
@@ -109,8 +110,6 @@ static int sirf_hwspinlock_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
- iounmap(hwspin->io_base);
-
return 0;
}
--
2.3.5
prev parent reply other threads:[~2015-07-13 9:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-13 9:28 [PATCH 1/3] ARM: dts: atlas7: set right memory range and hwspinlock for IPC stuff Barry Song
2015-07-13 9:28 ` Barry Song [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436779729-3052-2-git-send-email-21cnbao@gmail.com \
--to=21cnbao@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).