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

index d91905f0f7b3238725edd6024762b50cf3b8754d..c3a3a9dfc6b4bba905538ad355bef4fb8709f9c5 100644 (file)
@@ -196,7 +196,7 @@ static int gb_pwm_connection_init(struct gb_connection *connection)
 
        pwm = &pwmc->chip;
 
-       pwm->dev = &connection->dev;
+       pwm->dev = &connection->bundle->dev;
        pwm->ops = &gb_pwm_ops;
        pwm->base = -1;                 /* Allocate base dynamically */
        pwm->npwm = pwmc->pwm_max + 1;
@@ -204,7 +204,8 @@ static int gb_pwm_connection_init(struct gb_connection *connection)
 
        ret = pwmchip_add(pwm);
        if (ret) {
-               dev_err(&connection->dev, "failed to register PWM: %d\n", ret);
+               dev_err(&connection->bundle->dev,
+                       "failed to register PWM: %d\n", ret);
                goto out_err;
        }