diff options
author | Michael Buesch <mb@bu3sch.de> | 2009-10-09 14:32:10 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:47:55 -0400 |
commit | 8b45499ccb8a93cd68b1a8766786c2f8ea991ae2 (patch) | |
tree | 49caca5ebfcd56a558cb259ef0799e7f8c647b41 | |
parent | 899110fe4e1b26f7a13e639c57e2a047d21bffa2 (diff) |
ssb: Put host pointers into a union
This slightly shrinks the structure.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/ssb/driver_pcicore.c | 4 | ||||
-rw-r--r-- | include/linux/ssb/ssb.h | 20 |
2 files changed, 14 insertions, 10 deletions
diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c index 538c570df337..f1dcd7969a5c 100644 --- a/drivers/ssb/driver_pcicore.c +++ b/drivers/ssb/driver_pcicore.c | |||
@@ -551,13 +551,13 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc, | |||
551 | might_sleep_if(pdev->id.coreid != SSB_DEV_PCI); | 551 | might_sleep_if(pdev->id.coreid != SSB_DEV_PCI); |
552 | 552 | ||
553 | /* Enable interrupts for this device. */ | 553 | /* Enable interrupts for this device. */ |
554 | if (bus->host_pci && | 554 | if ((pdev->id.revision >= 6) || (pdev->id.coreid == SSB_DEV_PCIE)) { |
555 | ((pdev->id.revision >= 6) || (pdev->id.coreid == SSB_DEV_PCIE))) { | ||
556 | u32 coremask; | 555 | u32 coremask; |
557 | 556 | ||
558 | /* Calculate the "coremask" for the device. */ | 557 | /* Calculate the "coremask" for the device. */ |
559 | coremask = (1 << dev->core_index); | 558 | coremask = (1 << dev->core_index); |
560 | 559 | ||
560 | SSB_WARN_ON(bus->bustype != SSB_BUSTYPE_PCI); | ||
561 | err = pci_read_config_dword(bus->host_pci, SSB_PCI_IRQMASK, &tmp); | 561 | err = pci_read_config_dword(bus->host_pci, SSB_PCI_IRQMASK, &tmp); |
562 | if (err) | 562 | if (err) |
563 | goto out; | 563 | goto out; |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 3d0a9ff24f01..24f988547361 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -269,7 +269,8 @@ struct ssb_bus { | |||
269 | 269 | ||
270 | const struct ssb_bus_ops *ops; | 270 | const struct ssb_bus_ops *ops; |
271 | 271 | ||
272 | /* The core in the basic address register window. (PCI bus only) */ | 272 | /* The core currently mapped into the MMIO window. |
273 | * Not valid on all host-buses. So don't use outside of SSB. */ | ||
273 | struct ssb_device *mapped_device; | 274 | struct ssb_device *mapped_device; |
274 | union { | 275 | union { |
275 | /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ | 276 | /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ |
@@ -281,14 +282,17 @@ struct ssb_bus { | |||
281 | * On PCMCIA-host busses this is used to protect the whole MMIO access. */ | 282 | * On PCMCIA-host busses this is used to protect the whole MMIO access. */ |
282 | spinlock_t bar_lock; | 283 | spinlock_t bar_lock; |
283 | 284 | ||
284 | /* The bus this backplane is running on. */ | 285 | /* The host-bus this backplane is running on. */ |
285 | enum ssb_bustype bustype; | 286 | enum ssb_bustype bustype; |
286 | /* Pointer to the PCI bus (only valid if bustype == SSB_BUSTYPE_PCI). */ | 287 | /* Pointers to the host-bus. Check bustype before using any of these pointers. */ |
287 | struct pci_dev *host_pci; | 288 | union { |
288 | /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ | 289 | /* Pointer to the PCI bus (only valid if bustype == SSB_BUSTYPE_PCI). */ |
289 | struct pcmcia_device *host_pcmcia; | 290 | struct pci_dev *host_pci; |
290 | /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */ | 291 | /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ |
291 | struct sdio_func *host_sdio; | 292 | struct pcmcia_device *host_pcmcia; |
293 | /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */ | ||
294 | struct sdio_func *host_sdio; | ||
295 | }; | ||
292 | 296 | ||
293 | /* See enum ssb_quirks */ | 297 | /* See enum ssb_quirks */ |
294 | unsigned int quirks; | 298 | unsigned int quirks; |