Skip to content

Commit ecf9cd4

Browse files
anholtrobclark
authored andcommitted
drm/msm: Garbage collect unused resource _len fields.
Nothing was using the lengths of these ioremaps. Signed-off-by: Eric Anholt <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent b8afe9f commit ecf9cd4

File tree

3 files changed

+0
-31
lines changed

3 files changed

+0
-31
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,6 @@
4646
static int dpu_kms_hw_init(struct msm_kms *kms);
4747
static void _dpu_kms_mmu_destroy(struct dpu_kms *dpu_kms);
4848

49-
static unsigned long dpu_iomap_size(struct platform_device *pdev,
50-
const char *name)
51-
{
52-
struct resource *res;
53-
54-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
55-
if (!res) {
56-
DRM_ERROR("failed to get memory resource: %s\n", name);
57-
return 0;
58-
}
59-
60-
return resource_size(res);
61-
}
62-
6349
#ifdef CONFIG_DEBUG_FS
6450
static int _dpu_danger_signal_status(struct seq_file *s,
6551
bool danger_status)
@@ -845,7 +831,6 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
845831
goto error;
846832
}
847833
DRM_DEBUG("mapped dpu address space @%pK\n", dpu_kms->mmio);
848-
dpu_kms->mmio_len = dpu_iomap_size(dpu_kms->pdev, "mdp");
849834

850835
dpu_kms->vbif[VBIF_RT] = msm_ioremap(dpu_kms->pdev, "vbif", "vbif");
851836
if (IS_ERR(dpu_kms->vbif[VBIF_RT])) {
@@ -854,22 +839,16 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
854839
dpu_kms->vbif[VBIF_RT] = NULL;
855840
goto error;
856841
}
857-
dpu_kms->vbif_len[VBIF_RT] = dpu_iomap_size(dpu_kms->pdev, "vbif");
858842
dpu_kms->vbif[VBIF_NRT] = msm_ioremap(dpu_kms->pdev, "vbif_nrt", "vbif_nrt");
859843
if (IS_ERR(dpu_kms->vbif[VBIF_NRT])) {
860844
dpu_kms->vbif[VBIF_NRT] = NULL;
861845
DPU_DEBUG("VBIF NRT is not defined");
862-
} else {
863-
dpu_kms->vbif_len[VBIF_NRT] = dpu_iomap_size(dpu_kms->pdev,
864-
"vbif_nrt");
865846
}
866847

867848
dpu_kms->reg_dma = msm_ioremap(dpu_kms->pdev, "regdma", "regdma");
868849
if (IS_ERR(dpu_kms->reg_dma)) {
869850
dpu_kms->reg_dma = NULL;
870851
DPU_DEBUG("REG_DMA is not defined");
871-
} else {
872-
dpu_kms->reg_dma_len = dpu_iomap_size(dpu_kms->pdev, "regdma");
873852
}
874853

875854
pm_runtime_get_sync(&dpu_kms->pdev->dev);

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ struct dpu_kms {
100100

101101
/* io/register spaces: */
102102
void __iomem *mmio, *vbif[VBIF_MAX], *reg_dma;
103-
unsigned long mmio_len, vbif_len[VBIF_MAX], reg_dma_len;
104103

105104
struct regulator *vdd;
106105
struct regulator *mmagic;

drivers/gpu/drm/msm/disp/dpu1/dpu_mdss.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ struct dpu_mdss_hw_init_handler {
3737
struct dpu_mdss {
3838
struct msm_mdss base;
3939
void __iomem *mmio;
40-
unsigned long mmio_len;
4140
struct dss_module_power mp;
4241
struct dpu_irq_controller irq_controller;
4342
struct icc_path *path[2];
@@ -292,7 +291,6 @@ int dpu_mdss_init(struct drm_device *dev)
292291
{
293292
struct platform_device *pdev = to_platform_device(dev->dev);
294293
struct msm_drm_private *priv = dev->dev_private;
295-
struct resource *res;
296294
struct dpu_mdss *dpu_mdss;
297295
struct dss_module_power *mp;
298296
int ret = 0;
@@ -308,13 +306,6 @@ int dpu_mdss_init(struct drm_device *dev)
308306

309307
DRM_DEBUG("mapped mdss address space @%pK\n", dpu_mdss->mmio);
310308

311-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mdss");
312-
if (!res) {
313-
DRM_ERROR("failed to get memory resource for mdss\n");
314-
return -ENOMEM;
315-
}
316-
dpu_mdss->mmio_len = resource_size(res);
317-
318309
ret = dpu_mdss_parse_data_bus_icc_path(dev, dpu_mdss);
319310
if (ret)
320311
return ret;

0 commit comments

Comments
 (0)