Skip to content

Commit 2e1b1d7

Browse files
arndbhdeller
authored andcommitted
parport: gsc: remove DMA leftover code
This driver does not actually work with DMA mode, but still tries to call ISA DMA interface functions that are stubbed out on parisc, resulting in a W=1 build warning: drivers/parport/parport_gsc.c: In function 'parport_remove_chip': drivers/parport/parport_gsc.c:389:20: warning: suggest braces around empty body in an 'if' statement [-Wempty-body] 389 | free_dma(p->dma); Remove the corresponding code as a prerequisite for turning on -Wempty-body by default in all kernels. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent ce9ff57 commit 2e1b1d7

File tree

2 files changed

+4
-31
lines changed

2 files changed

+4
-31
lines changed

drivers/parport/parport_gsc.c

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <linux/sysctl.h>
2929

3030
#include <asm/io.h>
31-
#include <asm/dma.h>
3231
#include <linux/uaccess.h>
3332
#include <asm/superio.h>
3433

@@ -226,9 +225,9 @@ static int parport_PS2_supported(struct parport *pb)
226225

227226
/* --- Initialisation code -------------------------------- */
228227

229-
struct parport *parport_gsc_probe_port(unsigned long base,
228+
static struct parport *parport_gsc_probe_port(unsigned long base,
230229
unsigned long base_hi, int irq,
231-
int dma, struct parisc_device *padev)
230+
struct parisc_device *padev)
232231
{
233232
struct parport_gsc_private *priv;
234233
struct parport_operations *ops;
@@ -250,12 +249,9 @@ struct parport *parport_gsc_probe_port(unsigned long base,
250249
}
251250
priv->ctr = 0xc;
252251
priv->ctr_writable = 0xff;
253-
priv->dma_buf = NULL;
254-
priv->dma_handle = 0;
255252
p->base = base;
256253
p->base_hi = base_hi;
257254
p->irq = irq;
258-
p->dma = dma;
259255
p->modes = PARPORT_MODE_PCSPP | PARPORT_MODE_SAFEININT;
260256
p->ops = ops;
261257
p->private_data = priv;
@@ -286,17 +282,9 @@ struct parport *parport_gsc_probe_port(unsigned long base,
286282
if (p->irq == PARPORT_IRQ_AUTO) {
287283
p->irq = PARPORT_IRQ_NONE;
288284
}
289-
if (p->irq != PARPORT_IRQ_NONE) {
285+
if (p->irq != PARPORT_IRQ_NONE)
290286
pr_cont(", irq %d", p->irq);
291287

292-
if (p->dma == PARPORT_DMA_AUTO) {
293-
p->dma = PARPORT_DMA_NONE;
294-
}
295-
}
296-
if (p->dma == PARPORT_DMA_AUTO) /* To use DMA, giving the irq
297-
is mandatory (see above) */
298-
p->dma = PARPORT_DMA_NONE;
299-
300288
pr_cont(" [");
301289
#define printmode(x) \
302290
do { \
@@ -321,7 +309,6 @@ do { \
321309
pr_warn("%s: irq %d in use, resorting to polled operation\n",
322310
p->name, p->irq);
323311
p->irq = PARPORT_IRQ_NONE;
324-
p->dma = PARPORT_DMA_NONE;
325312
}
326313
}
327314

@@ -369,8 +356,7 @@ static int __init parport_init_chip(struct parisc_device *dev)
369356
pr_info("%s: enhanced parport-modes not supported\n", __func__);
370357
}
371358

372-
p = parport_gsc_probe_port(port, 0, dev->irq,
373-
/* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, dev);
359+
p = parport_gsc_probe_port(port, 0, dev->irq, dev);
374360
if (p)
375361
parport_count++;
376362
dev_set_drvdata(&dev->dev, p);
@@ -382,16 +368,10 @@ static void __exit parport_remove_chip(struct parisc_device *dev)
382368
{
383369
struct parport *p = dev_get_drvdata(&dev->dev);
384370
if (p) {
385-
struct parport_gsc_private *priv = p->private_data;
386371
struct parport_operations *ops = p->ops;
387372
parport_remove_port(p);
388-
if (p->dma != PARPORT_DMA_NONE)
389-
free_dma(p->dma);
390373
if (p->irq != PARPORT_IRQ_NONE)
391374
free_irq(p->irq, p);
392-
if (priv->dma_buf)
393-
dma_free_coherent(&priv->dev->dev, PAGE_SIZE,
394-
priv->dma_buf, priv->dma_handle);
395375
kfree (p->private_data);
396376
parport_put_port(p);
397377
kfree (ops); /* hope no-one cached it */

drivers/parport/parport_gsc.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ struct parport_gsc_private {
6363
int writeIntrThreshold;
6464

6565
/* buffer suitable for DMA, if DMA enabled */
66-
char *dma_buf;
67-
dma_addr_t dma_handle;
6866
struct pci_dev *dev;
6967
};
7068

@@ -199,9 +197,4 @@ extern void parport_gsc_inc_use_count(void);
199197

200198
extern void parport_gsc_dec_use_count(void);
201199

202-
extern struct parport *parport_gsc_probe_port(unsigned long base,
203-
unsigned long base_hi,
204-
int irq, int dma,
205-
struct parisc_device *padev);
206-
207200
#endif /* __DRIVERS_PARPORT_PARPORT_GSC_H */

0 commit comments

Comments
 (0)