diff options
Diffstat (limited to 'drivers/ata/pata_ixp4xx_cf.c')
| -rw-r--r-- | drivers/ata/pata_ixp4xx_cf.c | 43 | 
1 files changed, 13 insertions, 30 deletions
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index ba54b089f98..ddf470c2341 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c @@ -31,7 +31,7 @@ static int ixp4xx_set_mode(struct ata_link *link, struct ata_device **error)  	struct ata_device *dev;  	ata_for_each_dev(dev, link, ENABLED) { -		ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); +		ata_dev_info(dev, "configured for PIO0\n");  		dev->pio_mode = XFER_PIO_0;  		dev->xfer_mode = XFER_PIO_0;  		dev->xfer_shift = ATA_SHIFT_PIO; @@ -48,7 +48,7 @@ static unsigned int ixp4xx_mmio_data_xfer(struct ata_device *dev,  	u16 *buf16 = (u16 *) buf;  	struct ata_port *ap = dev->link->ap;  	void __iomem *mmio = ap->ioaddr.data_addr; -	struct ixp4xx_pata_data *data = ap->host->dev->platform_data; +	struct ixp4xx_pata_data *data = dev_get_platdata(ap->host->dev);  	/* set the expansion bus in 16bit mode and restore  	 * 8 bit mode after the transaction. @@ -137,13 +137,14 @@ static void ixp4xx_setup_port(struct ata_port *ap,  	ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", raw_cmd, raw_ctl);  } -static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) +static int ixp4xx_pata_probe(struct platform_device *pdev)  {  	unsigned int irq;  	struct resource *cs0, *cs1;  	struct ata_host *host;  	struct ata_port *ap; -	struct ixp4xx_pata_data *data = pdev->dev.platform_data; +	struct ixp4xx_pata_data *data = dev_get_platdata(&pdev->dev); +	int ret;  	cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);  	cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1); @@ -157,7 +158,9 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev)  		return -ENOMEM;  	/* acquire resources and fill host */ -	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); +	ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); +	if (ret) +		return ret;  	data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000);  	data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000); @@ -167,7 +170,7 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev)  	irq = platform_get_irq(pdev, 0);  	if (irq) -		set_irq_type(irq, IRQ_TYPE_EDGE_RISING); +		irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);  	/* Setup expansion bus chip selects */  	*data->cs0_cfg = data->cs0_bits; @@ -177,49 +180,29 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev)  	ap->ops	= &ixp4xx_port_ops;  	ap->pio_mask = ATA_PIO4; -	ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY | ATA_FLAG_NO_ATAPI; +	ap->flags |= ATA_FLAG_NO_ATAPI;  	ixp4xx_setup_port(ap, data, cs0->start, cs1->start); -	dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); +	ata_print_version_once(&pdev->dev, DRV_VERSION);  	/* activate host */  	return ata_host_activate(host, irq, ata_sff_interrupt, 0, &ixp4xx_sht);  } -static __devexit int ixp4xx_pata_remove(struct platform_device *dev) -{ -	struct ata_host *host = platform_get_drvdata(dev); - -	ata_host_detach(host); - -	return 0; -} -  static struct platform_driver ixp4xx_pata_platform_driver = {  	.driver	 = {  		.name   = DRV_NAME,  		.owner  = THIS_MODULE,  	},  	.probe		= ixp4xx_pata_probe, -	.remove		= __devexit_p(ixp4xx_pata_remove), +	.remove		= ata_platform_remove_one,  }; -static int __init ixp4xx_pata_init(void) -{ -	return platform_driver_register(&ixp4xx_pata_platform_driver); -} - -static void __exit ixp4xx_pata_exit(void) -{ -	platform_driver_unregister(&ixp4xx_pata_platform_driver); -} +module_platform_driver(ixp4xx_pata_platform_driver);  MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");  MODULE_DESCRIPTION("low-level driver for ixp4xx Compact Flash PATA");  MODULE_LICENSE("GPL");  MODULE_VERSION(DRV_VERSION);  MODULE_ALIAS("platform:" DRV_NAME); - -module_init(ixp4xx_pata_init); -module_exit(ixp4xx_pata_exit);  | 
