aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_it821x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_it821x.c')
-rw-r--r--drivers/ata/pata_it821x.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index 171fbd206bd5..f23365b92c0f 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -594,14 +594,10 @@ static int it821x_port_start(struct ata_port *ap)
594 if (ret < 0) 594 if (ret < 0)
595 return ret; 595 return ret;
596 596
597 ap->private_data = kmalloc(sizeof(struct it821x_dev), GFP_KERNEL); 597 itdev = devm_kzalloc(&pdev->dev, sizeof(struct it821x_dev), GFP_KERNEL);
598 if (ap->private_data == NULL) { 598 if (itdev == NULL)
599 ata_port_stop(ap);
600 return -ENOMEM; 599 return -ENOMEM;
601 } 600 ap->private_data = itdev;
602
603 itdev = ap->private_data;
604 memset(itdev, 0, sizeof(struct it821x_dev));
605 601
606 pci_read_config_byte(pdev, 0x50, &conf); 602 pci_read_config_byte(pdev, 0x50, &conf);
607 603
@@ -632,20 +628,6 @@ static int it821x_port_start(struct ata_port *ap)
632 return 0; 628 return 0;
633} 629}
634 630
635/**
636 * it821x_port_stop - port shutdown
637 * @ap: ATA port being removed
638 *
639 * Release the private objects we added in it821x_port_start
640 */
641
642static void it821x_port_stop(struct ata_port *ap) {
643 kfree(ap->private_data);
644 ap->private_data = NULL; /* We want an OOPS if we reuse this
645 too late! */
646 ata_port_stop(ap);
647}
648
649static struct scsi_host_template it821x_sht = { 631static struct scsi_host_template it821x_sht = {
650 .module = THIS_MODULE, 632 .module = THIS_MODULE,
651 .name = DRV_NAME, 633 .name = DRV_NAME,
@@ -698,8 +680,6 @@ static struct ata_port_operations it821x_smart_port_ops = {
698 .irq_clear = ata_bmdma_irq_clear, 680 .irq_clear = ata_bmdma_irq_clear,
699 681
700 .port_start = it821x_port_start, 682 .port_start = it821x_port_start,
701 .port_stop = it821x_port_stop,
702 .host_stop = ata_host_stop
703}; 683};
704 684
705static struct ata_port_operations it821x_passthru_port_ops = { 685static struct ata_port_operations it821x_passthru_port_ops = {
@@ -734,8 +714,6 @@ static struct ata_port_operations it821x_passthru_port_ops = {
734 .irq_handler = ata_interrupt, 714 .irq_handler = ata_interrupt,
735 715
736 .port_start = it821x_port_start, 716 .port_start = it821x_port_start,
737 .port_stop = it821x_port_stop,
738 .host_stop = ata_host_stop
739}; 717};
740 718
741static void __devinit it821x_disable_raid(struct pci_dev *pdev) 719static void __devinit it821x_disable_raid(struct pci_dev *pdev)