aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/setup-pci.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:34 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:34 -0400
commit8562043606430185cad26d085d46adcc7ad67fd1 (patch)
treeefcc9159a230eb62d023d38c465249ddaa252cc6 /drivers/ide/setup-pci.c
parent039788e1532368eeca1071a873c14e03920cdf38 (diff)
ide: constify struct ide_port_info
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/setup-pci.c')
-rw-r--r--drivers/ide/setup-pci.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 3517eb0eddbd..727544c205b9 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -155,7 +155,7 @@ static int ide_setup_pci_baseregs (struct pci_dev *dev, const char *name)
155 * and enforce IDE simplex rules. 155 * and enforce IDE simplex rules.
156 */ 156 */
157 157
158static unsigned long ide_get_or_set_dma_base(struct ide_port_info *d, ide_hwif_t *hwif) 158static unsigned long ide_get_or_set_dma_base(const struct ide_port_info *d, ide_hwif_t *hwif)
159{ 159{
160 unsigned long dma_base = 0; 160 unsigned long dma_base = 0;
161 struct pci_dev *dev = hwif->pci_dev; 161 struct pci_dev *dev = hwif->pci_dev;
@@ -225,7 +225,7 @@ static unsigned long ide_get_or_set_dma_base(struct ide_port_info *d, ide_hwif_t
225} 225}
226#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 226#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
227 227
228void ide_setup_pci_noise(struct pci_dev *dev, struct ide_port_info *d) 228void ide_setup_pci_noise(struct pci_dev *dev, const struct ide_port_info *d)
229{ 229{
230 printk(KERN_INFO "%s: IDE controller at PCI slot %s\n", 230 printk(KERN_INFO "%s: IDE controller at PCI slot %s\n",
231 d->name, pci_name(dev)); 231 d->name, pci_name(dev));
@@ -245,7 +245,7 @@ EXPORT_SYMBOL_GPL(ide_setup_pci_noise);
245 * Returns zero on success or an error code 245 * Returns zero on success or an error code
246 */ 246 */
247 247
248static int ide_pci_enable(struct pci_dev *dev, struct ide_port_info *d) 248static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
249{ 249{
250 int ret; 250 int ret;
251 251
@@ -290,7 +290,7 @@ out:
290 * Returns zero on success or an error code. 290 * Returns zero on success or an error code.
291 */ 291 */
292 292
293static int ide_pci_configure(struct pci_dev *dev, struct ide_port_info *d) 293static int ide_pci_configure(struct pci_dev *dev, const struct ide_port_info *d)
294{ 294{
295 u16 pcicmd = 0; 295 u16 pcicmd = 0;
296 /* 296 /*
@@ -326,7 +326,7 @@ static int ide_pci_configure(struct pci_dev *dev, struct ide_port_info *d)
326 * print an error and return an error code. Otherwise return 0 326 * print an error and return an error code. Otherwise return 0
327 */ 327 */
328 328
329static int ide_pci_check_iomem(struct pci_dev *dev, struct ide_port_info *d, int bar) 329static int ide_pci_check_iomem(struct pci_dev *dev, const struct ide_port_info *d, int bar)
330{ 330{
331 ulong flags = pci_resource_flags(dev, bar); 331 ulong flags = pci_resource_flags(dev, bar);
332 332
@@ -358,7 +358,7 @@ static int ide_pci_check_iomem(struct pci_dev *dev, struct ide_port_info *d, int
358 * Returns the new hardware interface structure, or NULL on a failure 358 * Returns the new hardware interface structure, or NULL on a failure
359 */ 359 */
360 360
361static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, struct ide_port_info *d, ide_hwif_t *mate, int port, int irq) 361static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, const struct ide_port_info *d, ide_hwif_t *mate, int port, int irq)
362{ 362{
363 unsigned long ctl = 0, base = 0; 363 unsigned long ctl = 0, base = 0;
364 ide_hwif_t *hwif; 364 ide_hwif_t *hwif;
@@ -423,7 +423,7 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, struct ide_port_info
423 * state 423 * state
424 */ 424 */
425 425
426static void ide_hwif_setup_dma(struct pci_dev *dev, struct ide_port_info *d, ide_hwif_t *hwif) 426static void ide_hwif_setup_dma(struct pci_dev *dev, const struct ide_port_info *d, ide_hwif_t *hwif)
427{ 427{
428#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 428#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
429 u16 pcicmd; 429 u16 pcicmd;
@@ -472,7 +472,7 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, struct ide_port_info *d, ide
472 * and enables it if need be 472 * and enables it if need be
473 */ 473 */
474 474
475static int ide_setup_pci_controller(struct pci_dev *dev, struct ide_port_info *d, int noisy, int *config) 475static int ide_setup_pci_controller(struct pci_dev *dev, const struct ide_port_info *d, int noisy, int *config)
476{ 476{
477 int ret; 477 int ret;
478 u16 pcicmd; 478 u16 pcicmd;
@@ -520,7 +520,7 @@ out:
520 * where the chipset setup is not the default PCI IDE one. 520 * where the chipset setup is not the default PCI IDE one.
521 */ 521 */
522 522
523void ide_pci_setup_ports(struct pci_dev *dev, struct ide_port_info *d, int pciirq, u8 *idx) 523void ide_pci_setup_ports(struct pci_dev *dev, const struct ide_port_info *d, int pciirq, u8 *idx)
524{ 524{
525 int channels = (d->host_flags & IDE_HFLAG_SINGLE) ? 1 : 2, port; 525 int channels = (d->host_flags & IDE_HFLAG_SINGLE) ? 1 : 2, port;
526 ide_hwif_t *hwif, *mate = NULL; 526 ide_hwif_t *hwif, *mate = NULL;
@@ -531,8 +531,8 @@ void ide_pci_setup_ports(struct pci_dev *dev, struct ide_port_info *d, int pciir
531 */ 531 */
532 532
533 for (port = 0; port < channels; ++port) { 533 for (port = 0; port < channels; ++port) {
534 ide_pci_enablebit_t *e = &(d->enablebits[port]); 534 const ide_pci_enablebit_t *e = &(d->enablebits[port]);
535 535
536 if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || 536 if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
537 (tmp & e->mask) != e->val)) { 537 (tmp & e->mask) != e->val)) {
538 printk(KERN_INFO "%s: IDE port disabled\n", d->name); 538 printk(KERN_INFO "%s: IDE port disabled\n", d->name);
@@ -611,7 +611,7 @@ EXPORT_SYMBOL_GPL(ide_pci_setup_ports);
611 * for all other chipsets, we just assume both interfaces are enabled. 611 * for all other chipsets, we just assume both interfaces are enabled.
612 */ 612 */
613static int do_ide_setup_pci_device(struct pci_dev *dev, 613static int do_ide_setup_pci_device(struct pci_dev *dev,
614 struct ide_port_info *d, 614 const struct ide_port_info *d,
615 u8 *idx, u8 noisy) 615 u8 *idx, u8 noisy)
616{ 616{
617 int tried_config = 0; 617 int tried_config = 0;
@@ -668,7 +668,7 @@ out:
668 return ret; 668 return ret;
669} 669}
670 670
671int ide_setup_pci_device(struct pci_dev *dev, struct ide_port_info *d) 671int ide_setup_pci_device(struct pci_dev *dev, const struct ide_port_info *d)
672{ 672{
673 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 673 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
674 int ret; 674 int ret;
@@ -684,7 +684,7 @@ int ide_setup_pci_device(struct pci_dev *dev, struct ide_port_info *d)
684EXPORT_SYMBOL_GPL(ide_setup_pci_device); 684EXPORT_SYMBOL_GPL(ide_setup_pci_device);
685 685
686int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2, 686int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2,
687 struct ide_port_info *d) 687 const struct ide_port_info *d)
688{ 688{
689 struct pci_dev *pdev[] = { dev1, dev2 }; 689 struct pci_dev *pdev[] = { dev1, dev2 };
690 int ret, i; 690 int ret, i;