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/pci/cs5520.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/pci/cs5520.c')
-rw-r--r-- | drivers/ide/pci/cs5520.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index e8e7df1915bf..b8ec06d22c61 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c | |||
@@ -114,9 +114,9 @@ static const struct ide_port_info cyrix_chipsets[] __devinitdata = { | |||
114 | 114 | ||
115 | static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) | 115 | static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
116 | { | 116 | { |
117 | struct ide_host *host; | ||
117 | const struct ide_port_info *d = &cyrix_chipsets[id->driver_data]; | 118 | const struct ide_port_info *d = &cyrix_chipsets[id->driver_data]; |
118 | hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL }; | 119 | hw_regs_t hw[4], *hws[] = { NULL, NULL, NULL, NULL }; |
119 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | ||
120 | 120 | ||
121 | ide_setup_pci_noise(dev, d); | 121 | ide_setup_pci_noise(dev, d); |
122 | 122 | ||
@@ -138,9 +138,11 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic | |||
138 | * do all the device setup for us | 138 | * do all the device setup for us |
139 | */ | 139 | */ |
140 | 140 | ||
141 | ide_pci_setup_ports(dev, d, 14, &idx[0], &hw[0], &hws[0]); | 141 | ide_pci_setup_ports(dev, d, 14, &hw[0], &hws[0]); |
142 | 142 | ||
143 | ide_device_add(idx, d, hws); | 143 | host = ide_host_alloc(d, hws); |
144 | if (host) | ||
145 | ide_host_register(host, d, hws); | ||
144 | 146 | ||
145 | return 0; | 147 | return 0; |
146 | } | 148 | } |