.. | .. |
---|
223 | 223 | mips_irq = bcma_core_mips_irq(core); |
---|
224 | 224 | return mips_irq <= 4 ? mips_irq + 2 : 0; |
---|
225 | 225 | } |
---|
226 | | - if (bus->host_pdev) |
---|
227 | | - return bcma_of_get_irq(&bus->host_pdev->dev, core, num); |
---|
| 226 | + if (bus->dev) |
---|
| 227 | + return bcma_of_get_irq(bus->dev, core, num); |
---|
228 | 228 | return 0; |
---|
229 | 229 | case BCMA_HOSTTYPE_SDIO: |
---|
230 | 230 | return 0; |
---|
.. | .. |
---|
240 | 240 | core->dev.release = bcma_release_core_dev; |
---|
241 | 241 | core->dev.bus = &bcma_bus_type; |
---|
242 | 242 | dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); |
---|
243 | | - core->dev.parent = bcma_bus_get_host_dev(bus); |
---|
244 | | - if (core->dev.parent) |
---|
245 | | - bcma_of_fill_device(core->dev.parent, core); |
---|
| 243 | + core->dev.parent = bus->dev; |
---|
| 244 | + if (bus->dev) |
---|
| 245 | + bcma_of_fill_device(bus->dev, core); |
---|
246 | 246 | |
---|
247 | 247 | switch (bus->hosttype) { |
---|
248 | 248 | case BCMA_HOSTTYPE_PCI: |
---|
249 | | - core->dma_dev = &bus->host_pci->dev; |
---|
| 249 | + core->dma_dev = bus->dev; |
---|
250 | 250 | core->irq = bus->host_pci->irq; |
---|
251 | 251 | break; |
---|
252 | 252 | case BCMA_HOSTTYPE_SOC: |
---|
253 | | - if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) { |
---|
254 | | - core->dma_dev = &bus->host_pdev->dev; |
---|
| 253 | + if (IS_ENABLED(CONFIG_OF) && bus->dev) { |
---|
| 254 | + core->dma_dev = bus->dev; |
---|
255 | 255 | } else { |
---|
256 | 256 | core->dev.dma_mask = &core->dev.coherent_dma_mask; |
---|
257 | 257 | core->dma_dev = &core->dev; |
---|
.. | .. |
---|
260 | 260 | case BCMA_HOSTTYPE_SDIO: |
---|
261 | 261 | break; |
---|
262 | 262 | } |
---|
263 | | -} |
---|
264 | | - |
---|
265 | | -struct device *bcma_bus_get_host_dev(struct bcma_bus *bus) |
---|
266 | | -{ |
---|
267 | | - switch (bus->hosttype) { |
---|
268 | | - case BCMA_HOSTTYPE_PCI: |
---|
269 | | - if (bus->host_pci) |
---|
270 | | - return &bus->host_pci->dev; |
---|
271 | | - else |
---|
272 | | - return NULL; |
---|
273 | | - case BCMA_HOSTTYPE_SOC: |
---|
274 | | - if (bus->host_pdev) |
---|
275 | | - return &bus->host_pdev->dev; |
---|
276 | | - else |
---|
277 | | - return NULL; |
---|
278 | | - case BCMA_HOSTTYPE_SDIO: |
---|
279 | | - if (bus->host_sdio) |
---|
280 | | - return &bus->host_sdio->dev; |
---|
281 | | - else |
---|
282 | | - return NULL; |
---|
283 | | - } |
---|
284 | | - return NULL; |
---|
285 | 263 | } |
---|
286 | 264 | |
---|
287 | 265 | void bcma_init_bus(struct bcma_bus *bus) |
---|
.. | .. |
---|
402 | 380 | { |
---|
403 | 381 | int err; |
---|
404 | 382 | struct bcma_device *core; |
---|
405 | | - struct device *dev; |
---|
406 | 383 | |
---|
407 | 384 | /* Scan for devices (cores) */ |
---|
408 | 385 | err = bcma_bus_scan(bus); |
---|
.. | .. |
---|
425 | 402 | bcma_core_pci_early_init(&bus->drv_pci[0]); |
---|
426 | 403 | } |
---|
427 | 404 | |
---|
428 | | - dev = bcma_bus_get_host_dev(bus); |
---|
429 | | - if (dev) { |
---|
430 | | - of_platform_default_populate(dev->of_node, NULL, dev); |
---|
431 | | - } |
---|
| 405 | + if (bus->dev) |
---|
| 406 | + of_platform_default_populate(bus->dev->of_node, NULL, bus->dev); |
---|
432 | 407 | |
---|
433 | 408 | /* Cores providing flash access go before SPROM init */ |
---|
434 | 409 | list_for_each_entry(core, &bus->cores, list) { |
---|