mirror of https://gitee.com/openkylin/linux.git
greybus: connection: drop parent parameter from connection create
The parent parameter was only used for debug messages and to name the connection workqueue. Use the host-device device for this instead. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
2adaefb145
commit
582b3a1392
|
@ -106,7 +106,7 @@ int svc_update_connection(struct gb_interface *intf,
|
||||||
*/
|
*/
|
||||||
struct gb_connection *
|
struct gb_connection *
|
||||||
gb_connection_create_range(struct gb_host_device *hd,
|
gb_connection_create_range(struct gb_host_device *hd,
|
||||||
struct gb_bundle *bundle, struct device *parent,
|
struct gb_bundle *bundle,
|
||||||
u16 cport_id, u8 protocol_id, u32 ida_start,
|
u16 cport_id, u8 protocol_id, u32 ida_start,
|
||||||
u32 ida_end)
|
u32 ida_end)
|
||||||
{
|
{
|
||||||
|
@ -152,7 +152,7 @@ gb_connection_create_range(struct gb_host_device *hd,
|
||||||
INIT_LIST_HEAD(&connection->operations);
|
INIT_LIST_HEAD(&connection->operations);
|
||||||
|
|
||||||
connection->wq = alloc_workqueue("%s:%d", WQ_UNBOUND, 1,
|
connection->wq = alloc_workqueue("%s:%d", WQ_UNBOUND, 1,
|
||||||
dev_name(parent), cport_id);
|
dev_name(&hd->dev), hd_cport_id);
|
||||||
if (!connection->wq)
|
if (!connection->wq)
|
||||||
goto err_free_connection;
|
goto err_free_connection;
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ gb_connection_create_range(struct gb_host_device *hd,
|
||||||
|
|
||||||
retval = gb_connection_bind_protocol(connection);
|
retval = gb_connection_bind_protocol(connection);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
dev_err(parent, "%d: failed to bind protocol: %d\n",
|
dev_err(&hd->dev, "%d: failed to bind protocol: %d\n",
|
||||||
cport_id, retval);
|
cport_id, retval);
|
||||||
gb_connection_destroy(connection);
|
gb_connection_destroy(connection);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -218,7 +218,7 @@ struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
|
||||||
u16 cport_id, u8 protocol_id)
|
u16 cport_id, u8 protocol_id)
|
||||||
{
|
{
|
||||||
return gb_connection_create_range(bundle->intf->hd, bundle,
|
return gb_connection_create_range(bundle->intf->hd, bundle,
|
||||||
&bundle->dev, cport_id, protocol_id,
|
cport_id, protocol_id,
|
||||||
0, bundle->intf->hd->num_cports);
|
0, bundle->intf->hd->num_cports);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ int svc_update_connection(struct gb_interface *intf,
|
||||||
struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
|
struct gb_connection *gb_connection_create(struct gb_bundle *bundle,
|
||||||
u16 cport_id, u8 protocol_id);
|
u16 cport_id, u8 protocol_id);
|
||||||
struct gb_connection *gb_connection_create_range(struct gb_host_device *hd,
|
struct gb_connection *gb_connection_create_range(struct gb_host_device *hd,
|
||||||
struct gb_bundle *bundle, struct device *parent,
|
struct gb_bundle *bundle,
|
||||||
u16 cport_id, u8 protocol_id, u32 ida_start,
|
u16 cport_id, u8 protocol_id, u32 ida_start,
|
||||||
u32 ida_end);
|
u32 ida_end);
|
||||||
void gb_connection_destroy(struct gb_connection *connection);
|
void gb_connection_destroy(struct gb_connection *connection);
|
||||||
|
|
|
@ -101,7 +101,7 @@ int gb_create_bundle_connection(struct gb_interface *intf, u8 class)
|
||||||
if (!bundle)
|
if (!bundle)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (!gb_connection_create_range(bundle->intf->hd, bundle, &bundle->dev,
|
if (!gb_connection_create_range(bundle->intf->hd, bundle,
|
||||||
cport_id, protocol_id, ida_start,
|
cport_id, protocol_id, ida_start,
|
||||||
ida_end))
|
ida_end))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
@ -46,7 +46,7 @@ gb_ap_svc_connection_create(struct gb_host_device *hd)
|
||||||
{
|
{
|
||||||
struct gb_connection *connection;
|
struct gb_connection *connection;
|
||||||
|
|
||||||
connection = gb_connection_create_range(hd, NULL, &hd->dev,
|
connection = gb_connection_create_range(hd, NULL,
|
||||||
GB_SVC_CPORT_ID,
|
GB_SVC_CPORT_ID,
|
||||||
GREYBUS_PROTOCOL_SVC,
|
GREYBUS_PROTOCOL_SVC,
|
||||||
GB_SVC_CPORT_ID,
|
GB_SVC_CPORT_ID,
|
||||||
|
|
Loading…
Reference in New Issue