diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-24 16:53:17 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-24 16:53:17 -0400 |
commit | b16040b14e766d390138b04c8829c816f4c1d95b (patch) | |
tree | 5bd46bf28fce535bf3b5281cd9f2a34e0d743caa /drivers/ide | |
parent | ee77325b074a73694b66ec9eca4f7e55dad58b84 (diff) |
tc86c001: remove ->init_chipset method
* Reserve PCI BAR 5 in tc86c001_init_one() and remove no longer needed
init_chipset_tc86c001().
While at it:
* Add & use DRV_NAME define.
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/pci/tc86c001.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c index e16e79d21772..bb3292199356 100644 --- a/drivers/ide/pci/tc86c001.c +++ b/drivers/ide/pci/tc86c001.c | |||
@@ -11,6 +11,8 @@ | |||
11 | #include <linux/pci.h> | 11 | #include <linux/pci.h> |
12 | #include <linux/ide.h> | 12 | #include <linux/ide.h> |
13 | 13 | ||
14 | #define DRV_NAME "TC86C001" | ||
15 | |||
14 | static void tc86c001_set_mode(ide_drive_t *drive, const u8 speed) | 16 | static void tc86c001_set_mode(ide_drive_t *drive, const u8 speed) |
15 | { | 17 | { |
16 | ide_hwif_t *hwif = HWIF(drive); | 18 | ide_hwif_t *hwif = HWIF(drive); |
@@ -173,16 +175,6 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) | |||
173 | hwif->rqsize = 0xffff; | 175 | hwif->rqsize = 0xffff; |
174 | } | 176 | } |
175 | 177 | ||
176 | static unsigned int __devinit init_chipset_tc86c001(struct pci_dev *dev, | ||
177 | const char *name) | ||
178 | { | ||
179 | int err = pci_request_region(dev, 5, name); | ||
180 | |||
181 | if (err) | ||
182 | printk(KERN_ERR "%s: system control regs already in use", name); | ||
183 | return err; | ||
184 | } | ||
185 | |||
186 | static const struct ide_port_ops tc86c001_port_ops = { | 178 | static const struct ide_port_ops tc86c001_port_ops = { |
187 | .set_pio_mode = tc86c001_set_pio_mode, | 179 | .set_pio_mode = tc86c001_set_pio_mode, |
188 | .set_dma_mode = tc86c001_set_mode, | 180 | .set_dma_mode = tc86c001_set_mode, |
@@ -202,7 +194,6 @@ static const struct ide_dma_ops tc86c001_dma_ops = { | |||
202 | 194 | ||
203 | static const struct ide_port_info tc86c001_chipset __devinitdata = { | 195 | static const struct ide_port_info tc86c001_chipset __devinitdata = { |
204 | .name = "TC86C001", | 196 | .name = "TC86C001", |
205 | .init_chipset = init_chipset_tc86c001, | ||
206 | .init_hwif = init_hwif_tc86c001, | 197 | .init_hwif = init_hwif_tc86c001, |
207 | .port_ops = &tc86c001_port_ops, | 198 | .port_ops = &tc86c001_port_ops, |
208 | .dma_ops = &tc86c001_dma_ops, | 199 | .dma_ops = &tc86c001_dma_ops, |
@@ -215,7 +206,30 @@ static const struct ide_port_info tc86c001_chipset __devinitdata = { | |||
215 | static int __devinit tc86c001_init_one(struct pci_dev *dev, | 206 | static int __devinit tc86c001_init_one(struct pci_dev *dev, |
216 | const struct pci_device_id *id) | 207 | const struct pci_device_id *id) |
217 | { | 208 | { |
218 | return ide_pci_init_one(dev, &tc86c001_chipset, NULL); | 209 | int rc; |
210 | |||
211 | rc = pci_enable_device(dev); | ||
212 | if (rc) | ||
213 | goto out; | ||
214 | |||
215 | rc = pci_request_region(dev, 5, DRV_NAME); | ||
216 | if (rc) { | ||
217 | printk(KERN_ERR DRV_NAME ": system control regs already in use"); | ||
218 | goto out_disable; | ||
219 | } | ||
220 | |||
221 | rc = ide_pci_init_one(dev, &tc86c001_chipset, NULL); | ||
222 | if (rc) | ||
223 | goto out_release; | ||
224 | |||
225 | goto out; | ||
226 | |||
227 | out_release: | ||
228 | pci_release_region(dev, 5); | ||
229 | out_disable: | ||
230 | pci_disable_device(dev); | ||
231 | out: | ||
232 | return rc; | ||
219 | } | 233 | } |
220 | 234 | ||
221 | static const struct pci_device_id tc86c001_pci_tbl[] = { | 235 | static const struct pci_device_id tc86c001_pci_tbl[] = { |