Skip to content

Commit 62a35e8

Browse files
anholtrobclark
authored andcommitted
drm/msm: Quiet error during failure in optional resource mappings.
We don't expect to find vbif_nrt or regdma on sdm845, but were clogging up dmesg with errors about it. Signed-off-by: Eric Anholt <[email protected]> Reported-by: kernel test robot <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent ecf9cd4 commit 62a35e8

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,13 +839,13 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
839839
dpu_kms->vbif[VBIF_RT] = NULL;
840840
goto error;
841841
}
842-
dpu_kms->vbif[VBIF_NRT] = msm_ioremap(dpu_kms->pdev, "vbif_nrt", "vbif_nrt");
842+
dpu_kms->vbif[VBIF_NRT] = msm_ioremap_quiet(dpu_kms->pdev, "vbif_nrt", "vbif_nrt");
843843
if (IS_ERR(dpu_kms->vbif[VBIF_NRT])) {
844844
dpu_kms->vbif[VBIF_NRT] = NULL;
845845
DPU_DEBUG("VBIF NRT is not defined");
846846
}
847847

848-
dpu_kms->reg_dma = msm_ioremap(dpu_kms->pdev, "regdma", "regdma");
848+
dpu_kms->reg_dma = msm_ioremap_quiet(dpu_kms->pdev, "regdma", "regdma");
849849
if (IS_ERR(dpu_kms->reg_dma)) {
850850
dpu_kms->reg_dma = NULL;
851851
DPU_DEBUG("REG_DMA is not defined");

drivers/gpu/drm/msm/msm_drv.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ struct clk *msm_clk_get(struct platform_device *pdev, const char *name)
120120
return clk;
121121
}
122122

123-
void __iomem *msm_ioremap(struct platform_device *pdev, const char *name,
124-
const char *dbgname)
123+
void __iomem *_msm_ioremap(struct platform_device *pdev, const char *name,
124+
const char *dbgname, bool quiet)
125125
{
126126
struct resource *res;
127127
unsigned long size;
@@ -133,15 +133,17 @@ void __iomem *msm_ioremap(struct platform_device *pdev, const char *name,
133133
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
134134

135135
if (!res) {
136-
DRM_DEV_ERROR(&pdev->dev, "failed to get memory resource: %s\n", name);
136+
if (!quiet)
137+
DRM_DEV_ERROR(&pdev->dev, "failed to get memory resource: %s\n", name);
137138
return ERR_PTR(-EINVAL);
138139
}
139140

140141
size = resource_size(res);
141142

142143
ptr = devm_ioremap(&pdev->dev, res->start, size);
143144
if (!ptr) {
144-
DRM_DEV_ERROR(&pdev->dev, "failed to ioremap: %s\n", name);
145+
if (!quiet)
146+
DRM_DEV_ERROR(&pdev->dev, "failed to ioremap: %s\n", name);
145147
return ERR_PTR(-ENOMEM);
146148
}
147149

@@ -151,6 +153,18 @@ void __iomem *msm_ioremap(struct platform_device *pdev, const char *name,
151153
return ptr;
152154
}
153155

156+
void __iomem *msm_ioremap(struct platform_device *pdev, const char *name,
157+
const char *dbgname)
158+
{
159+
return _msm_ioremap(pdev, name, dbgname, false);
160+
}
161+
162+
void __iomem *msm_ioremap_quiet(struct platform_device *pdev, const char *name,
163+
const char *dbgname)
164+
{
165+
return _msm_ioremap(pdev, name, dbgname, true);
166+
}
167+
154168
void msm_writel(u32 data, void __iomem *addr)
155169
{
156170
if (reglog)

drivers/gpu/drm/msm/msm_drv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,8 @@ struct clk *msm_clk_bulk_get_clock(struct clk_bulk_data *bulk, int count,
411411
const char *name);
412412
void __iomem *msm_ioremap(struct platform_device *pdev, const char *name,
413413
const char *dbgname);
414+
void __iomem *msm_ioremap_quiet(struct platform_device *pdev, const char *name,
415+
const char *dbgname);
414416
void msm_writel(u32 data, void __iomem *addr);
415417
u32 msm_readl(const void __iomem *addr);
416418

0 commit comments

Comments
 (0)