aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2007-02-07 12:18:39 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-07 12:18:39 -0500
commitd24ec426b3be3a011bc8568d53fea486b604a684 (patch)
treef51f209481e6e1738e7b7d4321ea844da1965bc3
parent272103144ac1ff937ed22917e1de05da4d6943dd (diff)
pdc202xx_new: remove check_in_drive_lists abomination
Fold check_in_drive_lists() into quirkproc() handler in both PDC202xx drivers-- this function was never called with a list other than pdc_quirk_drives and was a bad example of code overall... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/pci/pdc202xx_new.c27
-rw-r--r--drivers/ide/pci/pdc202xx_old.c27
2 files changed, 12 insertions, 42 deletions
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index fc2a45bb9651..236a03144a27 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -92,26 +92,6 @@ static u8 pdcnew_ratemask(ide_drive_t *drive)
92 return mode; 92 return mode;
93} 93}
94 94
95static int check_in_drive_lists(ide_drive_t *drive, const char **list)
96{
97 struct hd_driveid *id = drive->id;
98
99 if (pdc_quirk_drives == list) {
100 while (*list) {
101 if (strstr(id->model, *list++)) {
102 return 2;
103 }
104 }
105 } else {
106 while (*list) {
107 if (!strcmp(*list++,id->model)) {
108 return 1;
109 }
110 }
111 }
112 return 0;
113}
114
115/** 95/**
116 * get_indexed_reg - Get indexed register 96 * get_indexed_reg - Get indexed register
117 * @hwif: for the port address 97 * @hwif: for the port address
@@ -324,7 +304,12 @@ fast_ata_pio:
324 304
325static int pdcnew_quirkproc(ide_drive_t *drive) 305static int pdcnew_quirkproc(ide_drive_t *drive)
326{ 306{
327 return check_in_drive_lists(drive, pdc_quirk_drives); 307 const char **list, *model = drive->id->model;
308
309 for (list = pdc_quirk_drives; *list != NULL; list++)
310 if (strstr(model, *list) != NULL)
311 return 2;
312 return 0;
328} 313}
329 314
330static void pdcnew_reset(ide_drive_t *drive) 315static void pdcnew_reset(ide_drive_t *drive)
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 143239c093d5..730e8d1ec2f5 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -123,26 +123,6 @@ static u8 pdc202xx_ratemask (ide_drive_t *drive)
123 return mode; 123 return mode;
124} 124}
125 125
126static int check_in_drive_lists (ide_drive_t *drive, const char **list)
127{
128 struct hd_driveid *id = drive->id;
129
130 if (pdc_quirk_drives == list) {
131 while (*list) {
132 if (strstr(id->model, *list++)) {
133 return 2;
134 }
135 }
136 } else {
137 while (*list) {
138 if (!strcmp(*list++,id->model)) {
139 return 1;
140 }
141 }
142 }
143 return 0;
144}
145
146static int pdc202xx_tune_chipset (ide_drive_t *drive, u8 xferspeed) 126static int pdc202xx_tune_chipset (ide_drive_t *drive, u8 xferspeed)
147{ 127{
148 ide_hwif_t *hwif = HWIF(drive); 128 ide_hwif_t *hwif = HWIF(drive);
@@ -377,7 +357,12 @@ fast_ata_pio:
377 357
378static int pdc202xx_quirkproc (ide_drive_t *drive) 358static int pdc202xx_quirkproc (ide_drive_t *drive)
379{ 359{
380 return ((int) check_in_drive_lists(drive, pdc_quirk_drives)); 360 const char **list, *model = drive->id->model;
361
362 for (list = pdc_quirk_drives; *list != NULL; list++)
363 if (strstr(model, *list) != NULL)
364 return 2;
365 return 0;
381} 366}
382 367
383static void pdc202xx_old_ide_dma_start(ide_drive_t *drive) 368static void pdc202xx_old_ide_dma_start(ide_drive_t *drive)