Commit 17b019e3 authored by Bjorn Andersson's avatar Bjorn Andersson Committed by Rob Clark

drm/msm/dp: Use devres for ioremap()

The non-devres version of ioremap is used, which requires manual
cleanup. But the code paths leading here is mixed with other devres
users, so rely on this for ioremap as well to simplify the code.
Reviewed-by: default avatarAbhinav Kumar <abhinavk@codeaurora.org>
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211001174400.981707-3-bjorn.andersson@linaro.orgSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 687825c4
...@@ -32,7 +32,7 @@ static int msm_dss_ioremap(struct platform_device *pdev, ...@@ -32,7 +32,7 @@ static int msm_dss_ioremap(struct platform_device *pdev,
} }
io_data->len = (u32)resource_size(res); io_data->len = (u32)resource_size(res);
io_data->base = ioremap(res->start, io_data->len); io_data->base = devm_ioremap(&pdev->dev, res->start, io_data->len);
if (!io_data->base) { if (!io_data->base) {
DRM_ERROR("%pS->%s: ioremap failed\n", DRM_ERROR("%pS->%s: ioremap failed\n",
__builtin_return_address(0), __func__); __builtin_return_address(0), __func__);
...@@ -42,22 +42,6 @@ static int msm_dss_ioremap(struct platform_device *pdev, ...@@ -42,22 +42,6 @@ static int msm_dss_ioremap(struct platform_device *pdev,
return 0; return 0;
} }
static void msm_dss_iounmap(struct dss_io_data *io_data)
{
if (io_data->base) {
iounmap(io_data->base);
io_data->base = NULL;
}
io_data->len = 0;
}
static void dp_parser_unmap_io_resources(struct dp_parser *parser)
{
struct dp_io *io = &parser->io;
msm_dss_iounmap(&io->dp_controller);
}
static int dp_parser_ctrl_res(struct dp_parser *parser) static int dp_parser_ctrl_res(struct dp_parser *parser)
{ {
int rc = 0; int rc = 0;
...@@ -67,19 +51,14 @@ static int dp_parser_ctrl_res(struct dp_parser *parser) ...@@ -67,19 +51,14 @@ static int dp_parser_ctrl_res(struct dp_parser *parser)
rc = msm_dss_ioremap(pdev, &io->dp_controller); rc = msm_dss_ioremap(pdev, &io->dp_controller);
if (rc) { if (rc) {
DRM_ERROR("unable to remap dp io resources, rc=%d\n", rc); DRM_ERROR("unable to remap dp io resources, rc=%d\n", rc);
goto err; return rc;
} }
io->phy = devm_phy_get(&pdev->dev, "dp"); io->phy = devm_phy_get(&pdev->dev, "dp");
if (IS_ERR(io->phy)) { if (IS_ERR(io->phy))
rc = PTR_ERR(io->phy); return PTR_ERR(io->phy);
goto err;
}
return 0; return 0;
err:
dp_parser_unmap_io_resources(parser);
return rc;
} }
static int dp_parser_misc(struct dp_parser *parser) static int dp_parser_misc(struct dp_parser *parser)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment