mirror of
https://github.com/torvalds/linux.git
synced 2026-11-23 23:11:40 +00:00
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 <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Signed-off-by: "Ricardo B. Marliere" <[email protected]> Reviewed-by: Alex Elder <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3bd291383c
commit
a13bd6f3c9
@@ -27,6 +27,36 @@ int greybus_disabled(void)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(greybus_disabled);
|
||||
|
||||
static int is_gb_host_device(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_hd_type;
|
||||
}
|
||||
|
||||
static int is_gb_module(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_module_type;
|
||||
}
|
||||
|
||||
static int is_gb_interface(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_interface_type;
|
||||
}
|
||||
|
||||
static int is_gb_control(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_control_type;
|
||||
}
|
||||
|
||||
static int is_gb_bundle(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_bundle_type;
|
||||
}
|
||||
|
||||
static int is_gb_svc(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_svc_type;
|
||||
}
|
||||
|
||||
static bool greybus_match_one_id(struct gb_bundle *bundle,
|
||||
const struct greybus_bundle_id *id)
|
||||
{
|
||||
|
||||
@@ -113,36 +113,6 @@ extern const struct device_type greybus_control_type;
|
||||
extern const struct device_type greybus_bundle_type;
|
||||
extern const struct device_type greybus_svc_type;
|
||||
|
||||
static inline int is_gb_host_device(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_hd_type;
|
||||
}
|
||||
|
||||
static inline int is_gb_module(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_module_type;
|
||||
}
|
||||
|
||||
static inline int is_gb_interface(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_interface_type;
|
||||
}
|
||||
|
||||
static inline int is_gb_control(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_control_type;
|
||||
}
|
||||
|
||||
static inline int is_gb_bundle(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_bundle_type;
|
||||
}
|
||||
|
||||
static inline int is_gb_svc(const struct device *dev)
|
||||
{
|
||||
return dev->type == &greybus_svc_type;
|
||||
}
|
||||
|
||||
static inline bool cport_id_valid(struct gb_host_device *hd, u16 cport_id)
|
||||
{
|
||||
return cport_id != CPORT_ID_BAD && cport_id < hd->num_cports;
|
||||
|
||||
Reference in New Issue
Block a user