From 59b3d38a3691396783df108e6afbba30656edccb Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 28 Apr 2014 16:11:01 +0300 Subject: [PATCH] OMAPDSS: HDMI: cleanup ioremaps Now that all the boards using OMAP HDMI are using DT boot, we can remove the hacks for getting the ioresources with non-DT boot. Signed-off-by: Tomi Valkeinen --- drivers/video/fbdev/omap2/dss/hdmi4_core.c | 21 +++------------------ drivers/video/fbdev/omap2/dss/hdmi5_core.c | 2 +- drivers/video/fbdev/omap2/dss/hdmi_phy.c | 21 +++------------------ drivers/video/fbdev/omap2/dss/hdmi_pll.c | 21 +++------------------ 4 files changed, 10 insertions(+), 55 deletions(-) diff --git a/drivers/video/fbdev/omap2/dss/hdmi4_core.c b/drivers/video/fbdev/omap2/dss/hdmi4_core.c index 2eb04dcf807c..f02e9541bd6b 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi4_core.c +++ b/drivers/video/fbdev/omap2/dss/hdmi4_core.c @@ -1004,29 +1004,14 @@ int hdmi4_audio_get_dma_port(u32 *offset, u32 *size) int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core) { struct resource *res; - struct resource temp_res; res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core"); if (!res) { - DSSDBG("can't get CORE mem resource by name\n"); - /* - * if hwmod/DT doesn't have the memory resource information - * split into HDMI sub blocks by name, we try again by getting - * the platform's first resource. this code will be removed when - * the driver can get the mem resources by name - */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - DSSERR("can't get CORE mem resource\n"); - return -EINVAL; - } - - temp_res.start = res->start + CORE_OFFSET; - temp_res.end = temp_res.start + CORE_SIZE - 1; - res = &temp_res; + DSSERR("can't get CORE mem resource\n"); + return -EINVAL; } - core->base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + core->base = devm_ioremap_resource(&pdev->dev, res); if (!core->base) { DSSERR("can't ioremap CORE\n"); return -ENOMEM; diff --git a/drivers/video/fbdev/omap2/dss/hdmi5_core.c b/drivers/video/fbdev/omap2/dss/hdmi5_core.c index 270ebdd803d8..18041b71418d 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi5_core.c +++ b/drivers/video/fbdev/omap2/dss/hdmi5_core.c @@ -912,7 +912,7 @@ int hdmi5_core_init(struct platform_device *pdev, struct hdmi_core_data *core) return -EINVAL; } - core->base = devm_request_and_ioremap(&pdev->dev, res); + core->base = devm_ioremap_resource(&pdev->dev, res); if (!core->base) { DSSERR("can't ioremap HDMI core\n"); return -ENOMEM; diff --git a/drivers/video/fbdev/omap2/dss/hdmi_phy.c b/drivers/video/fbdev/omap2/dss/hdmi_phy.c index 2614cf9dafb0..730641c076de 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi_phy.c +++ b/drivers/video/fbdev/omap2/dss/hdmi_phy.c @@ -237,7 +237,6 @@ int hdmi_phy_init(struct platform_device *pdev, struct hdmi_phy_data *phy) { int r; struct resource *res; - struct resource temp_res; r = hdmi_phy_init_features(pdev); if (r) @@ -245,25 +244,11 @@ int hdmi_phy_init(struct platform_device *pdev, struct hdmi_phy_data *phy) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy"); if (!res) { - DSSDBG("can't get PHY mem resource by name\n"); - /* - * if hwmod/DT doesn't have the memory resource information - * split into HDMI sub blocks by name, we try again by getting - * the platform's first resource. this code will be removed when - * the driver can get the mem resources by name - */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - DSSERR("can't get PHY mem resource\n"); - return -EINVAL; - } - - temp_res.start = res->start + PHY_OFFSET; - temp_res.end = temp_res.start + PHY_SIZE - 1; - res = &temp_res; + DSSERR("can't get PHY mem resource\n"); + return -EINVAL; } - phy->base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + phy->base = devm_ioremap_resource(&pdev->dev, res); if (!phy->base) { DSSERR("can't ioremap TX PHY\n"); return -ENOMEM; diff --git a/drivers/video/fbdev/omap2/dss/hdmi_pll.c b/drivers/video/fbdev/omap2/dss/hdmi_pll.c index 2b910cb9eee4..668c095c5552 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi_pll.c +++ b/drivers/video/fbdev/omap2/dss/hdmi_pll.c @@ -273,7 +273,6 @@ int hdmi_pll_init(struct platform_device *pdev, struct hdmi_pll_data *pll) { int r; struct resource *res; - struct resource temp_res; r = hdmi_pll_init_features(pdev); if (r) @@ -281,25 +280,11 @@ int hdmi_pll_init(struct platform_device *pdev, struct hdmi_pll_data *pll) res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pll"); if (!res) { - DSSDBG("can't get PLL mem resource by name\n"); - /* - * if hwmod/DT doesn't have the memory resource information - * split into HDMI sub blocks by name, we try again by getting - * the platform's first resource. this code will be removed when - * the driver can get the mem resources by name - */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - DSSERR("can't get PLL mem resource\n"); - return -EINVAL; - } - - temp_res.start = res->start + PLL_OFFSET; - temp_res.end = temp_res.start + PLL_SIZE - 1; - res = &temp_res; + DSSERR("can't get PLL mem resource\n"); + return -EINVAL; } - pll->base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + pll->base = devm_ioremap_resource(&pdev->dev, res); if (!pll->base) { DSSERR("can't ioremap PLLCTRL\n"); return -ENOMEM;