summaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-tegra.c
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@gmail.com>2016-07-11 12:08:29 +0300
committerThierry Reding <thierry.reding@gmail.com>2016-07-11 13:49:30 +0300
commitc009c56475a08fc8c0e1d4d4161bdcc76f3638b7 (patch)
treecf02b1166995229e3e12dc7d9cdc202963f8d0b4 /drivers/pwm/pwm-tegra.c
parentacfd92fdfb9384d54d9404101e8657e75c2372f3 (diff)
downloadlinux-c009c56475a08fc8c0e1d4d4161bdcc76f3638b7.tar.xz
pwm: tegra: Drop NUM_PWM macro
This macro is used to initialize the ->npwm field of the PWM chip. Use a literal instead and make all other places rely on ->npwm. Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-tegra.c')
-rw-r--r--drivers/pwm/pwm-tegra.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
index d4de0607b502..d42b636c9695 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -36,8 +36,6 @@
#define PWM_SCALE_WIDTH 13
#define PWM_SCALE_SHIFT 0
-#define NUM_PWM 4
-
struct tegra_pwm_chip {
struct pwm_chip chip;
struct device *dev;
@@ -192,7 +190,7 @@ static int tegra_pwm_probe(struct platform_device *pdev)
pwm->chip.dev = &pdev->dev;
pwm->chip.ops = &tegra_pwm_ops;
pwm->chip.base = -1;
- pwm->chip.npwm = NUM_PWM;
+ pwm->chip.npwm = 4;
ret = pwmchip_add(&pwm->chip);
if (ret < 0) {
@@ -206,12 +204,12 @@ static int tegra_pwm_probe(struct platform_device *pdev)
static int tegra_pwm_remove(struct platform_device *pdev)
{
struct tegra_pwm_chip *pc = platform_get_drvdata(pdev);
- int i;
+ unsigned int i;
if (WARN_ON(!pc))
return -ENODEV;
- for (i = 0; i < NUM_PWM; i++) {
+ for (i = 0; i < pc->chip.npwm; i++) {
struct pwm_device *pwm = &pc->chip.pwms[i];
if (!pwm_is_enabled(pwm))