Commit e6d95bd14928926d6658b5e4ace905e8b83ed27a

Authored by Bartlomiej Zolnierkiewicz
1 parent a698400a15

ide: ->port_init_devs -> ->init_dev

Change ->port_init_devs method to take 'ide_drive_t *' as an argument
instead of 'ide_hwif_t *' and rename it to ->init_dev.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Showing 5 changed files with 21 additions and 23 deletions Side-by-side Diff

drivers/ide/ide-probe.c
... ... @@ -1320,10 +1320,10 @@
1320 1320 drive->unmask = 1;
1321 1321 if (hwif->host_flags & IDE_HFLAG_NO_UNMASK_IRQS)
1322 1322 drive->no_unmask = 1;
1323   - }
1324 1323  
1325   - if (port_ops && port_ops->port_init_devs)
1326   - port_ops->port_init_devs(hwif);
  1324 + if (port_ops && port_ops->init_dev)
  1325 + port_ops->init_dev(drive);
  1326 + }
1327 1327 }
1328 1328  
1329 1329 static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
drivers/ide/legacy/ht6560b.c
... ... @@ -310,16 +310,16 @@
310 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 316 /* Setting default configurations for drives. */
316 317 int t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT;
317 318  
318 319 if (hwif->channel)
319 320 t |= (HT_SECONDARY_IF << 8);
320 321  
321   - hwif->drives[0].drive_data = t;
322   - hwif->drives[1].drive_data = t;
  322 + drive->drive_data = t;
323 323 }
324 324  
325 325 static int probe_ht6560b;
... ... @@ -328,7 +328,7 @@
328 328 MODULE_PARM_DESC(probe, "probe for HT6560B chipset");
329 329  
330 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 332 .set_pio_mode = ht6560b_set_pio_mode,
333 333 .selectproc = ht6560b_selectproc,
334 334 };
drivers/ide/legacy/ide-4drives.c
... ... @@ -11,16 +11,14 @@
11 11 module_param_named(probe, probe_4drives, bool, 0);
12 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) {
17   - hwif->drives[0].select.all ^= 0x20;
18   - hwif->drives[1].select.all ^= 0x20;
19   - }
  16 + if (drive->hwif->channel)
  17 + drive->select.all ^= 0x20;
20 18 }
21 19  
22 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 24 static const struct ide_port_info ide_4drives_port_info = {
drivers/ide/legacy/qd65xx.c
... ... @@ -282,17 +282,18 @@
282 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 288 u8 base = (hwif->config_data & 0xff00) >> 8;
288 289 u8 config = QD_CONFIG(hwif);
289 290  
290   - hwif->drives[0].drive_data = QD6500_DEF_DATA;
291   - hwif->drives[1].drive_data = QD6500_DEF_DATA;
  291 + drive->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 297 u16 t1, t2;
297 298 u8 base = (hwif->config_data & 0xff00) >> 8;
298 299 u8 config = QD_CONFIG(hwif);
299 300  
300 301  
... ... @@ -303,18 +304,17 @@
303 304 } else
304 305 t2 = t1 = hwif->channel ? QD6580_DEF_DATA2 : QD6580_DEF_DATA;
305 306  
306   - hwif->drives[0].drive_data = t1;
307   - hwif->drives[1].drive_data = t2;
  307 + drive->drive_data = drive->select.b.unit ? t2 : t1;
308 308 }
309 309  
310 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 312 .set_pio_mode = qd6500_set_pio_mode,
313 313 .selectproc = qd65xx_select,
314 314 };
315 315  
316 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 318 .set_pio_mode = qd6580_set_pio_mode,
319 319 .selectproc = qd65xx_select,
320 320 };
... ... @@ -405,8 +405,8 @@
405 405 struct ide_port_info;
406 406  
407 407 struct ide_port_ops {
408   - /* host specific initialization of devices on a port */
409   - void (*port_init_devs)(struct hwif_s *);
  408 + /* host specific initialization of a device */
  409 + void (*init_dev)(ide_drive_t *);
410 410 /* routine to program host for PIO mode */
411 411 void (*set_pio_mode)(ide_drive_t *, const u8);
412 412 /* routine to program host for DMA mode */