diff options
Diffstat (limited to 'drivers/ide/legacy/ht6560b.c')
| -rw-r--r-- | drivers/ide/legacy/ht6560b.c | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index 60f52f5158c9..702d8deb5780 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c | |||
| @@ -328,8 +328,16 @@ int probe_ht6560b = 0; | |||
| 328 | module_param_named(probe, probe_ht6560b, bool, 0); | 328 | module_param_named(probe, probe_ht6560b, bool, 0); |
| 329 | MODULE_PARM_DESC(probe, "probe for HT6560B chipset"); | 329 | MODULE_PARM_DESC(probe, "probe for HT6560B chipset"); |
| 330 | 330 | ||
| 331 | static const struct ide_port_ops ht6560b_port_ops = { | ||
| 332 | .port_init_devs = ht6560b_port_init_devs, | ||
| 333 | .set_pio_mode = ht6560b_set_pio_mode, | ||
| 334 | .selectproc = ht6560b_selectproc, | ||
| 335 | }; | ||
| 336 | |||
| 331 | static const struct ide_port_info ht6560b_port_info __initdata = { | 337 | static const struct ide_port_info ht6560b_port_info __initdata = { |
| 338 | .name = DRV_NAME, | ||
| 332 | .chipset = ide_ht6560b, | 339 | .chipset = ide_ht6560b, |
| 340 | .port_ops = &ht6560b_port_ops, | ||
| 333 | .host_flags = IDE_HFLAG_SERIALIZE | /* is this needed? */ | 341 | .host_flags = IDE_HFLAG_SERIALIZE | /* is this needed? */ |
| 334 | IDE_HFLAG_NO_DMA | | 342 | IDE_HFLAG_NO_DMA | |
| 335 | IDE_HFLAG_NO_AUTOTUNE | | 343 | IDE_HFLAG_NO_AUTOTUNE | |
| @@ -339,53 +347,21 @@ static const struct ide_port_info ht6560b_port_info __initdata = { | |||
| 339 | 347 | ||
| 340 | static int __init ht6560b_init(void) | 348 | static int __init ht6560b_init(void) |
| 341 | { | 349 | { |
| 342 | ide_hwif_t *hwif, *mate; | ||
| 343 | static u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | ||
| 344 | hw_regs_t hw[2]; | ||
| 345 | |||
| 346 | if (probe_ht6560b == 0) | 350 | if (probe_ht6560b == 0) |
| 347 | return -ENODEV; | 351 | return -ENODEV; |
| 348 | 352 | ||
| 349 | if (!request_region(HT_CONFIG_PORT, 1, DRV_NAME)) { | 353 | if (!request_region(HT_CONFIG_PORT, 1, DRV_NAME)) { |
| 350 | printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n", | 354 | printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n", |
| 351 | __FUNCTION__); | 355 | __func__); |
| 352 | return -ENODEV; | 356 | return -ENODEV; |
| 353 | } | 357 | } |
| 354 | 358 | ||
| 355 | if (!try_to_init_ht6560b()) { | 359 | if (!try_to_init_ht6560b()) { |
| 356 | printk(KERN_NOTICE "%s: HBA not found\n", __FUNCTION__); | 360 | printk(KERN_NOTICE "%s: HBA not found\n", __func__); |
| 357 | goto release_region; | 361 | goto release_region; |
| 358 | } | 362 | } |
| 359 | 363 | ||
| 360 | memset(&hw, 0, sizeof(hw)); | 364 | return ide_legacy_device_add(&ht6560b_port_info, 0); |
| 361 | |||
| 362 | ide_std_init_ports(&hw[0], 0x1f0, 0x3f6); | ||
| 363 | hw[0].irq = 14; | ||
| 364 | |||
| 365 | ide_std_init_ports(&hw[1], 0x170, 0x376); | ||
| 366 | hw[1].irq = 15; | ||
| 367 | |||
| 368 | hwif = ide_find_port(); | ||
| 369 | if (hwif) { | ||
| 370 | ide_init_port_hw(hwif, &hw[0]); | ||
| 371 | hwif->selectproc = ht6560b_selectproc; | ||
| 372 | hwif->set_pio_mode = ht6560b_set_pio_mode; | ||
| 373 | hwif->port_init_devs = ht6560b_port_init_devs; | ||
| 374 | idx[0] = hwif->index; | ||
| 375 | } | ||
| 376 | |||
| 377 | mate = ide_find_port(); | ||
| 378 | if (mate) { | ||
| 379 | ide_init_port_hw(mate, &hw[1]); | ||
| 380 | mate->selectproc = ht6560b_selectproc; | ||
| 381 | mate->set_pio_mode = ht6560b_set_pio_mode; | ||
| 382 | mate->port_init_devs = ht6560b_port_init_devs; | ||
| 383 | idx[1] = mate->index; | ||
| 384 | } | ||
| 385 | |||
| 386 | ide_device_add(idx, &ht6560b_port_info); | ||
| 387 | |||
| 388 | return 0; | ||
| 389 | 365 | ||
| 390 | release_region: | 366 | release_region: |
| 391 | release_region(HT_CONFIG_PORT, 1); | 367 | release_region(HT_CONFIG_PORT, 1); |
