aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-26 14:31:15 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-26 14:31:15 -0400
commit282037f17f1db66f555b40eedef1215a5f4b36af (patch)
tree856757237f51efb1bfc3f8b575b14ae135b9cc4f /drivers/ide
parentf32d26ae2649c17df742f8db48b438eba2c38400 (diff)
hpt366: fix build for CONFIG_HOTPLUG=n
On Saturday 20 October 2007, Avuton Olrich wrote: > My randconfig script the attached config caught an error on: > drivers/ide/pci/cy82c693.c:439: error: primary causes a section type conflict > > My git tree: c00046c279a2521075250fad682ca0acc10d4fd7 > > Bisected to: > 8562043606430185cad26d085d46adcc7ad67fd1 is first bad commit > commit 8562043606430185cad26d085d46adcc7ad67fd1 > Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> > Date: Sat Oct 20 00:32:34 2007 +0200 > > ide: constify struct ide_port_info > > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> It turns out that const and __{dev}initdata cannot be mixed currently and that hpt366 host driver is also affected by the same issue: > drivers/ide/pci/hpt366.c:1428: error: hpt366_chipsets causes a section type > conflict This patch workarounds the problem by making static struct hpt_info instances const. Now all __devinitdata data in hpt366 host driver are read-only so it builds again (driver's .init.data section gets marked as READONLY). While at it: * Bump driver version. Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: "Avuton Olrich" <avuton@gmail.com> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/pci/hpt366.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index 612b795241bf..5682895d36d9 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/hpt366.c Version 1.20 Oct 1, 2007 2 * linux/drivers/ide/pci/hpt366.c Version 1.21 Oct 23, 2007
3 * 3 *
4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
5 * Portions Copyright (C) 2001 Sun Microsystems, Inc. 5 * Portions Copyright (C) 2001 Sun Microsystems, Inc.
@@ -433,7 +433,7 @@ static u32 *hpt37x_settings[NUM_ATA_CLOCKS] = {
433 sixty_six_base_hpt37x 433 sixty_six_base_hpt37x
434}; 434};
435 435
436static struct hpt_info hpt36x __devinitdata = { 436static const struct hpt_info hpt36x __devinitdata = {
437 .chip_name = "HPT36x", 437 .chip_name = "HPT36x",
438 .chip_type = HPT36x, 438 .chip_type = HPT36x,
439 .udma_mask = HPT366_ALLOW_ATA66_3 ? (HPT366_ALLOW_ATA66_4 ? ATA_UDMA4 : ATA_UDMA3) : ATA_UDMA2, 439 .udma_mask = HPT366_ALLOW_ATA66_3 ? (HPT366_ALLOW_ATA66_4 ? ATA_UDMA4 : ATA_UDMA3) : ATA_UDMA2,
@@ -441,7 +441,7 @@ static struct hpt_info hpt36x __devinitdata = {
441 .settings = hpt36x_settings 441 .settings = hpt36x_settings
442}; 442};
443 443
444static struct hpt_info hpt370 __devinitdata = { 444static const struct hpt_info hpt370 __devinitdata = {
445 .chip_name = "HPT370", 445 .chip_name = "HPT370",
446 .chip_type = HPT370, 446 .chip_type = HPT370,
447 .udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4, 447 .udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4,
@@ -449,7 +449,7 @@ static struct hpt_info hpt370 __devinitdata = {
449 .settings = hpt37x_settings 449 .settings = hpt37x_settings
450}; 450};
451 451
452static struct hpt_info hpt370a __devinitdata = { 452static const struct hpt_info hpt370a __devinitdata = {
453 .chip_name = "HPT370A", 453 .chip_name = "HPT370A",
454 .chip_type = HPT370A, 454 .chip_type = HPT370A,
455 .udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4, 455 .udma_mask = HPT370_ALLOW_ATA100_5 ? ATA_UDMA5 : ATA_UDMA4,
@@ -457,7 +457,7 @@ static struct hpt_info hpt370a __devinitdata = {
457 .settings = hpt37x_settings 457 .settings = hpt37x_settings
458}; 458};
459 459
460static struct hpt_info hpt374 __devinitdata = { 460static const struct hpt_info hpt374 __devinitdata = {
461 .chip_name = "HPT374", 461 .chip_name = "HPT374",
462 .chip_type = HPT374, 462 .chip_type = HPT374,
463 .udma_mask = ATA_UDMA5, 463 .udma_mask = ATA_UDMA5,
@@ -465,7 +465,7 @@ static struct hpt_info hpt374 __devinitdata = {
465 .settings = hpt37x_settings 465 .settings = hpt37x_settings
466}; 466};
467 467
468static struct hpt_info hpt372 __devinitdata = { 468static const struct hpt_info hpt372 __devinitdata = {
469 .chip_name = "HPT372", 469 .chip_name = "HPT372",
470 .chip_type = HPT372, 470 .chip_type = HPT372,
471 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 471 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -473,7 +473,7 @@ static struct hpt_info hpt372 __devinitdata = {
473 .settings = hpt37x_settings 473 .settings = hpt37x_settings
474}; 474};
475 475
476static struct hpt_info hpt372a __devinitdata = { 476static const struct hpt_info hpt372a __devinitdata = {
477 .chip_name = "HPT372A", 477 .chip_name = "HPT372A",
478 .chip_type = HPT372A, 478 .chip_type = HPT372A,
479 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 479 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -481,7 +481,7 @@ static struct hpt_info hpt372a __devinitdata = {
481 .settings = hpt37x_settings 481 .settings = hpt37x_settings
482}; 482};
483 483
484static struct hpt_info hpt302 __devinitdata = { 484static const struct hpt_info hpt302 __devinitdata = {
485 .chip_name = "HPT302", 485 .chip_name = "HPT302",
486 .chip_type = HPT302, 486 .chip_type = HPT302,
487 .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 487 .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -489,7 +489,7 @@ static struct hpt_info hpt302 __devinitdata = {
489 .settings = hpt37x_settings 489 .settings = hpt37x_settings
490}; 490};
491 491
492static struct hpt_info hpt371 __devinitdata = { 492static const struct hpt_info hpt371 __devinitdata = {
493 .chip_name = "HPT371", 493 .chip_name = "HPT371",
494 .chip_type = HPT371, 494 .chip_type = HPT371,
495 .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 495 .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -497,7 +497,7 @@ static struct hpt_info hpt371 __devinitdata = {
497 .settings = hpt37x_settings 497 .settings = hpt37x_settings
498}; 498};
499 499
500static struct hpt_info hpt372n __devinitdata = { 500static const struct hpt_info hpt372n __devinitdata = {
501 .chip_name = "HPT372N", 501 .chip_name = "HPT372N",
502 .chip_type = HPT372N, 502 .chip_type = HPT372N,
503 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 503 .udma_mask = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -505,7 +505,7 @@ static struct hpt_info hpt372n __devinitdata = {
505 .settings = hpt37x_settings 505 .settings = hpt37x_settings
506}; 506};
507 507
508static struct hpt_info hpt302n __devinitdata = { 508static const struct hpt_info hpt302n __devinitdata = {
509 .chip_name = "HPT302N", 509 .chip_name = "HPT302N",
510 .chip_type = HPT302N, 510 .chip_type = HPT302N,
511 .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 511 .udma_mask = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -513,7 +513,7 @@ static struct hpt_info hpt302n __devinitdata = {
513 .settings = hpt37x_settings 513 .settings = hpt37x_settings
514}; 514};
515 515
516static struct hpt_info hpt371n __devinitdata = { 516static const struct hpt_info hpt371n __devinitdata = {
517 .chip_name = "HPT371N", 517 .chip_name = "HPT371N",
518 .chip_type = HPT371N, 518 .chip_type = HPT371N,
519 .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5, 519 .udma_mask = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
@@ -1508,7 +1508,7 @@ static const struct ide_port_info hpt366_chipsets[] __devinitdata = {
1508 */ 1508 */
1509static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_device_id *id) 1509static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_device_id *id)
1510{ 1510{
1511 struct hpt_info *info = NULL; 1511 const struct hpt_info *info = NULL;
1512 struct pci_dev *dev2 = NULL; 1512 struct pci_dev *dev2 = NULL;
1513 struct ide_port_info d; 1513 struct ide_port_info d;
1514 u8 idx = id->driver_data; 1514 u8 idx = id->driver_data;
@@ -1522,7 +1522,7 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
1522 if (rev < 3) 1522 if (rev < 3)
1523 info = &hpt36x; 1523 info = &hpt36x;
1524 else { 1524 else {
1525 static struct hpt_info *hpt37x_info[] = 1525 static const struct hpt_info *hpt37x_info[] =
1526 { &hpt370, &hpt370a, &hpt372, &hpt372n }; 1526 { &hpt370, &hpt370a, &hpt372, &hpt372n };
1527 1527
1528 info = hpt37x_info[min_t(u8, rev, 6) - 3]; 1528 info = hpt37x_info[min_t(u8, rev, 6) - 3];
@@ -1552,7 +1552,7 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
1552 d.name = info->chip_name; 1552 d.name = info->chip_name;
1553 d.udma_mask = info->udma_mask; 1553 d.udma_mask = info->udma_mask;
1554 1554
1555 pci_set_drvdata(dev, info); 1555 pci_set_drvdata(dev, (void *)info);
1556 1556
1557 if (info == &hpt36x || info == &hpt374) 1557 if (info == &hpt36x || info == &hpt374)
1558 dev2 = pci_get_slot(dev->bus, dev->devfn + 1); 1558 dev2 = pci_get_slot(dev->bus, dev->devfn + 1);
@@ -1560,7 +1560,7 @@ static int __devinit hpt366_init_one(struct pci_dev *dev, const struct pci_devic
1560 if (dev2) { 1560 if (dev2) {
1561 int ret; 1561 int ret;
1562 1562
1563 pci_set_drvdata(dev2, info); 1563 pci_set_drvdata(dev2, (void *)info);
1564 1564
1565 if (info == &hpt374) 1565 if (info == &hpt374)
1566 hpt374_init(dev, dev2); 1566 hpt374_init(dev, dev2);