From 4c4b50218656d972295b2ecabd3aacb674e2fe11 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 25 Nov 2015 15:59:15 +0100 Subject: [PATCH] greybus: connection: handle static connections Use host-device device and connection name for log messages rather than assume that all connections have a bundle (e.g. not true for static connections). Note that the "initial" svc connection has never had a bundle. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/connection.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index 65d72b81ea8e..0ac3a8e5e486 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -208,8 +208,8 @@ gb_connection_create(struct gb_host_device *hd, int hd_cport_id, retval = gb_connection_bind_protocol(connection); if (retval) { - dev_err(&hd->dev, "%d: failed to bind protocol: %d\n", - cport_id, retval); + dev_err(&hd->dev, "%s: failed to bind protocol: %d\n", + connection->name, retval); gb_connection_destroy(connection); return NULL; } @@ -320,8 +320,9 @@ gb_connection_svc_connection_create(struct gb_connection *connection) connection->intf_cport_id, intf->boot_over_unipro); if (ret) { - dev_err(&connection->bundle->dev, - "failed to create svc connection: %d\n", ret); + dev_err(&connection->hd->dev, + "%s: failed to create svc connection: %d\n", + connection->name, ret); return ret; } @@ -513,8 +514,9 @@ void gb_connection_latency_tag_enable(struct gb_connection *connection) ret = hd->driver->latency_tag_enable(hd, connection->hd_cport_id); if (ret) { - dev_err(&connection->bundle->dev, - "failed to enable latency tag: %d\n", ret); + dev_err(&connection->hd->dev, + "%s: failed to enable latency tag: %d\n", + connection->name, ret); } } EXPORT_SYMBOL_GPL(gb_connection_latency_tag_enable); @@ -529,8 +531,9 @@ void gb_connection_latency_tag_disable(struct gb_connection *connection) ret = hd->driver->latency_tag_disable(hd, connection->hd_cport_id); if (ret) { - dev_err(&connection->bundle->dev, - "failed to disable latency tag: %d\n", ret); + dev_err(&connection->hd->dev, + "%s: failed to disable latency tag: %d\n", + connection->name, ret); } } EXPORT_SYMBOL_GPL(gb_connection_latency_tag_disable); -- 2.39.5