Commit c24c2dcf authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k update (part 33)

M68k parport updates
 - Remove workaround code for parport bug (parport without FIFO)
 - ->dma_buf is used in FIFO mode only
 - Add missing prototype for parport_atari_init()
 - Initialize uninitialized variable
parent f19c666a
...@@ -162,42 +162,6 @@ static void q40_get_model(char *model) ...@@ -162,42 +162,6 @@ static void q40_get_model(char *model)
sprintf(model, "Q40"); sprintf(model, "Q40");
} }
/* pasted code to make parport_pc happy */
extern __inline__ int __get_order(unsigned long size)
{
int order;
size = (size-1) >> (PAGE_SHIFT-1);
order = -1;
do {
size >>= 1;
order++;
} while (size);
return order;
}
void *pci_alloc_consistent(void *hwdev, size_t size,
dma_addr_t *dma_handle)
{
void *ret;
int gfp = GFP_ATOMIC;
ret = (void *)__get_free_pages(gfp, __get_order(size));
if (ret != NULL) {
memset(ret, 0, size);
*dma_handle = virt_to_bus(ret);
}
return ret;
}
void pci_free_consistent(void *hwdev, size_t size,
void *vaddr, dma_addr_t dma_handle)
{
free_pages((unsigned long)vaddr, __get_order(size));
}
/* end pasted code */
/* No hardware options on Q40? */ /* No hardware options on Q40? */
static int q40_get_hardware_list(char *buffer) static int q40_get_hardware_list(char *buffer)
......
...@@ -31,6 +31,7 @@ extern int parport_pc_init(int *io, int *io_hi, int *irq, int *dma); ...@@ -31,6 +31,7 @@ extern int parport_pc_init(int *io, int *io_hi, int *irq, int *dma);
extern int parport_sunbpp_init(void); extern int parport_sunbpp_init(void);
extern int parport_amiga_init(void); extern int parport_amiga_init(void);
extern int parport_mfc3_init(void); extern int parport_mfc3_init(void);
extern int parport_atari_init(void);
static int parport_setup_ptr __initdata = 0; static int parport_setup_ptr __initdata = 0;
......
...@@ -332,7 +332,7 @@ static struct parport_operations pp_mfc3_ops = { ...@@ -332,7 +332,7 @@ static struct parport_operations pp_mfc3_ops = {
int __init parport_mfc3_init(void) int __init parport_mfc3_init(void)
{ {
struct parport *p; struct parport *p;
int pias; int pias = 0;
struct pia *pp; struct pia *pp;
struct zorro_dev *z = NULL; struct zorro_dev *z = NULL;
......
...@@ -2406,7 +2406,9 @@ struct parport *parport_pc_probe_port (unsigned long int base, ...@@ -2406,7 +2406,9 @@ struct parport *parport_pc_probe_port (unsigned long int base,
void parport_pc_unregister_port (struct parport *p) void parport_pc_unregister_port (struct parport *p)
{ {
#ifdef CONFIG_PARPORT_PC_FIFO
struct parport_pc_private *priv = p->private_data; struct parport_pc_private *priv = p->private_data;
#endif /* CONFIG_PARPORT_PC_FIFO */
struct parport_operations *ops = p->ops; struct parport_operations *ops = p->ops;
if (p->dma != PARPORT_DMA_NONE) if (p->dma != PARPORT_DMA_NONE)
free_dma(p->dma); free_dma(p->dma);
...@@ -2418,10 +2420,12 @@ void parport_pc_unregister_port (struct parport *p) ...@@ -2418,10 +2420,12 @@ void parport_pc_unregister_port (struct parport *p)
if (p->modes & PARPORT_MODE_ECP) if (p->modes & PARPORT_MODE_ECP)
release_region(p->base_hi, 3); release_region(p->base_hi, 3);
parport_proc_unregister(p); parport_proc_unregister(p);
#ifdef CONFIG_PARPORT_PC_FIFO
if (priv->dma_buf) if (priv->dma_buf)
pci_free_consistent(priv->dev, PAGE_SIZE, pci_free_consistent(priv->dev, PAGE_SIZE,
priv->dma_buf, priv->dma_buf,
priv->dma_handle); priv->dma_handle);
#endif /* CONFIG_PARPORT_PC_FIFO */
kfree (p->private_data); kfree (p->private_data);
parport_unregister_port(p); parport_unregister_port(p);
kfree (ops); /* hope no-one cached it */ kfree (ops); /* hope no-one cached it */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment