aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/backlight/lcd.c
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2007-02-08 22:53:55 +0000
committerRichard Purdie <rpurdie@rpsys.net>2007-02-20 08:38:45 +0000
commit249040dc7fd391186f420fe23a9b59d357103cac (patch)
treefa62127c1a66e752ff5f32aa53c3d986022e0851 /drivers/video/backlight/lcd.c
parent28ee086d5b36aab2931f6740e409bb0fb6c65e5f (diff)
backlight: Convert semaphore -> mutex
Convert internal semaphore to a mutex Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/video/backlight/lcd.c')
-rw-r--r--drivers/video/backlight/lcd.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index 1e1e61a4b5d..430ba018a89 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -31,11 +31,11 @@ static int fb_notifier_callback(struct notifier_block *self,
return 0;
ld = container_of(self, struct lcd_device, fb_notif);
- down(&ld->sem);
+ mutex_lock(&ld->props_lock);
if (ld->props)
if (!ld->props->check_fb || ld->props->check_fb(evdata->info))
ld->props->set_power(ld, *(int *)evdata->data);
- up(&ld->sem);
+ mutex_unlock(&ld->props_lock);
return 0;
}
@@ -66,12 +66,12 @@ static ssize_t lcd_show_power(struct class_device *cdev, char *buf)
int rc;
struct lcd_device *ld = to_lcd_device(cdev);
- down(&ld->sem);
+ mutex_lock(&ld->props_lock);
if (ld->props && ld->props->get_power)
rc = sprintf(buf, "%d\n", ld->props->get_power(ld));
else
rc = -ENXIO;
- up(&ld->sem);
+ mutex_unlock(&ld->props_lock);
return rc;
}
@@ -89,13 +89,13 @@ static ssize_t lcd_store_power(struct class_device *cdev, const char *buf, size_
if (size != count)
return -EINVAL;
- down(&ld->sem);
+ mutex_lock(&ld->props_lock);
if (ld->props && ld->props->set_power) {
pr_debug("lcd: set power to %d\n", power);
ld->props->set_power(ld, power);
rc = count;
}
- up(&ld->sem);
+ mutex_unlock(&ld->props_lock);
return rc;
}
@@ -105,10 +105,10 @@ static ssize_t lcd_show_contrast(struct class_device *cdev, char *buf)
int rc = -ENXIO;
struct lcd_device *ld = to_lcd_device(cdev);
- down(&ld->sem);
+ mutex_lock(&ld->props_lock);
if (ld->props && ld->props->get_contrast)
rc = sprintf(buf, "%d\n", ld->props->get_contrast(ld));
- up(&ld->sem);
+ mutex_unlock(&ld->props_lock);
return rc;
}
@@ -126,13 +126,13 @@ static ssize_t lcd_store_contrast(struct class_device *cdev, const char *buf, si
if (size != count)
return -EINVAL;
- down(&ld->sem);
+ mutex_lock(&ld->props_lock);
if (ld->props && ld->props->set_contrast) {
pr_debug("lcd: set contrast to %d\n", contrast);
ld->props->set_contrast(ld, contrast);
rc = count;
}
- up(&ld->sem);
+ mutex_unlock(&ld->props_lock);
return rc;
}
@@ -142,10 +142,10 @@ static ssize_t lcd_show_max_contrast(struct class_device *cdev, char *buf)
int rc = -ENXIO;
struct lcd_device *ld = to_lcd_device(cdev);
- down(&ld->sem);
+ mutex_lock(&ld->props_lock);
if (ld->props)
rc = sprintf(buf, "%d\n", ld->props->max_contrast);
- up(&ld->sem);
+ mutex_unlock(&ld->props_lock);
return rc;
}
@@ -197,7 +197,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata,
if (!new_ld)
return ERR_PTR(-ENOMEM);
- init_MUTEX(&new_ld->sem);
+ mutex_init(&new_ld->props_lock);
mutex_init(&new_ld->update_lock);
new_ld->props = lp;
memset(&new_ld->class_dev, 0, sizeof(new_ld->class_dev));
@@ -253,9 +253,9 @@ void lcd_device_unregister(struct lcd_device *ld)
class_device_remove_file(&ld->class_dev,
&lcd_class_device_attributes[i]);
- down(&ld->sem);
+ mutex_lock(&ld->props_lock);
ld->props = NULL;
- up(&ld->sem);
+ mutex_unlock(&ld->props_lock);
lcd_unregister_fb(ld);
class_device_unregister(&ld->class_dev);
}