Skip to content

Commit

Permalink
ssb: add __devinit to some functions
Browse files Browse the repository at this point in the history
Two functions in ssb are using register_pci_controller() which is
__devinit. The functions ssb_pcicore_init_hostmode() and
ssb_gige_probe() should also be __devinit.

This fixes the following warning:
WARNING: vmlinux.o(.text+0x2727b8): Section mismatch in reference from the function ssb_pcicore_init_hostmode() to the function .devinit.text:register_pci_controller()
The function ssb_pcicore_init_hostmode() references
the function __devinit register_pci_controller().
This is often because ssb_pcicore_init_hostmode lacks a __devinit
annotation or the annotation of register_pci_controller is wrong.

WARNING: vmlinux.o(.text+0x273398): Section mismatch in reference from the function ssb_gige_probe() to the function .devinit.text:register_pci_controller()
The function ssb_gige_probe() references
the function __devinit register_pci_controller().
This is often because ssb_gige_probe lacks a __devinit
annotation or the annotation of register_pci_controller is wrong.

Reported-by: Ralf Baechle <[email protected]>
Signed-off-by: Hauke Mehrtens <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
hauke authored and linvjw committed Jun 22, 2011
1 parent 999a7a8 commit cd15598
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 32 deletions.
4 changes: 2 additions & 2 deletions drivers/net/b44.c
Original file line number Diff line number Diff line change
Expand Up @@ -2335,7 +2335,7 @@ static struct ssb_driver b44_ssb_driver = {
.resume = b44_resume,
};

static inline int b44_pci_init(void)
static inline int __init b44_pci_init(void)
{
int err = 0;
#ifdef CONFIG_B44_PCI
Expand All @@ -2344,7 +2344,7 @@ static inline int b44_pci_init(void)
return err;
}

static inline void b44_pci_exit(void)
static inline void __exit b44_pci_exit(void)
{
#ifdef CONFIG_B44_PCI
ssb_pcihost_unregister(&b44_pci_driver);
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/wireless/b43/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ void b43_sdio_free_irq(struct b43_wldev *dev)
sdio->irq_handler = NULL;
}

static int b43_sdio_probe(struct sdio_func *func,
const struct sdio_device_id *id)
static int __devinit b43_sdio_probe(struct sdio_func *func,
const struct sdio_device_id *id)
{
struct b43_sdio *sdio;
struct sdio_func_tuple *tuple;
Expand Down Expand Up @@ -171,7 +171,7 @@ static int b43_sdio_probe(struct sdio_func *func,
return error;
}

static void b43_sdio_remove(struct sdio_func *func)
static void __devexit b43_sdio_remove(struct sdio_func *func)
{
struct b43_sdio *sdio = sdio_get_drvdata(func);

Expand Down
13 changes: 8 additions & 5 deletions drivers/ssb/driver_gige.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ void gige_pcicfg_write32(struct ssb_gige *dev,
gige_write32(dev, SSB_GIGE_PCICFG + offset, value);
}

static int ssb_gige_pci_read_config(struct pci_bus *bus, unsigned int devfn,
int reg, int size, u32 *val)
static int __devinit ssb_gige_pci_read_config(struct pci_bus *bus,
unsigned int devfn, int reg,
int size, u32 *val)
{
struct ssb_gige *dev = container_of(bus->ops, struct ssb_gige, pci_ops);
unsigned long flags;
Expand Down Expand Up @@ -136,8 +137,9 @@ static int ssb_gige_pci_read_config(struct pci_bus *bus, unsigned int devfn,
return PCIBIOS_SUCCESSFUL;
}

static int ssb_gige_pci_write_config(struct pci_bus *bus, unsigned int devfn,
int reg, int size, u32 val)
static int __devinit ssb_gige_pci_write_config(struct pci_bus *bus,
unsigned int devfn, int reg,
int size, u32 val)
{
struct ssb_gige *dev = container_of(bus->ops, struct ssb_gige, pci_ops);
unsigned long flags;
Expand Down Expand Up @@ -166,7 +168,8 @@ static int ssb_gige_pci_write_config(struct pci_bus *bus, unsigned int devfn,
return PCIBIOS_SUCCESSFUL;
}

static int ssb_gige_probe(struct ssb_device *sdev, const struct ssb_device_id *id)
static int __devinit ssb_gige_probe(struct ssb_device *sdev,
const struct ssb_device_id *id)
{
struct ssb_gige *dev;
u32 base, tmslow, tmshigh;
Expand Down
10 changes: 5 additions & 5 deletions drivers/ssb/driver_pcicore.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ int ssb_pcicore_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
return ssb_mips_irq(extpci_core->dev) + 2;
}

static void ssb_pcicore_init_hostmode(struct ssb_pcicore *pc)
static void __devinit ssb_pcicore_init_hostmode(struct ssb_pcicore *pc)
{
u32 val;

Expand Down Expand Up @@ -379,7 +379,7 @@ static void ssb_pcicore_init_hostmode(struct ssb_pcicore *pc)
register_pci_controller(&ssb_pcicore_controller);
}

static int pcicore_is_in_hostmode(struct ssb_pcicore *pc)
static int __devinit pcicore_is_in_hostmode(struct ssb_pcicore *pc)
{
struct ssb_bus *bus = pc->dev->bus;
u16 chipid_top;
Expand Down Expand Up @@ -412,7 +412,7 @@ static int pcicore_is_in_hostmode(struct ssb_pcicore *pc)
* Workarounds.
**************************************************/

static void ssb_pcicore_fix_sprom_core_index(struct ssb_pcicore *pc)
static void __devinit ssb_pcicore_fix_sprom_core_index(struct ssb_pcicore *pc)
{
u16 tmp = pcicore_read16(pc, SSB_PCICORE_SPROM(0));
if (((tmp & 0xF000) >> 12) != pc->dev->core_index) {
Expand Down Expand Up @@ -514,13 +514,13 @@ static void ssb_pcicore_pcie_setup_workarounds(struct ssb_pcicore *pc)
* Generic and Clientmode operation code.
**************************************************/

static void ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
static void __devinit ssb_pcicore_init_clientmode(struct ssb_pcicore *pc)
{
/* Disable PCI interrupts. */
ssb_write32(pc->dev, SSB_INTVEC, 0);
}

void ssb_pcicore_init(struct ssb_pcicore *pc)
void __devinit ssb_pcicore_init(struct ssb_pcicore *pc)
{
struct ssb_device *dev = pc->dev;

Expand Down
29 changes: 15 additions & 14 deletions drivers/ssb/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ static int ssb_devices_register(struct ssb_bus *bus)
}

/* Needs ssb_buses_lock() */
static int ssb_attach_queued_buses(void)
static int __devinit ssb_attach_queued_buses(void)
{
struct ssb_bus *bus, *n;
int err = 0;
Expand Down Expand Up @@ -768,9 +768,9 @@ static int ssb_fetch_invariants(struct ssb_bus *bus,
return err;
}

static int ssb_bus_register(struct ssb_bus *bus,
ssb_invariants_func_t get_invariants,
unsigned long baseaddr)
static int __devinit ssb_bus_register(struct ssb_bus *bus,
ssb_invariants_func_t get_invariants,
unsigned long baseaddr)
{
int err;

Expand Down Expand Up @@ -851,8 +851,8 @@ static int ssb_bus_register(struct ssb_bus *bus,
}

#ifdef CONFIG_SSB_PCIHOST
int ssb_bus_pcibus_register(struct ssb_bus *bus,
struct pci_dev *host_pci)
int __devinit ssb_bus_pcibus_register(struct ssb_bus *bus,
struct pci_dev *host_pci)
{
int err;

Expand All @@ -875,9 +875,9 @@ EXPORT_SYMBOL(ssb_bus_pcibus_register);
#endif /* CONFIG_SSB_PCIHOST */

#ifdef CONFIG_SSB_PCMCIAHOST
int ssb_bus_pcmciabus_register(struct ssb_bus *bus,
struct pcmcia_device *pcmcia_dev,
unsigned long baseaddr)
int __devinit ssb_bus_pcmciabus_register(struct ssb_bus *bus,
struct pcmcia_device *pcmcia_dev,
unsigned long baseaddr)
{
int err;

Expand All @@ -897,8 +897,9 @@ EXPORT_SYMBOL(ssb_bus_pcmciabus_register);
#endif /* CONFIG_SSB_PCMCIAHOST */

#ifdef CONFIG_SSB_SDIOHOST
int ssb_bus_sdiobus_register(struct ssb_bus *bus, struct sdio_func *func,
unsigned int quirks)
int __devinit ssb_bus_sdiobus_register(struct ssb_bus *bus,
struct sdio_func *func,
unsigned int quirks)
{
int err;

Expand All @@ -918,9 +919,9 @@ int ssb_bus_sdiobus_register(struct ssb_bus *bus, struct sdio_func *func,
EXPORT_SYMBOL(ssb_bus_sdiobus_register);
#endif /* CONFIG_SSB_PCMCIAHOST */

int ssb_bus_ssbbus_register(struct ssb_bus *bus,
unsigned long baseaddr,
ssb_invariants_func_t get_invariants)
int __devinit ssb_bus_ssbbus_register(struct ssb_bus *bus,
unsigned long baseaddr,
ssb_invariants_func_t get_invariants)
{
int err;

Expand Down
6 changes: 3 additions & 3 deletions drivers/ssb/pcihost_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ static int ssb_pcihost_resume(struct pci_dev *dev)
# define ssb_pcihost_resume NULL
#endif /* CONFIG_PM */

static int ssb_pcihost_probe(struct pci_dev *dev,
const struct pci_device_id *id)
static int __devinit ssb_pcihost_probe(struct pci_dev *dev,
const struct pci_device_id *id)
{
struct ssb_bus *ssb;
int err = -ENOMEM;
Expand Down Expand Up @@ -110,7 +110,7 @@ static void ssb_pcihost_remove(struct pci_dev *dev)
pci_set_drvdata(dev, NULL);
}

int ssb_pcihost_register(struct pci_driver *driver)
int __devinit ssb_pcihost_register(struct pci_driver *driver)
{
driver->probe = ssb_pcihost_probe;
driver->remove = ssb_pcihost_remove;
Expand Down

0 comments on commit cd15598

Please sign in to comment.