diff options
Diffstat (limited to 'drivers/ata/pata_sis.c')
-rw-r--r-- | drivers/ata/pata_sis.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index 9b3774a4775a..f2231267e011 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c | |||
@@ -38,8 +38,8 @@ | |||
38 | #define DRV_VERSION "0.5.1" | 38 | #define DRV_VERSION "0.5.1" |
39 | 39 | ||
40 | struct sis_chipset { | 40 | struct sis_chipset { |
41 | u16 device; /* PCI host ID */ | 41 | u16 device; /* PCI host ID */ |
42 | struct ata_port_info *info; /* Info block */ | 42 | const struct ata_port_info *info; /* Info block */ |
43 | /* Probably add family, cable detect type etc here to clean | 43 | /* Probably add family, cable detect type etc here to clean |
44 | up code later */ | 44 | up code later */ |
45 | }; | 45 | }; |
@@ -696,7 +696,7 @@ static const struct ata_port_operations sis_old_ops = { | |||
696 | .port_start = ata_port_start, | 696 | .port_start = ata_port_start, |
697 | }; | 697 | }; |
698 | 698 | ||
699 | static struct ata_port_info sis_info = { | 699 | static const struct ata_port_info sis_info = { |
700 | .sht = &sis_sht, | 700 | .sht = &sis_sht, |
701 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, | 701 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, |
702 | .pio_mask = 0x1f, /* pio0-4 */ | 702 | .pio_mask = 0x1f, /* pio0-4 */ |
@@ -704,7 +704,7 @@ static struct ata_port_info sis_info = { | |||
704 | .udma_mask = 0, | 704 | .udma_mask = 0, |
705 | .port_ops = &sis_old_ops, | 705 | .port_ops = &sis_old_ops, |
706 | }; | 706 | }; |
707 | static struct ata_port_info sis_info33 = { | 707 | static const struct ata_port_info sis_info33 = { |
708 | .sht = &sis_sht, | 708 | .sht = &sis_sht, |
709 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, | 709 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, |
710 | .pio_mask = 0x1f, /* pio0-4 */ | 710 | .pio_mask = 0x1f, /* pio0-4 */ |
@@ -712,35 +712,35 @@ static struct ata_port_info sis_info33 = { | |||
712 | .udma_mask = ATA_UDMA2, /* UDMA 33 */ | 712 | .udma_mask = ATA_UDMA2, /* UDMA 33 */ |
713 | .port_ops = &sis_old_ops, | 713 | .port_ops = &sis_old_ops, |
714 | }; | 714 | }; |
715 | static struct ata_port_info sis_info66 = { | 715 | static const struct ata_port_info sis_info66 = { |
716 | .sht = &sis_sht, | 716 | .sht = &sis_sht, |
717 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, | 717 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, |
718 | .pio_mask = 0x1f, /* pio0-4 */ | 718 | .pio_mask = 0x1f, /* pio0-4 */ |
719 | .udma_mask = ATA_UDMA4, /* UDMA 66 */ | 719 | .udma_mask = ATA_UDMA4, /* UDMA 66 */ |
720 | .port_ops = &sis_66_ops, | 720 | .port_ops = &sis_66_ops, |
721 | }; | 721 | }; |
722 | static struct ata_port_info sis_info100 = { | 722 | static const struct ata_port_info sis_info100 = { |
723 | .sht = &sis_sht, | 723 | .sht = &sis_sht, |
724 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, | 724 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, |
725 | .pio_mask = 0x1f, /* pio0-4 */ | 725 | .pio_mask = 0x1f, /* pio0-4 */ |
726 | .udma_mask = ATA_UDMA5, | 726 | .udma_mask = ATA_UDMA5, |
727 | .port_ops = &sis_100_ops, | 727 | .port_ops = &sis_100_ops, |
728 | }; | 728 | }; |
729 | static struct ata_port_info sis_info100_early = { | 729 | static const struct ata_port_info sis_info100_early = { |
730 | .sht = &sis_sht, | 730 | .sht = &sis_sht, |
731 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, | 731 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, |
732 | .udma_mask = ATA_UDMA5, | 732 | .udma_mask = ATA_UDMA5, |
733 | .pio_mask = 0x1f, /* pio0-4 */ | 733 | .pio_mask = 0x1f, /* pio0-4 */ |
734 | .port_ops = &sis_66_ops, | 734 | .port_ops = &sis_66_ops, |
735 | }; | 735 | }; |
736 | struct ata_port_info sis_info133 = { | 736 | const struct ata_port_info sis_info133 = { |
737 | .sht = &sis_sht, | 737 | .sht = &sis_sht, |
738 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, | 738 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, |
739 | .pio_mask = 0x1f, /* pio0-4 */ | 739 | .pio_mask = 0x1f, /* pio0-4 */ |
740 | .udma_mask = ATA_UDMA6, | 740 | .udma_mask = ATA_UDMA6, |
741 | .port_ops = &sis_133_ops, | 741 | .port_ops = &sis_133_ops, |
742 | }; | 742 | }; |
743 | static struct ata_port_info sis_info133_early = { | 743 | static const struct ata_port_info sis_info133_early = { |
744 | .sht = &sis_sht, | 744 | .sht = &sis_sht, |
745 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, | 745 | .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, |
746 | .pio_mask = 0x1f, /* pio0-4 */ | 746 | .pio_mask = 0x1f, /* pio0-4 */ |
@@ -823,8 +823,8 @@ static void sis_fixup(struct pci_dev *pdev, struct sis_chipset *sis) | |||
823 | static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | 823 | static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) |
824 | { | 824 | { |
825 | static int printed_version; | 825 | static int printed_version; |
826 | static struct ata_port_info *port_info[2]; | 826 | struct ata_port_info port; |
827 | struct ata_port_info *port; | 827 | const struct ata_port_info *ppi[] = { &port, NULL }; |
828 | struct pci_dev *host = NULL; | 828 | struct pci_dev *host = NULL; |
829 | struct sis_chipset *chipset = NULL; | 829 | struct sis_chipset *chipset = NULL; |
830 | struct sis_chipset *sets; | 830 | struct sis_chipset *sets; |
@@ -964,13 +964,12 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
964 | if (chipset == NULL) | 964 | if (chipset == NULL) |
965 | return -ENODEV; | 965 | return -ENODEV; |
966 | 966 | ||
967 | port = chipset->info; | 967 | port = *chipset->info; |
968 | port->private_data = chipset; | 968 | port.private_data = chipset; |
969 | 969 | ||
970 | sis_fixup(pdev, chipset); | 970 | sis_fixup(pdev, chipset); |
971 | 971 | ||
972 | port_info[0] = port_info[1] = port; | 972 | return ata_pci_init_one(pdev, ppi); |
973 | return ata_pci_init_one(pdev, port_info, 2); | ||
974 | } | 973 | } |
975 | 974 | ||
976 | static const struct pci_device_id sis_pci_tbl[] = { | 975 | static const struct pci_device_id sis_pci_tbl[] = { |