diff options
-rw-r--r-- | drivers/ide/ide-probe.c | 6 | ||||
-rw-r--r-- | drivers/ide/legacy/ht6560b.c | 8 | ||||
-rw-r--r-- | drivers/ide/legacy/ide-4drives.c | 10 | ||||
-rw-r--r-- | drivers/ide/legacy/qd65xx.c | 16 | ||||
-rw-r--r-- | include/linux/ide.h | 4 |
5 files changed, 21 insertions, 23 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 97dda05914a..c5dc1884930 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -1320,10 +1320,10 @@ static void ide_port_init_devices(ide_hwif_t *hwif) | |||
1320 | drive->unmask = 1; | 1320 | drive->unmask = 1; |
1321 | if (hwif->host_flags & IDE_HFLAG_NO_UNMASK_IRQS) | 1321 | if (hwif->host_flags & IDE_HFLAG_NO_UNMASK_IRQS) |
1322 | drive->no_unmask = 1; | 1322 | drive->no_unmask = 1; |
1323 | } | ||
1324 | 1323 | ||
1325 | if (port_ops && port_ops->port_init_devs) | 1324 | if (port_ops && port_ops->init_dev) |
1326 | port_ops->port_init_devs(hwif); | 1325 | port_ops->init_dev(drive); |
1326 | } | ||
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | static void ide_init_port(ide_hwif_t *hwif, unsigned int port, | 1329 | static void ide_init_port(ide_hwif_t *hwif, unsigned int port, |
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index bd2f579946f..7bc8fd59ea9 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c | |||
@@ -310,16 +310,16 @@ static void ht6560b_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
310 | #endif | 310 | #endif |
311 | } | 311 | } |
312 | 312 | ||
313 | static void __init ht6560b_port_init_devs(ide_hwif_t *hwif) | 313 | static void __init ht6560b_init_dev(ide_drive_t *drive) |
314 | { | 314 | { |
315 | ide_hwif_t *hwif = drive->hwif; | ||
315 | /* Setting default configurations for drives. */ | 316 | /* Setting default configurations for drives. */ |
316 | int t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT; | 317 | int t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT; |
317 | 318 | ||
318 | if (hwif->channel) | 319 | if (hwif->channel) |
319 | t |= (HT_SECONDARY_IF << 8); | 320 | t |= (HT_SECONDARY_IF << 8); |
320 | 321 | ||
321 | hwif->drives[0].drive_data = t; | 322 | drive->drive_data = t; |
322 | hwif->drives[1].drive_data = t; | ||
323 | } | 323 | } |
324 | 324 | ||
325 | static int probe_ht6560b; | 325 | static int probe_ht6560b; |
@@ -328,7 +328,7 @@ module_param_named(probe, probe_ht6560b, bool, 0); | |||
328 | MODULE_PARM_DESC(probe, "probe for HT6560B chipset"); | 328 | MODULE_PARM_DESC(probe, "probe for HT6560B chipset"); |
329 | 329 | ||
330 | static const struct ide_port_ops ht6560b_port_ops = { | 330 | static const struct ide_port_ops ht6560b_port_ops = { |
331 | .port_init_devs = ht6560b_port_init_devs, | 331 | .init_dev = ht6560b_init_dev, |
332 | .set_pio_mode = ht6560b_set_pio_mode, | 332 | .set_pio_mode = ht6560b_set_pio_mode, |
333 | .selectproc = ht6560b_selectproc, | 333 | .selectproc = ht6560b_selectproc, |
334 | }; | 334 | }; |
diff --git a/drivers/ide/legacy/ide-4drives.c b/drivers/ide/legacy/ide-4drives.c index 5cd6ce537ee..89c8ff0a4d0 100644 --- a/drivers/ide/legacy/ide-4drives.c +++ b/drivers/ide/legacy/ide-4drives.c | |||
@@ -11,16 +11,14 @@ static int probe_4drives; | |||
11 | module_param_named(probe, probe_4drives, bool, 0); | 11 | module_param_named(probe, probe_4drives, bool, 0); |
12 | MODULE_PARM_DESC(probe, "probe for generic IDE chipset with 4 drives/port"); | 12 | MODULE_PARM_DESC(probe, "probe for generic IDE chipset with 4 drives/port"); |
13 | 13 | ||
14 | static void ide_4drives_port_init_devs(ide_hwif_t *hwif) | 14 | static void ide_4drives_init_dev(ide_drive_t *drive) |
15 | { | 15 | { |
16 | if (hwif->channel) { | 16 | if (drive->hwif->channel) |
17 | hwif->drives[0].select.all ^= 0x20; | 17 | drive->select.all ^= 0x20; |
18 | hwif->drives[1].select.all ^= 0x20; | ||
19 | } | ||
20 | } | 18 | } |
21 | 19 | ||
22 | static const struct ide_port_ops ide_4drives_port_ops = { | 20 | static const struct ide_port_ops ide_4drives_port_ops = { |
23 | .port_init_devs = ide_4drives_port_init_devs, | 21 | .init_dev = ide_4drives_init_dev, |
24 | }; | 22 | }; |
25 | 23 | ||
26 | static const struct ide_port_info ide_4drives_port_info = { | 24 | static const struct ide_port_info ide_4drives_port_info = { |
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c index 63f6c31d16e..2338f344ea2 100644 --- a/drivers/ide/legacy/qd65xx.c +++ b/drivers/ide/legacy/qd65xx.c | |||
@@ -282,17 +282,18 @@ static int __init qd_testreg(int port) | |||
282 | return (readreg != QD_TESTVAL); | 282 | return (readreg != QD_TESTVAL); |
283 | } | 283 | } |
284 | 284 | ||
285 | static void __init qd6500_port_init_devs(ide_hwif_t *hwif) | 285 | static void __init qd6500_init_dev(ide_drive_t *drive) |
286 | { | 286 | { |
287 | ide_hwif_t *hwif = drive->hwif; | ||
287 | u8 base = (hwif->config_data & 0xff00) >> 8; | 288 | u8 base = (hwif->config_data & 0xff00) >> 8; |
288 | u8 config = QD_CONFIG(hwif); | 289 | u8 config = QD_CONFIG(hwif); |
289 | 290 | ||
290 | hwif->drives[0].drive_data = QD6500_DEF_DATA; | 291 | drive->drive_data = QD6500_DEF_DATA; |
291 | hwif->drives[1].drive_data = QD6500_DEF_DATA; | ||
292 | } | 292 | } |
293 | 293 | ||
294 | static void __init qd6580_port_init_devs(ide_hwif_t *hwif) | 294 | static void __init qd6580_init_dev(ide_drive_t *drive) |
295 | { | 295 | { |
296 | ide_hwif_t *hwif = drive->hwif; | ||
296 | u16 t1, t2; | 297 | u16 t1, t2; |
297 | u8 base = (hwif->config_data & 0xff00) >> 8; | 298 | u8 base = (hwif->config_data & 0xff00) >> 8; |
298 | u8 config = QD_CONFIG(hwif); | 299 | u8 config = QD_CONFIG(hwif); |
@@ -303,18 +304,17 @@ static void __init qd6580_port_init_devs(ide_hwif_t *hwif) | |||
303 | } else | 304 | } else |
304 | t2 = t1 = hwif->channel ? QD6580_DEF_DATA2 : QD6580_DEF_DATA; | 305 | t2 = t1 = hwif->channel ? QD6580_DEF_DATA2 : QD6580_DEF_DATA; |
305 | 306 | ||
306 | hwif->drives[0].drive_data = t1; | 307 | drive->drive_data = drive->select.b.unit ? t2 : t1; |
307 | hwif->drives[1].drive_data = t2; | ||
308 | } | 308 | } |
309 | 309 | ||
310 | static const struct ide_port_ops qd6500_port_ops = { | 310 | static const struct ide_port_ops qd6500_port_ops = { |
311 | .port_init_devs = qd6500_port_init_devs, | 311 | .init_dev = qd6500_init_dev, |
312 | .set_pio_mode = qd6500_set_pio_mode, | 312 | .set_pio_mode = qd6500_set_pio_mode, |
313 | .selectproc = qd65xx_select, | 313 | .selectproc = qd65xx_select, |
314 | }; | 314 | }; |
315 | 315 | ||
316 | static const struct ide_port_ops qd6580_port_ops = { | 316 | static const struct ide_port_ops qd6580_port_ops = { |
317 | .port_init_devs = qd6580_port_init_devs, | 317 | .init_dev = qd6580_init_dev, |
318 | .set_pio_mode = qd6580_set_pio_mode, | 318 | .set_pio_mode = qd6580_set_pio_mode, |
319 | .selectproc = qd65xx_select, | 319 | .selectproc = qd65xx_select, |
320 | }; | 320 | }; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index a6a2eccb652..f9cbe9350ca 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -405,8 +405,8 @@ typedef struct ide_drive_s { | |||
405 | struct ide_port_info; | 405 | struct ide_port_info; |
406 | 406 | ||
407 | struct ide_port_ops { | 407 | struct ide_port_ops { |
408 | /* host specific initialization of devices on a port */ | 408 | /* host specific initialization of a device */ |
409 | void (*port_init_devs)(struct hwif_s *); | 409 | void (*init_dev)(ide_drive_t *); |
410 | /* routine to program host for PIO mode */ | 410 | /* routine to program host for PIO mode */ |
411 | void (*set_pio_mode)(ide_drive_t *, const u8); | 411 | void (*set_pio_mode)(ide_drive_t *, const u8); |
412 | /* routine to program host for DMA mode */ | 412 | /* routine to program host for DMA mode */ |