greybus: gpio: use the bundle struct device instead of the connector
authorGreg Kroah-Hartman <gregkh@google.com>
Wed, 14 Oct 2015 18:17:55 +0000 (11:17 -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 gpio 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/gpio.c

index 5ac859e1c29039722791d8cc2dbc00bdf6f6feb6..5830dc9b87f3bfabe6034afa88a1e6ab3f2975f0 100644 (file)
@@ -353,7 +353,7 @@ static int gb_gpio_request_recv(u8 type, struct gb_operation *op)
        struct irq_desc *desc;
 
        if (type != GB_GPIO_TYPE_IRQ_EVENT) {
-               dev_err(&connection->dev,
+               dev_err(&connection->bundle->dev,
                        "unsupported unsolicited request: %u\n", type);
                return -EINVAL;
        }
@@ -648,7 +648,7 @@ static int gb_gpio_connection_init(struct gb_connection *connection)
        gpio = &ggc->chip;
 
        gpio->label = "greybus_gpio";
-       gpio->dev = &connection->dev;
+       gpio->dev = &connection->bundle->dev;
        gpio->owner = THIS_MODULE;
 
        gpio->request = gb_gpio_request;
@@ -666,15 +666,16 @@ static int gb_gpio_connection_init(struct gb_connection *connection)
 
        ret = gpiochip_add(gpio);
        if (ret) {
-               dev_err(&connection->dev, "failed to add gpio chip: %d\n",
-                       ret);
+               dev_err(&connection->bundle->dev,
+                       "failed to add gpio chip: %d\n", ret);
                goto err_free_lines;
        }
 
        ret = gb_gpio_irqchip_add(gpio, irqc, 0,
                                   handle_level_irq, IRQ_TYPE_NONE);
        if (ret) {
-               dev_err(&connection->dev, "failed to add irq chip: %d\n", ret);
+               dev_err(&connection->bundle->dev,
+                       "failed to add irq chip: %d\n", ret);
                goto irqchip_err;
        }