Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290353
b: refs/heads/master
c: 8f9ada4
h: refs/heads/master
i:
  290351: f90fe29
v: v3
  • Loading branch information
Hauke Mehrtens authored and John W. Linville committed Feb 6, 2012
1 parent 938c4aa commit c444966
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 49dc9577155576b10ff79f0c1486c816b01f58bf
refs/heads/master: 8f9ada4fa1926e540b1562cb9bacb3e51a698c35
12 changes: 11 additions & 1 deletion trunk/drivers/bcma/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
MODULE_DESCRIPTION("Broadcom's specific AMBA driver");
MODULE_LICENSE("GPL");

/* contains the number the next bus should get. */
static unsigned int bcma_bus_next_num = 0;

/* bcma_buses_mutex locks the bcma_bus_next_num */
static DEFINE_MUTEX(bcma_buses_mutex);

static int bcma_bus_match(struct device *dev, struct device_driver *drv);
static int bcma_device_probe(struct device *dev);
static int bcma_device_remove(struct device *dev);
Expand Down Expand Up @@ -93,7 +99,7 @@ static int bcma_register_cores(struct bcma_bus *bus)

core->dev.release = bcma_release_core_dev;
core->dev.bus = &bcma_bus_type;
dev_set_name(&core->dev, "bcma%d:%d", 0/*bus->num*/, dev_id);
dev_set_name(&core->dev, "bcma%d:%d", bus->num, dev_id);

switch (bus->hosttype) {
case BCMA_HOSTTYPE_PCI:
Expand Down Expand Up @@ -137,6 +143,10 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
int err;
struct bcma_device *core;

mutex_lock(&bcma_buses_mutex);
bus->num = bcma_bus_next_num++;
mutex_unlock(&bcma_buses_mutex);

/* Scan for devices (cores) */
err = bcma_bus_scan(bus);
if (err) {
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/bcma/bcma.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ struct bcma_bus {
struct list_head cores;
u8 nr_cores;
u8 init_done:1;
u8 num;

struct bcma_drv_cc drv_cc;
struct bcma_drv_pci drv_pci;
Expand Down

0 comments on commit c444966

Please sign in to comment.