hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/bcma/main.c
....@@ -223,8 +223,8 @@
223223 mips_irq = bcma_core_mips_irq(core);
224224 return mips_irq <= 4 ? mips_irq + 2 : 0;
225225 }
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);
228228 return 0;
229229 case BCMA_HOSTTYPE_SDIO:
230230 return 0;
....@@ -240,18 +240,18 @@
240240 core->dev.release = bcma_release_core_dev;
241241 core->dev.bus = &bcma_bus_type;
242242 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);
246246
247247 switch (bus->hosttype) {
248248 case BCMA_HOSTTYPE_PCI:
249
- core->dma_dev = &bus->host_pci->dev;
249
+ core->dma_dev = bus->dev;
250250 core->irq = bus->host_pci->irq;
251251 break;
252252 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;
255255 } else {
256256 core->dev.dma_mask = &core->dev.coherent_dma_mask;
257257 core->dma_dev = &core->dev;
....@@ -260,28 +260,6 @@
260260 case BCMA_HOSTTYPE_SDIO:
261261 break;
262262 }
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;
285263 }
286264
287265 void bcma_init_bus(struct bcma_bus *bus)
....@@ -402,7 +380,6 @@
402380 {
403381 int err;
404382 struct bcma_device *core;
405
- struct device *dev;
406383
407384 /* Scan for devices (cores) */
408385 err = bcma_bus_scan(bus);
....@@ -425,10 +402,8 @@
425402 bcma_core_pci_early_init(&bus->drv_pci[0]);
426403 }
427404
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);
432407
433408 /* Cores providing flash access go before SPROM init */
434409 list_for_each_entry(core, &bus->cores, list) {