Skip to content

Commit

Permalink
bcma: use helper function to set core dev's parent
Browse files Browse the repository at this point in the history
A tiny code deduplication thanks to the bcma_bus_get_host_dev.

Signed-off-by: Rafał Miłecki <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
Rafał Miłecki authored and Kalle Valo committed Mar 20, 2017
1 parent 48d1977 commit 5e48a4c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/bcma/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,16 @@ void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
core->dev.release = bcma_release_core_dev;
core->dev.bus = &bcma_bus_type;
dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index);
core->dev.parent = bcma_bus_get_host_dev(bus);

switch (bus->hosttype) {
case BCMA_HOSTTYPE_PCI:
core->dev.parent = &bus->host_pci->dev;
core->dma_dev = &bus->host_pci->dev;
core->irq = bus->host_pci->irq;
break;
case BCMA_HOSTTYPE_SOC:
if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) {
core->dma_dev = &bus->host_pdev->dev;
core->dev.parent = &bus->host_pdev->dev;
if (core->dev.parent)
bcma_of_fill_device(core->dev.parent, core);
} else {
Expand Down

0 comments on commit 5e48a4c

Please sign in to comment.