diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:57 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:57 -0400 |
commit | 48c3c1072651922ed153bcf0a33ea82cf20df390 (patch) | |
tree | 92ad23e3869e70731eca99394c08a3bf06b8753e /drivers/ide/arm/rapide.c | |
parent | 374e042c3e767ac2e5a40b78529220e0b3de793c (diff) |
ide: add struct ide_host (take 3)
* Add struct ide_host which keeps pointers to host's ports.
* Add ide_host_alloc[_all]() and ide_host_remove() helpers.
* Pass 'struct ide_host *host' instead of 'u8 *idx' to
ide_device_add[_all]() and rename it to ide_host_register[_all]().
* Convert host drivers and core code to use struct ide_host.
* Remove no longer needed ide_find_port().
* Make ide_find_port_slot() static.
* Unexport ide_unregister().
v2:
* Add missing 'struct ide_host *host' to macide.c.
v3:
* Fix build problem in pmac.c (s/ide_alloc_host/ide_host_alloc/)
(Noticed by Stephen Rothwell).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/arm/rapide.c')
-rw-r--r-- | drivers/ide/arm/rapide.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index a45c2f694949..11f3307385de 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c | |||
@@ -32,11 +32,10 @@ static void rapide_setup_ports(hw_regs_t *hw, void __iomem *base, | |||
32 | static int __devinit | 32 | static int __devinit |
33 | rapide_probe(struct expansion_card *ec, const struct ecard_id *id) | 33 | rapide_probe(struct expansion_card *ec, const struct ecard_id *id) |
34 | { | 34 | { |
35 | ide_hwif_t *hwif; | ||
36 | void __iomem *base; | 35 | void __iomem *base; |
36 | struct ide_host *host; | ||
37 | int ret; | 37 | int ret; |
38 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; | 38 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; |
39 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | ||
40 | 39 | ||
41 | ret = ecard_request_resources(ec); | 40 | ret = ecard_request_resources(ec); |
42 | if (ret) | 41 | if (ret) |
@@ -53,17 +52,15 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
53 | hw.chipset = ide_generic; | 52 | hw.chipset = ide_generic; |
54 | hw.dev = &ec->dev; | 53 | hw.dev = &ec->dev; |
55 | 54 | ||
56 | hwif = ide_find_port(); | 55 | host = ide_host_alloc(&rapide_port_info, hws); |
57 | if (hwif == NULL) { | 56 | if (host == NULL) { |
58 | ret = -ENOENT; | 57 | ret = -ENOENT; |
59 | goto release; | 58 | goto release; |
60 | } | 59 | } |
61 | 60 | ||
62 | idx[0] = hwif->index; | 61 | ide_host_register(host, &rapide_port_info, hws); |
63 | 62 | ||
64 | ide_device_add(idx, &rapide_port_info, hws); | 63 | ecard_set_drvdata(ec, host); |
65 | |||
66 | ecard_set_drvdata(ec, hwif); | ||
67 | goto out; | 64 | goto out; |
68 | 65 | ||
69 | release: | 66 | release: |
@@ -74,11 +71,11 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
74 | 71 | ||
75 | static void __devexit rapide_remove(struct expansion_card *ec) | 72 | static void __devexit rapide_remove(struct expansion_card *ec) |
76 | { | 73 | { |
77 | ide_hwif_t *hwif = ecard_get_drvdata(ec); | 74 | struct ide_host *host = ecard_get_drvdata(ec); |
78 | 75 | ||
79 | ecard_set_drvdata(ec, NULL); | 76 | ecard_set_drvdata(ec, NULL); |
80 | 77 | ||
81 | ide_unregister(hwif); | 78 | ide_host_remove(host); |
82 | 79 | ||
83 | ecard_release_resources(ec); | 80 | ecard_release_resources(ec); |
84 | } | 81 | } |