diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2013-05-24 19:27:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-30 08:54:05 -0400 |
commit | 5b2cd8f9b4a098d5aab91539ab5d589c6b676b1e (patch) | |
tree | 3828cb6d4dbac4a22fc05c68a30dd642945663a4 /drivers/misc | |
parent | 7501ba361f4b22004deec31a8227ca0240630193 (diff) |
misc/ep93xx_pwm: remove ep93xx_pwm_is_enabled() inline function
This is a simple wrapper around readl(), remove it.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Ryan Mallon <rmallon@gmail.com>
Cc: Matthieu Crapet <mcrapet@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/ep93xx_pwm.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/misc/ep93xx_pwm.c b/drivers/misc/ep93xx_pwm.c index 6f483753b435..3dd20069971c 100644 --- a/drivers/misc/ep93xx_pwm.c +++ b/drivers/misc/ep93xx_pwm.c | |||
@@ -39,11 +39,6 @@ struct ep93xx_pwm { | |||
39 | u32 duty_percent; | 39 | u32 duty_percent; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | static inline int ep93xx_pwm_is_enabled(struct ep93xx_pwm *pwm) | ||
43 | { | ||
44 | return readl(pwm->mmio_base + EP93XX_PWMx_ENABLE) & 0x1; | ||
45 | } | ||
46 | |||
47 | static inline int ep93xx_pwm_is_inverted(struct ep93xx_pwm *pwm) | 42 | static inline int ep93xx_pwm_is_inverted(struct ep93xx_pwm *pwm) |
48 | { | 43 | { |
49 | return readl(pwm->mmio_base + EP93XX_PWMx_INVERT) & 0x1; | 44 | return readl(pwm->mmio_base + EP93XX_PWMx_INVERT) & 0x1; |
@@ -84,7 +79,7 @@ static ssize_t ep93xx_pwm_get_freq(struct device *dev, | |||
84 | struct platform_device *pdev = to_platform_device(dev); | 79 | struct platform_device *pdev = to_platform_device(dev); |
85 | struct ep93xx_pwm *pwm = platform_get_drvdata(pdev); | 80 | struct ep93xx_pwm *pwm = platform_get_drvdata(pdev); |
86 | 81 | ||
87 | if (ep93xx_pwm_is_enabled(pwm)) { | 82 | if (readl(pwm->mmio_base + EP93XX_PWMx_ENABLE) & 0x1) { |
88 | unsigned long rate = clk_get_rate(pwm->clk); | 83 | unsigned long rate = clk_get_rate(pwm->clk); |
89 | u16 term = readl(pwm->mmio_base + EP93XX_PWMx_TERM_COUNT); | 84 | u16 term = readl(pwm->mmio_base + EP93XX_PWMx_TERM_COUNT); |
90 | 85 | ||
@@ -129,7 +124,7 @@ static ssize_t ep93xx_pwm_set_freq(struct device *dev, | |||
129 | writel(val, pwm->mmio_base + EP93XX_PWMx_TERM_COUNT); | 124 | writel(val, pwm->mmio_base + EP93XX_PWMx_TERM_COUNT); |
130 | } | 125 | } |
131 | 126 | ||
132 | if (!ep93xx_pwm_is_enabled(pwm)) | 127 | if (!readl(pwm->mmio_base + EP93XX_PWMx_ENABLE) & 0x1) |
133 | writel(0x1, pwm->mmio_base + EP93XX_PWMx_ENABLE); | 128 | writel(0x1, pwm->mmio_base + EP93XX_PWMx_ENABLE); |
134 | } else { | 129 | } else { |
135 | return -EINVAL; | 130 | return -EINVAL; |