OSDN Git Service

greybus: usb: use the bundle struct device instead of the connector
authorGreg Kroah-Hartman <gregkh@google.com>
Wed, 14 Oct 2015 18:20:00 +0000 (11:20 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 15 Oct 2015 16:19:15 +0000 (09:19 -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 usb driver to use the bundle pointer instead of the
connection pointer.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Reviewed-by: Alex Elder <elder@linaro.org>
drivers/staging/greybus/usb.c

index 2133d0d..6647868 100644 (file)
@@ -57,7 +57,8 @@ static void hcd_stop(struct usb_hcd *hcd)
        ret = gb_operation_sync(dev->connection, GB_USB_TYPE_HCD_STOP,
                                NULL, 0, NULL, 0);
        if (ret)
-               dev_err(&dev->connection->dev, "HCD stop failed '%d'\n", ret);
+               dev_err(&dev->connection->bundle->dev,
+                       "HCD stop failed '%d'\n", ret);
 }
 
 static int hcd_start(struct usb_hcd *hcd)
@@ -69,7 +70,8 @@ static int hcd_start(struct usb_hcd *hcd)
        ret = gb_operation_sync(dev->connection, GB_USB_TYPE_HCD_START,
                                NULL, 0, NULL, 0);
        if (ret) {
-               dev_err(&dev->connection->dev, "HCD start failed '%d'\n", ret);
+               dev_err(&dev->connection->bundle->dev,
+                       "HCD start failed '%d'\n", ret);
                return ret;
        }
 
@@ -161,7 +163,7 @@ static struct hc_driver usb_gb_hc_driver = {
 
 static int gb_usb_connection_init(struct gb_connection *connection)
 {
-       struct device *dev = &connection->dev;
+       struct device *dev = &connection->bundle->dev;
        struct gb_usb_device *gb_usb_dev;
        struct usb_hcd *hcd;
 
@@ -184,7 +186,7 @@ static int gb_usb_connection_init(struct gb_connection *connection)
         *        Disable for now.
         */
        if (1) {
-               dev_warn(&connection->dev, "USB protocol disabled\n");
+               dev_warn(dev, "USB protocol disabled\n");
                retval = -EPROTONOSUPPORT;
                goto err_put_hcd;
        }