diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2007-02-10 18:50:39 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2007-02-20 04:26:54 -0500 |
commit | 40f5a0ce2501d62d8653cb1fbfeb80e2a7013933 (patch) | |
tree | ef9f8c5d46d4a2aff70232e0a3b7db5017640573 /drivers/video | |
parent | 599a52d12629394236d785615808845823875868 (diff) |
backlight: simplify corgi_bl locking
Now update_status has locking, we can remove the mutex from corgi_bl.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/corgi_bl.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/video/backlight/corgi_bl.c b/drivers/video/backlight/corgi_bl.c index 05f36811ac95..ce00e18a4e5d 100644 --- a/drivers/video/backlight/corgi_bl.c +++ b/drivers/video/backlight/corgi_bl.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <asm/hardware/sharpsl_pm.h> | 22 | #include <asm/hardware/sharpsl_pm.h> |
23 | 23 | ||
24 | static int corgibl_intensity; | 24 | static int corgibl_intensity; |
25 | static DEFINE_MUTEX(bl_mutex); | ||
26 | static struct backlight_properties corgibl_data; | 25 | static struct backlight_properties corgibl_data; |
27 | static struct backlight_device *corgi_backlight_device; | 26 | static struct backlight_device *corgi_backlight_device; |
28 | static struct corgibl_machinfo *bl_machinfo; | 27 | static struct corgibl_machinfo *bl_machinfo; |
@@ -45,9 +44,7 @@ static int corgibl_send_intensity(struct backlight_device *bd) | |||
45 | if (corgibl_flags & CORGIBL_BATTLOW) | 44 | if (corgibl_flags & CORGIBL_BATTLOW) |
46 | intensity &= bl_machinfo->limit_mask; | 45 | intensity &= bl_machinfo->limit_mask; |
47 | 46 | ||
48 | mutex_lock(&bl_mutex); | ||
49 | bl_machinfo->set_bl_intensity(intensity); | 47 | bl_machinfo->set_bl_intensity(intensity); |
50 | mutex_unlock(&bl_mutex); | ||
51 | 48 | ||
52 | corgibl_intensity = intensity; | 49 | corgibl_intensity = intensity; |
53 | 50 | ||
@@ -66,7 +63,7 @@ static int corgibl_suspend(struct platform_device *pdev, pm_message_t state) | |||
66 | struct backlight_device *bd = platform_get_drvdata(pdev); | 63 | struct backlight_device *bd = platform_get_drvdata(pdev); |
67 | 64 | ||
68 | corgibl_flags |= CORGIBL_SUSPENDED; | 65 | corgibl_flags |= CORGIBL_SUSPENDED; |
69 | corgibl_send_intensity(bd); | 66 | backlight_update_status(bd); |
70 | return 0; | 67 | return 0; |
71 | } | 68 | } |
72 | 69 | ||
@@ -75,7 +72,7 @@ static int corgibl_resume(struct platform_device *pdev) | |||
75 | struct backlight_device *bd = platform_get_drvdata(pdev); | 72 | struct backlight_device *bd = platform_get_drvdata(pdev); |
76 | 73 | ||
77 | corgibl_flags &= ~CORGIBL_SUSPENDED; | 74 | corgibl_flags &= ~CORGIBL_SUSPENDED; |
78 | corgibl_send_intensity(bd); | 75 | backlight_update_status(bd); |
79 | return 0; | 76 | return 0; |
80 | } | 77 | } |
81 | #else | 78 | #else |
@@ -98,7 +95,7 @@ void corgibl_limit_intensity(int limit) | |||
98 | corgibl_flags |= CORGIBL_BATTLOW; | 95 | corgibl_flags |= CORGIBL_BATTLOW; |
99 | else | 96 | else |
100 | corgibl_flags &= ~CORGIBL_BATTLOW; | 97 | corgibl_flags &= ~CORGIBL_BATTLOW; |
101 | corgibl_send_intensity(corgi_backlight_device); | 98 | backlight_update_status(corgi_backlight_device); |
102 | } | 99 | } |
103 | EXPORT_SYMBOL(corgibl_limit_intensity); | 100 | EXPORT_SYMBOL(corgibl_limit_intensity); |
104 | 101 | ||
@@ -126,7 +123,7 @@ static int corgibl_probe(struct platform_device *pdev) | |||
126 | corgi_backlight_device->props.max_brightness = machinfo->max_intensity; | 123 | corgi_backlight_device->props.max_brightness = machinfo->max_intensity; |
127 | corgi_backlight_device->props.power = FB_BLANK_UNBLANK; | 124 | corgi_backlight_device->props.power = FB_BLANK_UNBLANK; |
128 | corgi_backlight_device->props.brightness = machinfo->default_intensity; | 125 | corgi_backlight_device->props.brightness = machinfo->default_intensity; |
129 | corgibl_send_intensity(corgi_backlight_device); | 126 | backlight_update_status(corgi_backlight_device); |
130 | 127 | ||
131 | printk("Corgi Backlight Driver Initialized.\n"); | 128 | printk("Corgi Backlight Driver Initialized.\n"); |
132 | return 0; | 129 | return 0; |
@@ -138,7 +135,7 @@ static int corgibl_remove(struct platform_device *pdev) | |||
138 | 135 | ||
139 | corgibl_data.power = 0; | 136 | corgibl_data.power = 0; |
140 | corgibl_data.brightness = 0; | 137 | corgibl_data.brightness = 0; |
141 | corgibl_send_intensity(bd); | 138 | backlight_update_status(bd); |
142 | 139 | ||
143 | backlight_device_unregister(bd); | 140 | backlight_device_unregister(bd); |
144 | 141 | ||