summaryrefslogtreecommitdiff
path: root/drivers/pwm/sysfs.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2015-07-01 10:21:50 +0200
committerThierry Reding <thierry.reding@gmail.com>2015-07-20 09:53:22 +0200
commit15da7b5001e498fa7dc619d4d7951f9665b071e4 (patch)
treeb6326e565d42eed52a157f84440475f84760e958 /drivers/pwm/sysfs.c
parent011e76314818b6a24d5347b2d83b8a577e6aaae6 (diff)
pwm: Make use of pwm_get_xxx() helpers where appropriate
Use the pwm_get_xxx() helpers instead of directly accessing the fields in struct pwm_device. This will allow us to smoothly move to the atomic update approach. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/sysfs.c')
-rw-r--r--drivers/pwm/sysfs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/pwm/sysfs.c b/drivers/pwm/sysfs.c
index eecf21d68108..ac0abecfbaa0 100644
--- a/drivers/pwm/sysfs.c
+++ b/drivers/pwm/sysfs.c
@@ -46,7 +46,7 @@ static ssize_t pwm_period_show(struct device *child,
{
const struct pwm_device *pwm = child_to_pwm_device(child);
- return sprintf(buf, "%u\n", pwm->period);
+ return sprintf(buf, "%u\n", pwm_get_period(pwm));
}
static ssize_t pwm_period_store(struct device *child,
@@ -61,7 +61,7 @@ static ssize_t pwm_period_store(struct device *child,
if (ret)
return ret;
- ret = pwm_config(pwm, pwm->duty_cycle, val);
+ ret = pwm_config(pwm, pwm_get_duty_cycle(pwm), val);
return ret ? : size;
}
@@ -72,7 +72,7 @@ static ssize_t pwm_duty_cycle_show(struct device *child,
{
const struct pwm_device *pwm = child_to_pwm_device(child);
- return sprintf(buf, "%u\n", pwm->duty_cycle);
+ return sprintf(buf, "%u\n", pwm_get_duty_cycle(pwm));
}
static ssize_t pwm_duty_cycle_store(struct device *child,
@@ -87,7 +87,7 @@ static ssize_t pwm_duty_cycle_store(struct device *child,
if (ret)
return ret;
- ret = pwm_config(pwm, val, pwm->period);
+ ret = pwm_config(pwm, val, pwm_get_period(pwm));
return ret ? : size;
}
@@ -134,7 +134,8 @@ static ssize_t pwm_polarity_show(struct device *child,
{
const struct pwm_device *pwm = child_to_pwm_device(child);
- return sprintf(buf, "%s\n", pwm->polarity ? "inversed" : "normal");
+ return sprintf(buf, "%s\n",
+ pwm_get_polarity(pwm) ? "inversed" : "normal");
}
static ssize_t pwm_polarity_store(struct device *child,