hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/scsi/sun3x_esp.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* sun3x_esp.c: ESP front-end for Sun3x systems.
23 *
34 * Copyright (C) 2007,2008 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
....@@ -58,30 +59,6 @@
5859 static u8 sun3x_esp_read8(struct esp *esp, unsigned long reg)
5960 {
6061 return readb(esp->regs + (reg * 4UL));
61
-}
62
-
63
-static dma_addr_t sun3x_esp_map_single(struct esp *esp, void *buf,
64
- size_t sz, int dir)
65
-{
66
- return dma_map_single(esp->dev, buf, sz, dir);
67
-}
68
-
69
-static int sun3x_esp_map_sg(struct esp *esp, struct scatterlist *sg,
70
- int num_sg, int dir)
71
-{
72
- return dma_map_sg(esp->dev, sg, num_sg, dir);
73
-}
74
-
75
-static void sun3x_esp_unmap_single(struct esp *esp, dma_addr_t addr,
76
- size_t sz, int dir)
77
-{
78
- dma_unmap_single(esp->dev, addr, sz, dir);
79
-}
80
-
81
-static void sun3x_esp_unmap_sg(struct esp *esp, struct scatterlist *sg,
82
- int num_sg, int dir)
83
-{
84
- dma_unmap_sg(esp->dev, sg, num_sg, dir);
8562 }
8663
8764 static int sun3x_esp_irq_pending(struct esp *esp)
....@@ -182,10 +159,6 @@
182159 static const struct esp_driver_ops sun3x_esp_ops = {
183160 .esp_write8 = sun3x_esp_write8,
184161 .esp_read8 = sun3x_esp_read8,
185
- .map_single = sun3x_esp_map_single,
186
- .map_sg = sun3x_esp_map_sg,
187
- .unmap_single = sun3x_esp_unmap_single,
188
- .unmap_sg = sun3x_esp_unmap_sg,
189162 .irq_pending = sun3x_esp_irq_pending,
190163 .reset_dma = sun3x_esp_reset_dma,
191164 .dma_drain = sun3x_esp_dma_drain,
....@@ -217,7 +190,7 @@
217190 if (!res || !res->start)
218191 goto fail_unlink;
219192
220
- esp->regs = ioremap_nocache(res->start, 0x20);
193
+ esp->regs = ioremap(res->start, 0x20);
221194 if (!esp->regs)
222195 goto fail_unmap_regs;
223196
....@@ -225,7 +198,7 @@
225198 if (!res || !res->start)
226199 goto fail_unmap_regs;
227200
228
- esp->dma_regs = ioremap_nocache(res->start, 0x10);
201
+ esp->dma_regs = ioremap(res->start, 0x10);
229202
230203 esp->command_block = dma_alloc_coherent(esp->dev, 16,
231204 &esp->command_block_dma,
....@@ -248,7 +221,7 @@
248221
249222 dev_set_drvdata(&dev->dev, esp);
250223
251
- err = scsi_esp_register(esp, &dev->dev);
224
+ err = scsi_esp_register(esp);
252225 if (err)
253226 goto fail_free_irq;
254227
....@@ -299,22 +272,10 @@
299272 .name = "sun3x_esp",
300273 },
301274 };
302
-
303
-static int __init sun3x_esp_init(void)
304
-{
305
- return platform_driver_register(&esp_sun3x_driver);
306
-}
307
-
308
-static void __exit sun3x_esp_exit(void)
309
-{
310
- platform_driver_unregister(&esp_sun3x_driver);
311
-}
275
+module_platform_driver(esp_sun3x_driver);
312276
313277 MODULE_DESCRIPTION("Sun3x ESP SCSI driver");
314278 MODULE_AUTHOR("Thomas Bogendoerfer (tsbogend@alpha.franken.de)");
315279 MODULE_LICENSE("GPL");
316280 MODULE_VERSION(DRV_VERSION);
317
-
318
-module_init(sun3x_esp_init);
319
-module_exit(sun3x_esp_exit);
320281 MODULE_ALIAS("platform:sun3x_esp");