From 40f5a0ce2501d62d8653cb1fbfeb80e2a7013933 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 10 Feb 2007 23:50:39 +0000 Subject: [PATCH] backlight: simplify corgi_bl locking Now update_status has locking, we can remove the mutex from corgi_bl. Signed-off-by: Richard Purdie --- drivers/video/backlight/corgi_bl.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/video/backlight/corgi_bl.c b/drivers/video/backlight/corgi_bl.c index 05f36811ac..ce00e18a4e 100644 --- a/drivers/video/backlight/corgi_bl.c +++ b/drivers/video/backlight/corgi_bl.c @@ -22,7 +22,6 @@ #include static int corgibl_intensity; -static DEFINE_MUTEX(bl_mutex); static struct backlight_properties corgibl_data; static struct backlight_device *corgi_backlight_device; static struct corgibl_machinfo *bl_machinfo; @@ -45,9 +44,7 @@ static int corgibl_send_intensity(struct backlight_device *bd) if (corgibl_flags & CORGIBL_BATTLOW) intensity &= bl_machinfo->limit_mask; - mutex_lock(&bl_mutex); bl_machinfo->set_bl_intensity(intensity); - mutex_unlock(&bl_mutex); corgibl_intensity = intensity; @@ -66,7 +63,7 @@ static int corgibl_suspend(struct platform_device *pdev, pm_message_t state) struct backlight_device *bd = platform_get_drvdata(pdev); corgibl_flags |= CORGIBL_SUSPENDED; - corgibl_send_intensity(bd); + backlight_update_status(bd); return 0; } @@ -75,7 +72,7 @@ static int corgibl_resume(struct platform_device *pdev) struct backlight_device *bd = platform_get_drvdata(pdev); corgibl_flags &= ~CORGIBL_SUSPENDED; - corgibl_send_intensity(bd); + backlight_update_status(bd); return 0; } #else @@ -98,7 +95,7 @@ void corgibl_limit_intensity(int limit) corgibl_flags |= CORGIBL_BATTLOW; else corgibl_flags &= ~CORGIBL_BATTLOW; - corgibl_send_intensity(corgi_backlight_device); + backlight_update_status(corgi_backlight_device); } EXPORT_SYMBOL(corgibl_limit_intensity); @@ -126,7 +123,7 @@ static int corgibl_probe(struct platform_device *pdev) corgi_backlight_device->props.max_brightness = machinfo->max_intensity; corgi_backlight_device->props.power = FB_BLANK_UNBLANK; corgi_backlight_device->props.brightness = machinfo->default_intensity; - corgibl_send_intensity(corgi_backlight_device); + backlight_update_status(corgi_backlight_device); printk("Corgi Backlight Driver Initialized.\n"); return 0; @@ -138,7 +135,7 @@ static int corgibl_remove(struct platform_device *pdev) corgibl_data.power = 0; corgibl_data.brightness = 0; - corgibl_send_intensity(bd); + backlight_update_status(bd); backlight_device_unregister(bd); -- 2.39.5