aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2007-02-10 18:07:48 -0500
committerRichard Purdie <rpurdie@rpsys.net>2007-02-20 04:26:53 -0500
commit599a52d12629394236d785615808845823875868 (patch)
tree4e2dfa3a25ce761be0ecc0490acabac553f77a67 /arch/powerpc
parent321709c5994f952b78d567fd7083dbebbdc381b7 (diff)
backlight: Separate backlight properties from backlight ops pointers
Per device data such as brightness belongs to the indivdual device and should therefore be separate from the the backlight operation function pointers. This patch splits the two types of data and allows simplifcation of some code. Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/traps.c2
-rw-r--r--arch/powerpc/platforms/powermac/backlight.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 35ce07b6a5bc..17724fb2067f 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -107,7 +107,7 @@ int die(const char *str, struct pt_regs *regs, long err)
107 if (machine_is(powermac) && pmac_backlight) { 107 if (machine_is(powermac) && pmac_backlight) {
108 struct backlight_properties *props; 108 struct backlight_properties *props;
109 109
110 props = pmac_backlight->props; 110 props = &pmac_backlight->props;
111 props->brightness = props->max_brightness; 111 props->brightness = props->max_brightness;
112 props->power = FB_BLANK_UNBLANK; 112 props->power = FB_BLANK_UNBLANK;
113 backlight_update_status(pmac_backlight); 113 backlight_update_status(pmac_backlight);
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c
index 1be358c1448a..de7440e62cc4 100644
--- a/arch/powerpc/platforms/powermac/backlight.c
+++ b/arch/powerpc/platforms/powermac/backlight.c
@@ -44,7 +44,7 @@ DEFINE_MUTEX(pmac_backlight_mutex);
44 44
45/* Main backlight storage 45/* Main backlight storage
46 * 46 *
47 * Backlight drivers in this variable are required to have the "props" 47 * Backlight drivers in this variable are required to have the "ops"
48 * attribute set and to have an update_status function. 48 * attribute set and to have an update_status function.
49 * 49 *
50 * We can only store one backlight here, but since Apple laptops have only one 50 * We can only store one backlight here, but since Apple laptops have only one
@@ -103,7 +103,7 @@ static void pmac_backlight_key_worker(struct work_struct *work)
103 struct backlight_properties *props; 103 struct backlight_properties *props;
104 int brightness; 104 int brightness;
105 105
106 props = pmac_backlight->props; 106 props = &pmac_backlight->props;
107 107
108 brightness = props->brightness + 108 brightness = props->brightness +
109 ((pmac_backlight_key_queued?-1:1) * 109 ((pmac_backlight_key_queued?-1:1) *
@@ -141,7 +141,7 @@ static int __pmac_backlight_set_legacy_brightness(int brightness)
141 if (pmac_backlight) { 141 if (pmac_backlight) {
142 struct backlight_properties *props; 142 struct backlight_properties *props;
143 143
144 props = pmac_backlight->props; 144 props = &pmac_backlight->props;
145 props->brightness = brightness * 145 props->brightness = brightness *
146 (props->max_brightness + 1) / 146 (props->max_brightness + 1) /
147 (OLD_BACKLIGHT_MAX + 1); 147 (OLD_BACKLIGHT_MAX + 1);
@@ -190,7 +190,7 @@ int pmac_backlight_get_legacy_brightness()
190 if (pmac_backlight) { 190 if (pmac_backlight) {
191 struct backlight_properties *props; 191 struct backlight_properties *props;
192 192
193 props = pmac_backlight->props; 193 props = &pmac_backlight->props;
194 194
195 result = props->brightness * 195 result = props->brightness *
196 (OLD_BACKLIGHT_MAX + 1) / 196 (OLD_BACKLIGHT_MAX + 1) /