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.

greybus: move is_gb_* functions out of greybus.h

The functions below are only used within the context of
drivers/greybus/core.c, so move them all into core and drop their 'inline'
specifiers:

is_gb_host_device(), is_gb_module(), is_gb_interface(), is_gb_control(),
is_gb_bundle() and is_gb_svc().

Suggested-by: Alex Elder <elder@ieee.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/20240226-device_cleanup-greybus2-v1-1-5f7d1161e684@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ricardo B. Marliere and committed by
Greg Kroah-Hartman
a13bd6f3 3bd29138

+30 -30
+30
drivers/greybus/core.c
··· 27 27 } 28 28 EXPORT_SYMBOL_GPL(greybus_disabled); 29 29 30 + static int is_gb_host_device(const struct device *dev) 31 + { 32 + return dev->type == &greybus_hd_type; 33 + } 34 + 35 + static int is_gb_module(const struct device *dev) 36 + { 37 + return dev->type == &greybus_module_type; 38 + } 39 + 40 + static int is_gb_interface(const struct device *dev) 41 + { 42 + return dev->type == &greybus_interface_type; 43 + } 44 + 45 + static int is_gb_control(const struct device *dev) 46 + { 47 + return dev->type == &greybus_control_type; 48 + } 49 + 50 + static int is_gb_bundle(const struct device *dev) 51 + { 52 + return dev->type == &greybus_bundle_type; 53 + } 54 + 55 + static int is_gb_svc(const struct device *dev) 56 + { 57 + return dev->type == &greybus_svc_type; 58 + } 59 + 30 60 static bool greybus_match_one_id(struct gb_bundle *bundle, 31 61 const struct greybus_bundle_id *id) 32 62 {
-30
include/linux/greybus.h
··· 113 113 extern const struct device_type greybus_bundle_type; 114 114 extern const struct device_type greybus_svc_type; 115 115 116 - static inline int is_gb_host_device(const struct device *dev) 117 - { 118 - return dev->type == &greybus_hd_type; 119 - } 120 - 121 - static inline int is_gb_module(const struct device *dev) 122 - { 123 - return dev->type == &greybus_module_type; 124 - } 125 - 126 - static inline int is_gb_interface(const struct device *dev) 127 - { 128 - return dev->type == &greybus_interface_type; 129 - } 130 - 131 - static inline int is_gb_control(const struct device *dev) 132 - { 133 - return dev->type == &greybus_control_type; 134 - } 135 - 136 - static inline int is_gb_bundle(const struct device *dev) 137 - { 138 - return dev->type == &greybus_bundle_type; 139 - } 140 - 141 - static inline int is_gb_svc(const struct device *dev) 142 - { 143 - return dev->type == &greybus_svc_type; 144 - } 145 - 146 116 static inline bool cport_id_valid(struct gb_host_device *hd, u16 cport_id) 147 117 { 148 118 return cport_id != CPORT_ID_BAD && cport_id < hd->num_cports;