hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/mmc/host/cavium-octeon.c
....@@ -148,7 +148,6 @@
148148 {
149149 struct device_node *cn, *node = pdev->dev.of_node;
150150 struct cvm_mmc_host *host;
151
- struct resource *res;
152151 void __iomem *base;
153152 int mmc_irq[9];
154153 int i, ret = 0;
....@@ -205,26 +204,16 @@
205204
206205 host->last_slot = -1;
207206
208
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
209
- if (!res) {
210
- dev_err(&pdev->dev, "Platform resource[0] is missing\n");
211
- return -ENXIO;
212
- }
213
- base = devm_ioremap_resource(&pdev->dev, res);
207
+ base = devm_platform_ioremap_resource(pdev, 0);
214208 if (IS_ERR(base))
215209 return PTR_ERR(base);
216
- host->base = (void __iomem *)base;
210
+ host->base = base;
217211 host->reg_off = 0;
218212
219
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
220
- if (!res) {
221
- dev_err(&pdev->dev, "Platform resource[1] is missing\n");
222
- return -EINVAL;
223
- }
224
- base = devm_ioremap_resource(&pdev->dev, res);
213
+ base = devm_platform_ioremap_resource(pdev, 1);
225214 if (IS_ERR(base))
226215 return PTR_ERR(base);
227
- host->dma_base = (void __iomem *)base;
216
+ host->dma_base = base;
228217 /*
229218 * To keep the register addresses shared we intentionaly use
230219 * a negative offset here, first register used on Octeon therefore
....@@ -288,6 +277,7 @@
288277 if (ret) {
289278 dev_err(&pdev->dev, "Error populating slots\n");
290279 octeon_mmc_set_shared_power(host, 0);
280
+ of_node_put(cn);
291281 goto error;
292282 }
293283 i++;
....@@ -338,6 +328,7 @@
338328 .remove = octeon_mmc_remove,
339329 .driver = {
340330 .name = KBUILD_MODNAME,
331
+ .probe_type = PROBE_PREFER_ASYNCHRONOUS,
341332 .of_match_table = octeon_mmc_match,
342333 },
343334 };