Skip to content

Commit b2395b8

Browse files
haukedavem330
authored andcommitted
bcma: export bcma_find_core_unit()
This function is used to get a specific core when there is more than one core of that specific type. This is used in bgmac to reset all GMAC cores. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Acked-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent eec73f1 commit b2395b8

3 files changed

Lines changed: 9 additions & 15 deletions

File tree

‎drivers/bcma/bcma_private.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ int __init bcma_bus_early_register(struct bcma_bus *bus,
3333
int bcma_bus_suspend(struct bcma_bus *bus);
3434
int bcma_bus_resume(struct bcma_bus *bus);
3535
#endif
36-
struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
37-
u8 unit);
3836

3937
/* scan.c */
4038
int bcma_bus_scan(struct bcma_bus *bus);

‎drivers/bcma/main.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,6 @@ static u16 bcma_cc_core_id(struct bcma_bus *bus)
7878
return BCMA_CORE_CHIPCOMMON;
7979
}
8080

81-
struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid)
82-
{
83-
struct bcma_device *core;
84-
85-
list_for_each_entry(core, &bus->cores, list) {
86-
if (core->id.id == coreid)
87-
return core;
88-
}
89-
return NULL;
90-
}
91-
EXPORT_SYMBOL_GPL(bcma_find_core);
92-
9381
struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
9482
u8 unit)
9583
{
@@ -101,6 +89,7 @@ struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
10189
}
10290
return NULL;
10391
}
92+
EXPORT_SYMBOL_GPL(bcma_find_core_unit);
10493

10594
bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
10695
int timeout)

‎include/linux/bcma/bcma.h‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,14 @@ static inline void bcma_maskset16(struct bcma_device *cc,
418418
bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set);
419419
}
420420

421-
extern struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid);
421+
extern struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
422+
u8 unit);
423+
static inline struct bcma_device *bcma_find_core(struct bcma_bus *bus,
424+
u16 coreid)
425+
{
426+
return bcma_find_core_unit(bus, coreid, 0);
427+
}
428+
422429
extern bool bcma_core_is_enabled(struct bcma_device *core);
423430
extern void bcma_core_disable(struct bcma_device *core, u32 flags);
424431
extern int bcma_core_enable(struct bcma_device *core, u32 flags);

0 commit comments

Comments
 (0)