cy82c693: fix build for CONFIG_HOTPLUG=n
PATCH 1/1 cy82c693: fix build for CONFIG_HOTPLUG=n
Quoted 8 lines · Avuton Olrich
My randconfig script the attached config caught an error on:
drivers/ide/pci/cy82c693.c:439: error: primary causes a section type conflictMy git tree:
c00046c279a2521075250fad682ca0acc10d4fd7Bisected to:
8562043606430185cad26d085d46adcc7ad67fd1is first bad commit commit8562043606430185cad26d085d46adcc7ad67fd1
Quoted 6 lines
Author: Bartlomiej Zolnierkiewicz <[email protected]> Date: Sat Oct 20 00:32:34 2007 +0200ide: constify struct
ide_port_infoSigned-off-by Bartlomiej Zolnierkiewicz <[email protected]>
It turns out that const and __{dev}initdata cannot be mixed currently.
This patch workarounds the problem by removing __devinitdata tag from 'primary' variable (which makes 'primary' to be moved from .init.data to .bss section). Now all __devinitdata data in cy82c693 host driver are read-only so it builds again (driver's .init.data section gets marked as READONLY).
While at it:
* Move 'primary' variable to its only user, init_iops_cy82c693().
* Bump driver version.
---
Even if we decide to revert commit 8562043606430185cad26d085d46adcc7ad67fd1 later it is worth to have the (independent) changes contained in this patch.
drivers/ide/pci/cy82c693.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/ide/pci/cy82c693.c +3 -3
@@ -1,5 +1,5 @@/* -* linux/drivers/ide/pci/cy82c693.c Version 0.41 Aug 27, 2007 +* linux/drivers/ide/pci/cy82c693.c Version 0.42 Oct 23, 2007 * * Copyright (C) 1998-2000 Andreas S. Krebs ([email protected]), Maintainer * Copyright (C) 1998-2002 Andre Hedrick <[email protected]>, Integrator
@@ -436,10 +436,10 @@ static void __devinit init_hwif_cy82c693 hwif->ide_dma_on = &cy82c693_ide_dma_on; } -static __devinitdata ide_hwif_t *primary; -static void __devinit init_iops_cy82c693 (ide_hwif_t *hwif) { +static ide_hwif_t *primary; +if (PCI_FUNC (hwif->pci_dev->devfn) ==1 ) primary = hwif;else {