aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/amd74xx.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-24 16:53:17 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-24 16:53:17 -0400
commitd51f19c86583ca70468883d8137a92689f1a80c1 (patch)
tree2c94deec3c28505fa0533691778e3e7fb7ae8284 /drivers/ide/pci/amd74xx.c
parentb16040b14e766d390138b04c8829c816f4c1d95b (diff)
amd74xx: cleanup ->init_chipset method
Move amd_clock setup from init_chipset_amd74xx() to amd74xx_probe(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/amd74xx.c')
-rw-r--r--drivers/ide/pci/amd74xx.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index b6a475313c7c..5115d448ff83 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -173,24 +173,6 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev,
173 t |= 0xf0; 173 t |= 0xf0;
174 pci_write_config_byte(dev, AMD_IDE_CONFIG + offset, t); 174 pci_write_config_byte(dev, AMD_IDE_CONFIG + offset, t);
175 175
176/*
177 * Determine the system bus clock.
178 */
179
180 amd_clock = (ide_pci_clk ? ide_pci_clk : 33) * 1000;
181
182 switch (amd_clock) {
183 case 33000: amd_clock = 33333; break;
184 case 37000: amd_clock = 37500; break;
185 case 41000: amd_clock = 41666; break;
186 }
187
188 if (amd_clock < 20000 || amd_clock > 50000) {
189 printk(KERN_WARNING "%s: User given PCI clock speed impossible (%d), using 33 MHz instead.\n",
190 name, amd_clock);
191 amd_clock = 33333;
192 }
193
194 return dev->irq; 176 return dev->irq;
195} 177}
196 178
@@ -302,6 +284,24 @@ static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_
302 d.name, pci_name(dev), dev->revision, 284 d.name, pci_name(dev), dev->revision,
303 amd_dma[fls(d.udma_mask) - 1]); 285 amd_dma[fls(d.udma_mask) - 1]);
304 286
287 /*
288 * Determine the system bus clock.
289 */
290 amd_clock = (ide_pci_clk ? ide_pci_clk : 33) * 1000;
291
292 switch (amd_clock) {
293 case 33000: amd_clock = 33333; break;
294 case 37000: amd_clock = 37500; break;
295 case 41000: amd_clock = 41666; break;
296 }
297
298 if (amd_clock < 20000 || amd_clock > 50000) {
299 printk(KERN_WARNING "%s: User given PCI clock speed impossible"
300 " (%d), using 33 MHz instead.\n",
301 d.name, amd_clock);
302 amd_clock = 33333;
303 }
304
305 return ide_pci_init_one(dev, &d, NULL); 305 return ide_pci_init_one(dev, &d, NULL);
306} 306}
307 307