greybus: protocol: use the bundle struct device instead of the connector
authorGreg Kroah-Hartman <gregkh@google.com>
Fri, 16 Oct 2015 23:54:18 +0000 (16:54 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 19 Oct 2015 19:09:10 +0000 (12:09 -0700)
We are removing struct device from the gb_connection structure in the
near future.  The gb_bundle structure's struct device should be used as
a replacement.

This patch moves the protocol code to use the bundle pointer instead of
the connection pointer when printing out error messages.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
drivers/staging/greybus/protocol.c

index 889cff2..1790d1a 100644 (file)
@@ -165,19 +165,19 @@ int gb_protocol_get_version(struct gb_connection *connection)
                return retval;
 
        if (response.major > connection->protocol->major) {
-               dev_err(&connection->dev,
-                       "unsupported major version (%hhu > %hhu)\n",
-                       response.major, connection->protocol->major);
+               dev_err(&connection->bundle->dev,
+                       "%d: unsupported major version (%hhu > %hhu)\n",
+                       connection->intf_cport_id, response.major,
+                       connection->protocol->major);
                return -ENOTSUPP;
        }
 
        connection->module_major = response.major;
        connection->module_minor = response.minor;
 
-
-       dev_dbg(&connection->dev, "%s - %s (0x%02hhx) v%hhu.%hhu\n", __func__,
-                       protocol->name, protocol->id,
-                       response.major, response.minor);
+       dev_dbg(&connection->bundle->dev,
+               "%d: %s (0x%02hhx) v%hhu.%hhu\n", connection->intf_cport_id,
+               protocol->name, protocol->id, response.major, response.minor);
 
        return 0;
 }