mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 05:06:29 +00:00
greybus: connection: prevent drivers from specifying core flags
Prevent drivers from specifying core flags (currently only GB_CONNECTION_FLAG_CONTROL) when creating connections. Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
6910fa2dd6
commit
1ba30c3309
@ -260,6 +260,9 @@ gb_connection_create_flags(struct gb_bundle *bundle, u16 cport_id,
|
||||
{
|
||||
struct gb_interface *intf = bundle->intf;
|
||||
|
||||
if (WARN_ON_ONCE(flags & GB_CONNECTION_FLAG_CORE_MASK))
|
||||
flags &= ~GB_CONNECTION_FLAG_CORE_MASK;
|
||||
|
||||
return _gb_connection_create(intf->hd, -1, intf, bundle, cport_id,
|
||||
handler, flags);
|
||||
}
|
||||
@ -269,12 +272,9 @@ struct gb_connection *
|
||||
gb_connection_create_offloaded(struct gb_bundle *bundle, u16 cport_id,
|
||||
unsigned long flags)
|
||||
{
|
||||
struct gb_interface *intf = bundle->intf;
|
||||
|
||||
flags |= GB_CONNECTION_FLAG_OFFLOADED;
|
||||
|
||||
return _gb_connection_create(intf->hd, -1, intf, bundle, cport_id,
|
||||
NULL, flags);
|
||||
return gb_connection_create_flags(bundle, cport_id, NULL, flags);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gb_connection_create_offloaded);
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
#define GB_CONNECTION_FLAG_CDSI1 BIT(3)
|
||||
#define GB_CONNECTION_FLAG_CONTROL BIT(4)
|
||||
|
||||
#define GB_CONNECTION_FLAG_CORE_MASK GB_CONNECTION_FLAG_CONTROL
|
||||
|
||||
enum gb_connection_state {
|
||||
GB_CONNECTION_STATE_DISABLED = 0,
|
||||
GB_CONNECTION_STATE_ENABLED_TX = 1,
|
||||
|
Loading…
Reference in New Issue
Block a user