[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190614203717.75479-3-swboyd@chromium.org>
Date: Fri, 14 Jun 2019 13:37:14 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Dan Williams <dan.j.williams@...el.com>
Cc: linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
Evan Green <evgreen@...omium.org>,
Rob Herring <robh+dt@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Andy Gross <agross@...nel.org>,
Will Deacon <will.deacon@....com>,
Catalin Marinas <catalin.marinas@....com>
Subject: [PATCH v2 2/5] soc: qcom: cmd-db: Migrate to devm_memremap_reserved_mem()
This gets rid of some duplicate code, and also makes the reserved memory
region show up as 'cmd-db' memory in /proc/iomem.
Cc: Evan Green <evgreen@...omium.org>
Cc: Rob Herring <robh+dt@...nel.org>
Cc: Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: Andy Gross <agross@...nel.org>
Cc: Will Deacon <will.deacon@....com>
Cc: Catalin Marinas <catalin.marinas@....com>
Cc: Dan Williams <dan.j.williams@...el.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.org>
Signed-off-by: Stephen Boyd <swboyd@...omium.org>
---
drivers/soc/qcom/cmd-db.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/soc/qcom/cmd-db.c b/drivers/soc/qcom/cmd-db.c
index f6c3d17b05c7..10a34d26b753 100644
--- a/drivers/soc/qcom/cmd-db.c
+++ b/drivers/soc/qcom/cmd-db.c
@@ -238,18 +238,11 @@ EXPORT_SYMBOL(cmd_db_read_slave_id);
static int cmd_db_dev_probe(struct platform_device *pdev)
{
- struct reserved_mem *rmem;
int ret = 0;
- rmem = of_reserved_mem_lookup(pdev->dev.of_node);
- if (!rmem) {
- dev_err(&pdev->dev, "failed to acquire memory region\n");
- return -EINVAL;
- }
-
- cmd_db_header = memremap(rmem->base, rmem->size, MEMREMAP_WB);
- if (!cmd_db_header) {
- ret = -ENOMEM;
+ cmd_db_header = devm_memremap_reserved_mem(&pdev->dev, MEMREMAP_WB);
+ if (IS_ERR(cmd_db_header)) {
+ ret = PTR_ERR(cmd_db_header);
cmd_db_header = NULL;
return ret;
}
--
Sent by a computer through tubes
Powered by blists - more mailing lists