Skip to content

Commit 34457e4

Browse files
andy-shevUlf Hansson
authored andcommitted
mmc: sdhci-pltfm: Drop unnecessary error messages in sdhci_pltfm_init()
The devm_platform_ioremap_resource() and platform_get_irq() print the error messages themselves and our "failed" one brings no value and just noise. Refactor code to avoid those noisy error messages. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20231006105803.3374241-1-andriy.shevchenko@linux.intel.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent a30c625 commit 34457e4

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

drivers/mmc/host/sdhci-pltfm.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,21 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
115115
{
116116
struct sdhci_host *host;
117117
void __iomem *ioaddr;
118-
int irq, ret;
118+
int irq;
119119

120120
ioaddr = devm_platform_ioremap_resource(pdev, 0);
121-
if (IS_ERR(ioaddr)) {
122-
ret = PTR_ERR(ioaddr);
123-
goto err;
124-
}
121+
if (IS_ERR(ioaddr))
122+
return ERR_CAST(ioaddr);
125123

126124
irq = platform_get_irq(pdev, 0);
127-
if (irq < 0) {
128-
ret = irq;
129-
goto err;
130-
}
125+
if (irq < 0)
126+
return ERR_PTR(irq);
131127

132128
host = sdhci_alloc_host(&pdev->dev,
133129
sizeof(struct sdhci_pltfm_host) + priv_size);
134-
135130
if (IS_ERR(host)) {
136-
ret = PTR_ERR(host);
137-
goto err;
131+
dev_err(&pdev->dev, "%s failed %pe\n", __func__, host);
132+
return ERR_CAST(host);
138133
}
139134

140135
host->ioaddr = ioaddr;
@@ -152,9 +147,6 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
152147
platform_set_drvdata(pdev, host);
153148

154149
return host;
155-
err:
156-
dev_err(&pdev->dev, "%s failed %d\n", __func__, ret);
157-
return ERR_PTR(ret);
158150
}
159151
EXPORT_SYMBOL_GPL(sdhci_pltfm_init);
160152

0 commit comments

Comments
 (0)