diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:16 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:16 -0400 |
commit | 3b36f66b81bc0d69ec7dfa736592224f6ca366b7 (patch) | |
tree | b99bf69c108198d14a0f600a600cf2790ca2be84 /drivers/ide/legacy/ht6560b.c | |
parent | e53cd458d593c88247b8a7b2754d0e8055869670 (diff) |
ide: add ide_legacy_device_add() helper
Add ide_legacy_device_add() helper for use by legacy VLB host drivers
(+ convert them to use it).
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy/ht6560b.c')
-rw-r--r-- | drivers/ide/legacy/ht6560b.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index 9d45ed3bffaa..e4e38c3cd8ac 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c | |||
@@ -346,10 +346,6 @@ static const struct ide_port_info ht6560b_port_info __initdata = { | |||
346 | 346 | ||
347 | static int __init ht6560b_init(void) | 347 | static int __init ht6560b_init(void) |
348 | { | 348 | { |
349 | ide_hwif_t *hwif, *mate; | ||
350 | static u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | ||
351 | hw_regs_t hw[2]; | ||
352 | |||
353 | if (probe_ht6560b == 0) | 349 | if (probe_ht6560b == 0) |
354 | return -ENODEV; | 350 | return -ENODEV; |
355 | 351 | ||
@@ -364,29 +360,7 @@ static int __init ht6560b_init(void) | |||
364 | goto release_region; | 360 | goto release_region; |
365 | } | 361 | } |
366 | 362 | ||
367 | memset(&hw, 0, sizeof(hw)); | 363 | return ide_legacy_device_add(&ht6560b_port_info); |
368 | |||
369 | ide_std_init_ports(&hw[0], 0x1f0, 0x3f6); | ||
370 | hw[0].irq = 14; | ||
371 | |||
372 | ide_std_init_ports(&hw[1], 0x170, 0x376); | ||
373 | hw[1].irq = 15; | ||
374 | |||
375 | hwif = ide_find_port(); | ||
376 | if (hwif) { | ||
377 | ide_init_port_hw(hwif, &hw[0]); | ||
378 | idx[0] = hwif->index; | ||
379 | } | ||
380 | |||
381 | mate = ide_find_port(); | ||
382 | if (mate) { | ||
383 | ide_init_port_hw(mate, &hw[1]); | ||
384 | idx[1] = mate->index; | ||
385 | } | ||
386 | |||
387 | ide_device_add(idx, &ht6560b_port_info); | ||
388 | |||
389 | return 0; | ||
390 | 364 | ||
391 | release_region: | 365 | release_region: |
392 | release_region(HT_CONFIG_PORT, 1); | 366 | release_region(HT_CONFIG_PORT, 1); |