Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100909
b: refs/heads/master
c: 43bda1a
h: refs/heads/master
i:
  100907: 74a8b1a
v: v3
  • Loading branch information
Ben Dooks authored and Russell King committed Jul 3, 2008
1 parent 81c2e5e commit 3620963
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b73125af69f93972625f4b655675f42ca4274eb
refs/heads/master: 43bda1a6d218744382547a2f8be3240d1c3a151b
16 changes: 11 additions & 5 deletions trunk/arch/arm/mach-pxa/pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,23 @@ struct pwm_device *pwm_request(int pwm_id, const char *label)
mutex_lock(&pwm_lock);

list_for_each_entry(pwm, &pwm_list, node) {
if (pwm->pwm_id == pwm_id && pwm->use_count == 0) {
pwm->use_count++;
pwm->label = label;
if (pwm->pwm_id == pwm_id) {
found = 1;
break;
}
}

mutex_unlock(&pwm_lock);
if (found) {
if (pwm->use_count == 0) {
pwm->use_count++;
pwm->label = label;
} else
pwm = ERR_PTR(-EBUSY);
} else
pwm = ERR_PTR(-ENOENT);

return (found) ? pwm : NULL;
mutex_unlock(&pwm_lock);
return pwm;
}
EXPORT_SYMBOL(pwm_request);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/video/backlight/pwm_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->notify = data->notify;

pb->pwm = pwm_request(data->pwm_id, "backlight");
if (pb->pwm == NULL) {
if (IS_ERR(pb->pwm)) {
dev_err(&pdev->dev, "unable to request PWM for backlight\n");
ret = -EBUSY;
ret = PTR_ERR(pb->pwm);
goto err_pwm;
}

Expand Down

0 comments on commit 3620963

Please sign in to comment.