Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hauke Mehrtens and committed by
David S. Miller
b2395b8a eec73f1c

+9 -15
-2
drivers/bcma/bcma_private.h
··· 33 33 int bcma_bus_suspend(struct bcma_bus *bus); 34 34 int bcma_bus_resume(struct bcma_bus *bus); 35 35 #endif 36 - struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid, 37 - u8 unit); 38 36 39 37 /* scan.c */ 40 38 int bcma_bus_scan(struct bcma_bus *bus);
+1 -12
drivers/bcma/main.c
··· 78 78 return BCMA_CORE_CHIPCOMMON; 79 79 } 80 80 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 - 93 81 struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid, 94 82 u8 unit) 95 83 { ··· 89 101 } 90 102 return NULL; 91 103 } 104 + EXPORT_SYMBOL_GPL(bcma_find_core_unit); 92 105 93 106 bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value, 94 107 int timeout)
+8 -1
include/linux/bcma/bcma.h
··· 418 418 bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set); 419 419 } 420 420 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 + 422 429 extern bool bcma_core_is_enabled(struct bcma_device *core); 423 430 extern void bcma_core_disable(struct bcma_device *core, u32 flags); 424 431 extern int bcma_core_enable(struct bcma_device *core, u32 flags);