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

Configure Feed

Select the types of activity you want to include in your feed.

ARM: 9415/1: amba: Add dev_is_amba() function and export it for modules

Add dev_is_amba() function to determine
whether the device is a AMBA device.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

authored by

Kunwu Chan and committed by
Russell King (Oracle)
ad8d1e32 9852d85e

+11
+6
drivers/amba/bus.c
··· 449 449 }; 450 450 EXPORT_SYMBOL_GPL(amba_bustype); 451 451 452 + bool dev_is_amba(const struct device *dev) 453 + { 454 + return dev->bus == &amba_bustype; 455 + } 456 + EXPORT_SYMBOL_GPL(dev_is_amba); 457 + 452 458 static int __init amba_init(void) 453 459 { 454 460 return bus_register(&amba_bustype);
+5
include/linux/amba/bus.h
··· 121 121 #ifdef CONFIG_ARM_AMBA 122 122 int __amba_driver_register(struct amba_driver *, struct module *); 123 123 void amba_driver_unregister(struct amba_driver *); 124 + bool dev_is_amba(const struct device *dev); 124 125 #else 125 126 static inline int __amba_driver_register(struct amba_driver *drv, 126 127 struct module *owner) ··· 130 129 } 131 130 static inline void amba_driver_unregister(struct amba_driver *drv) 132 131 { 132 + } 133 + static inline bool dev_is_amba(const struct device *dev) 134 + { 135 + return false; 133 136 } 134 137 #endif 135 138