diff options
Diffstat (limited to 'drivers/parport/parport_sunbpp.c')
| -rw-r--r-- | drivers/parport/parport_sunbpp.c | 56 |
1 files changed, 13 insertions, 43 deletions
diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c index 065f229580d..dffd6d0bd15 100644 --- a/drivers/parport/parport_sunbpp.c +++ b/drivers/parport/parport_sunbpp.c @@ -82,27 +82,6 @@ static unsigned char parport_sunbpp_read_data(struct parport *p) return sbus_readb(®s->p_dr); } -#if 0 -static void control_pc_to_sunbpp(struct parport *p, unsigned char status) -{ - struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; - unsigned char value_tcr = sbus_readb(®s->p_tcr); - unsigned char value_or = sbus_readb(®s->p_or); - - if (status & PARPORT_CONTROL_STROBE) - value_tcr |= P_TCR_DS; - if (status & PARPORT_CONTROL_AUTOFD) - value_or |= P_OR_AFXN; - if (status & PARPORT_CONTROL_INIT) - value_or |= P_OR_INIT; - if (status & PARPORT_CONTROL_SELECT) - value_or |= P_OR_SLCT_IN; - - sbus_writeb(value_or, ®s->p_or); - sbus_writeb(value_tcr, ®s->p_tcr); -} -#endif - static unsigned char status_sunbpp_to_pc(struct parport *p) { struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; @@ -286,7 +265,7 @@ static struct parport_operations parport_sunbpp_ops = .owner = THIS_MODULE, }; -static int __devinit bpp_probe(struct of_device *op, const struct of_device_id *match) +static int bpp_probe(struct platform_device *op) { struct parport_operations *ops; struct bpp_regs __iomem *regs; @@ -295,7 +274,7 @@ static int __devinit bpp_probe(struct of_device *op, const struct of_device_id * void __iomem *base; struct parport *p; - irq = op->irqs[0]; + irq = op->archdata.irqs[0]; base = of_ioremap(&op->resource[0], 0, resource_size(&op->resource[0]), "sunbpp"); @@ -305,12 +284,11 @@ static int __devinit bpp_probe(struct of_device *op, const struct of_device_id * size = resource_size(&op->resource[0]); dma = PARPORT_DMA_NONE; - ops = kmalloc(sizeof(struct parport_operations), GFP_KERNEL); + ops = kmemdup(&parport_sunbpp_ops, sizeof(struct parport_operations), + GFP_KERNEL); if (!ops) goto out_unmap; - memcpy (ops, &parport_sunbpp_ops, sizeof(struct parport_operations)); - dprintk(("register_port\n")); if (!(p = parport_register_port((unsigned long)base, irq, dma, ops))) goto out_free_ops; @@ -351,7 +329,7 @@ out_unmap: return err; } -static int __devexit bpp_remove(struct of_device *op) +static int bpp_remove(struct platform_device *op) { struct parport *p = dev_get_drvdata(&op->dev); struct parport_operations *ops = p->ops; @@ -381,28 +359,20 @@ static const struct of_device_id bpp_match[] = { MODULE_DEVICE_TABLE(of, bpp_match); -static struct of_platform_driver bpp_sbus_driver = { - .name = "bpp", - .match_table = bpp_match, +static struct platform_driver bpp_sbus_driver = { + .driver = { + .name = "bpp", + .owner = THIS_MODULE, + .of_match_table = bpp_match, + }, .probe = bpp_probe, - .remove = __devexit_p(bpp_remove), + .remove = bpp_remove, }; -static int __init parport_sunbpp_init(void) -{ - return of_register_driver(&bpp_sbus_driver, &of_bus_type); -} - -static void __exit parport_sunbpp_exit(void) -{ - of_unregister_driver(&bpp_sbus_driver); -} +module_platform_driver(bpp_sbus_driver); MODULE_AUTHOR("Derrick J Brashear"); MODULE_DESCRIPTION("Parport Driver for Sparc bidirectional Port"); MODULE_SUPPORTED_DEVICE("Sparc Bidirectional Parallel Port"); MODULE_VERSION("2.0"); MODULE_LICENSE("GPL"); - -module_init(parport_sunbpp_init) -module_exit(parport_sunbpp_exit) |
