UPSTREAM: pwm: Introduce the pwm_state concept
[firefly-linux-kernel-4.4.55.git] / drivers / pwm / core.c
index ab86ecddbe1419cc33c2059882d8c3ae78f916f4..d2ea7f6ef6dd5ad454ee8fe1ce670d4575381673 100644 (file)
@@ -269,7 +269,7 @@ int pwmchip_add_with_polarity(struct pwm_chip *chip,
                pwm->chip = chip;
                pwm->pwm = chip->base + i;
                pwm->hwpwm = i;
-               pwm->polarity = polarity;
+               pwm->state.polarity = polarity;
 
                radix_tree_insert(&pwm_tree, pwm->pwm, pwm);
        }
@@ -449,8 +449,8 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
        if (err)
                return err;
 
-       pwm->duty_cycle = duty_ns;
-       pwm->period = period_ns;
+       pwm->state.duty_cycle = duty_ns;
+       pwm->state.period = period_ns;
 
        return 0;
 }
@@ -483,7 +483,7 @@ int pwm_set_polarity(struct pwm_device *pwm, enum pwm_polarity polarity)
        if (err)
                return err;
 
-       pwm->polarity = polarity;
+       pwm->state.polarity = polarity;
 
        return 0;
 }