aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-cd.c2
-rw-r--r--drivers/ide/pci/hpt366.c31
2 files changed, 15 insertions, 18 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index f1489999cf91..49a8c589e346 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1933,7 +1933,6 @@ static void ide_cd_remove(ide_drive_t *drive)
1933 1933
1934 ide_proc_unregister_driver(drive, info->driver); 1934 ide_proc_unregister_driver(drive, info->driver);
1935 1935
1936 blk_unregister_filter(info->disk);
1937 del_gendisk(info->disk); 1936 del_gendisk(info->disk);
1938 1937
1939 ide_cd_put(info); 1938 ide_cd_put(info);
@@ -2159,7 +2158,6 @@ static int ide_cd_probe(ide_drive_t *drive)
2159 g->fops = &idecd_ops; 2158 g->fops = &idecd_ops;
2160 g->flags |= GENHD_FL_REMOVABLE; 2159 g->flags |= GENHD_FL_REMOVABLE;
2161 add_disk(g); 2160 add_disk(g);
2162 blk_register_filter(g);
2163 return 0; 2161 return 0;
2164 2162
2165out_free_cd: 2163out_free_cd:
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index eb107eef0dbc..c37ab1743819 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -613,6 +613,14 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list)
613 return 0; 613 return 0;
614} 614}
615 615
616static struct hpt_info *hpt3xx_get_info(struct device *dev)
617{
618 struct ide_host *host = dev_get_drvdata(dev);
619 struct hpt_info *info = (struct hpt_info *)host->host_priv;
620
621 return dev == host->dev[1] ? info + 1 : info;
622}
623
616/* 624/*
617 * The Marvell bridge chips used on the HighPoint SATA cards do not seem 625 * The Marvell bridge chips used on the HighPoint SATA cards do not seem
618 * to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes... 626 * to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes...
@@ -621,9 +629,7 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list)
621static u8 hpt3xx_udma_filter(ide_drive_t *drive) 629static u8 hpt3xx_udma_filter(ide_drive_t *drive)
622{ 630{
623 ide_hwif_t *hwif = HWIF(drive); 631 ide_hwif_t *hwif = HWIF(drive);
624 struct pci_dev *dev = to_pci_dev(hwif->dev); 632 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
625 struct ide_host *host = pci_get_drvdata(dev);
626 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
627 u8 mask = hwif->ultra_mask; 633 u8 mask = hwif->ultra_mask;
628 634
629 switch (info->chip_type) { 635 switch (info->chip_type) {
@@ -662,9 +668,7 @@ static u8 hpt3xx_udma_filter(ide_drive_t *drive)
662static u8 hpt3xx_mdma_filter(ide_drive_t *drive) 668static u8 hpt3xx_mdma_filter(ide_drive_t *drive)
663{ 669{
664 ide_hwif_t *hwif = HWIF(drive); 670 ide_hwif_t *hwif = HWIF(drive);
665 struct pci_dev *dev = to_pci_dev(hwif->dev); 671 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
666 struct ide_host *host = pci_get_drvdata(dev);
667 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
668 672
669 switch (info->chip_type) { 673 switch (info->chip_type) {
670 case HPT372 : 674 case HPT372 :
@@ -700,8 +704,7 @@ static void hpt3xx_set_mode(ide_drive_t *drive, const u8 speed)
700{ 704{
701 ide_hwif_t *hwif = drive->hwif; 705 ide_hwif_t *hwif = drive->hwif;
702 struct pci_dev *dev = to_pci_dev(hwif->dev); 706 struct pci_dev *dev = to_pci_dev(hwif->dev);
703 struct ide_host *host = pci_get_drvdata(dev); 707 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
704 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
705 struct hpt_timings *t = info->timings; 708 struct hpt_timings *t = info->timings;
706 u8 itr_addr = 0x40 + (drive->dn * 4); 709 u8 itr_addr = 0x40 + (drive->dn * 4);
707 u32 old_itr = 0; 710 u32 old_itr = 0;
@@ -744,8 +747,7 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
744{ 747{
745 ide_hwif_t *hwif = HWIF(drive); 748 ide_hwif_t *hwif = HWIF(drive);
746 struct pci_dev *dev = to_pci_dev(hwif->dev); 749 struct pci_dev *dev = to_pci_dev(hwif->dev);
747 struct ide_host *host = pci_get_drvdata(dev); 750 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
748 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
749 751
750 if (drive->quirk_list) { 752 if (drive->quirk_list) {
751 if (info->chip_type >= HPT370) { 753 if (info->chip_type >= HPT370) {
@@ -973,8 +975,7 @@ static int __devinit hpt37x_calibrate_dpll(struct pci_dev *dev, u16 f_low, u16 f
973static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev) 975static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev)
974{ 976{
975 unsigned long io_base = pci_resource_start(dev, 4); 977 unsigned long io_base = pci_resource_start(dev, 4);
976 struct ide_host *host = pci_get_drvdata(dev); 978 struct hpt_info *info = hpt3xx_get_info(&dev->dev);
977 struct hpt_info *info = host->host_priv + (&dev->dev == host->dev[1]);
978 const char *name = DRV_NAME; 979 const char *name = DRV_NAME;
979 u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */ 980 u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */
980 u8 chip_type; 981 u8 chip_type;
@@ -1217,8 +1218,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev)
1217static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) 1218static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)
1218{ 1219{
1219 struct pci_dev *dev = to_pci_dev(hwif->dev); 1220 struct pci_dev *dev = to_pci_dev(hwif->dev);
1220 struct ide_host *host = pci_get_drvdata(dev); 1221 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
1221 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
1222 u8 chip_type = info->chip_type; 1222 u8 chip_type = info->chip_type;
1223 u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02; 1223 u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02;
1224 1224
@@ -1262,8 +1262,7 @@ static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)
1262static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) 1262static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
1263{ 1263{
1264 struct pci_dev *dev = to_pci_dev(hwif->dev); 1264 struct pci_dev *dev = to_pci_dev(hwif->dev);
1265 struct ide_host *host = pci_get_drvdata(dev); 1265 struct hpt_info *info = hpt3xx_get_info(hwif->dev);
1266 struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]);
1267 int serialize = HPT_SERIALIZE_IO; 1266 int serialize = HPT_SERIALIZE_IO;
1268 u8 chip_type = info->chip_type; 1267 u8 chip_type = info->chip_type;
1269 u8 new_mcr, old_mcr = 0; 1268 u8 new_mcr, old_mcr = 0;