aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLionel Debroux <lionel_debroux@yahoo.fr>2010-11-16 08:14:02 -0500
committerJiri Kosina <jkosina@suse.cz>2010-11-16 08:14:02 -0500
commitacc2472ed33fc5e72482cc3b3b846077d97c2f8b (patch)
tree081b0693cce25cc85f11b613d096de91bdfb824b
parent073ef1f6e508688392580e4f35dcad9aabd1e100 (diff)
backlight: constify backlight_ops
backlight_device_register has been expecting a const "ops" argument, and using it as such, since 9905a43b2d563e6f89e4c63c4278ada03f2ebb14. Let's make the remaining backlight_ops instances const. Inspired by hunks of the grsecurity patch, updated for newer kernels. Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/acpi/video.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_backlight.c4
-rw-r--r--drivers/macintosh/via-pmu-backlight.c4
-rw-r--r--drivers/platform/x86/acer-wmi.c2
-rw-r--r--drivers/platform/x86/asus-laptop.c2
-rw-r--r--drivers/platform/x86/asus_acpi.c2
-rw-r--r--drivers/platform/x86/dell-laptop.c2
-rw-r--r--drivers/platform/x86/eeepc-laptop.c2
-rw-r--r--drivers/platform/x86/fujitsu-laptop.c2
-rw-r--r--drivers/platform/x86/sony-laptop.c2
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c2
-rw-r--r--drivers/platform/x86/toshiba_acpi.c2
-rw-r--r--drivers/staging/msm/msm_fb_bl.c2
-rw-r--r--drivers/staging/olpc_dcon/olpc_dcon.c2
-rw-r--r--drivers/staging/samsung-laptop/samsung-laptop.c2
-rw-r--r--drivers/video/atmel_lcdfb.c2
-rw-r--r--drivers/video/aty/aty128fb.c2
-rw-r--r--drivers/video/aty/atyfb_base.c2
-rw-r--r--drivers/video/aty/radeon_backlight.c2
-rw-r--r--drivers/video/backlight/88pm860x_bl.c2
-rw-r--r--drivers/video/backlight/max8925_bl.c2
-rw-r--r--drivers/video/nvidia/nv_backlight.c2
-rw-r--r--drivers/video/omap2/displays/panel-taal.c2
-rw-r--r--drivers/video/riva/fbdev.c2
24 files changed, 26 insertions, 26 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 5cd0228d2daa..15a0fde4b32a 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -260,7 +260,7 @@ static int acpi_video_set_brightness(struct backlight_device *bd)
260 vd->brightness->levels[request_level]); 260 vd->brightness->levels[request_level]);
261} 261}
262 262
263static struct backlight_ops acpi_backlight_ops = { 263static const struct backlight_ops acpi_backlight_ops = {
264 .get_brightness = acpi_video_get_brightness, 264 .get_brightness = acpi_video_get_brightness,
265 .update_status = acpi_video_set_brightness, 265 .update_status = acpi_video_set_brightness,
266}; 266};
diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index 406228f4a2a0..8933e985c227 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -58,7 +58,7 @@ static int nv40_set_intensity(struct backlight_device *bd)
58 return 0; 58 return 0;
59} 59}
60 60
61static struct backlight_ops nv40_bl_ops = { 61static const struct backlight_ops nv40_bl_ops = {
62 .options = BL_CORE_SUSPENDRESUME, 62 .options = BL_CORE_SUSPENDRESUME,
63 .get_brightness = nv40_get_intensity, 63 .get_brightness = nv40_get_intensity,
64 .update_status = nv40_set_intensity, 64 .update_status = nv40_set_intensity,
@@ -81,7 +81,7 @@ static int nv50_set_intensity(struct backlight_device *bd)
81 return 0; 81 return 0;
82} 82}
83 83
84static struct backlight_ops nv50_bl_ops = { 84static const struct backlight_ops nv50_bl_ops = {
85 .options = BL_CORE_SUSPENDRESUME, 85 .options = BL_CORE_SUSPENDRESUME,
86 .get_brightness = nv50_get_intensity, 86 .get_brightness = nv50_get_intensity,
87 .update_status = nv50_set_intensity, 87 .update_status = nv50_set_intensity,
diff --git a/drivers/macintosh/via-pmu-backlight.c b/drivers/macintosh/via-pmu-backlight.c
index 1cec02f6c431..ade1e656bfb2 100644
--- a/drivers/macintosh/via-pmu-backlight.c
+++ b/drivers/macintosh/via-pmu-backlight.c
@@ -15,7 +15,7 @@
15 15
16#define MAX_PMU_LEVEL 0xFF 16#define MAX_PMU_LEVEL 0xFF
17 17
18static struct backlight_ops pmu_backlight_data; 18static const struct backlight_ops pmu_backlight_data;
19static DEFINE_SPINLOCK(pmu_backlight_lock); 19static DEFINE_SPINLOCK(pmu_backlight_lock);
20static int sleeping, uses_pmu_bl; 20static int sleeping, uses_pmu_bl;
21static u8 bl_curve[FB_BACKLIGHT_LEVELS]; 21static u8 bl_curve[FB_BACKLIGHT_LEVELS];
@@ -115,7 +115,7 @@ static int pmu_backlight_get_brightness(struct backlight_device *bd)
115 return bd->props.brightness; 115 return bd->props.brightness;
116} 116}
117 117
118static struct backlight_ops pmu_backlight_data = { 118static const struct backlight_ops pmu_backlight_data = {
119 .get_brightness = pmu_backlight_get_brightness, 119 .get_brightness = pmu_backlight_get_brightness,
120 .update_status = pmu_backlight_update_status, 120 .update_status = pmu_backlight_update_status,
121 121
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index c8c65375bfe2..1d0b707aeafc 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -915,7 +915,7 @@ static int update_bl_status(struct backlight_device *bd)
915 return 0; 915 return 0;
916} 916}
917 917
918static struct backlight_ops acer_bl_ops = { 918static const struct backlight_ops acer_bl_ops = {
919 .get_brightness = read_brightness, 919 .get_brightness = read_brightness,
920 .update_status = update_bl_status, 920 .update_status = update_bl_status,
921}; 921};
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index 60a5a5c6b50a..3640599446fc 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -621,7 +621,7 @@ static int update_bl_status(struct backlight_device *bd)
621 return asus_lcd_set(asus, value); 621 return asus_lcd_set(asus, value);
622} 622}
623 623
624static struct backlight_ops asusbl_ops = { 624static const struct backlight_ops asusbl_ops = {
625 .get_brightness = asus_read_brightness, 625 .get_brightness = asus_read_brightness,
626 .update_status = update_bl_status, 626 .update_status = update_bl_status,
627}; 627};
diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c
index ca05aefd03bf..4633fd8532cc 100644
--- a/drivers/platform/x86/asus_acpi.c
+++ b/drivers/platform/x86/asus_acpi.c
@@ -1467,7 +1467,7 @@ static int asus_hotk_remove(struct acpi_device *device, int type)
1467 return 0; 1467 return 0;
1468} 1468}
1469 1469
1470static struct backlight_ops asus_backlight_data = { 1470static const struct backlight_ops asus_backlight_data = {
1471 .get_brightness = read_brightness, 1471 .get_brightness = read_brightness,
1472 .update_status = set_brightness_status, 1472 .update_status = set_brightness_status,
1473}; 1473};
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index cf8a89a0d8f5..34657f96b5a5 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -546,7 +546,7 @@ out:
546 return buffer->output[1]; 546 return buffer->output[1];
547} 547}
548 548
549static struct backlight_ops dell_ops = { 549static const struct backlight_ops dell_ops = {
550 .get_brightness = dell_get_intensity, 550 .get_brightness = dell_get_intensity,
551 .update_status = dell_send_intensity, 551 .update_status = dell_send_intensity,
552}; 552};
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index b2edfdcdcb84..c062a6534590 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -1115,7 +1115,7 @@ static int update_bl_status(struct backlight_device *bd)
1115 return set_brightness(bd, bd->props.brightness); 1115 return set_brightness(bd, bd->props.brightness);
1116} 1116}
1117 1117
1118static struct backlight_ops eeepcbl_ops = { 1118static const struct backlight_ops eeepcbl_ops = {
1119 .get_brightness = read_brightness, 1119 .get_brightness = read_brightness,
1120 .update_status = update_bl_status, 1120 .update_status = update_bl_status,
1121}; 1121};
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index f44cd2620ff9..34d0dc590d76 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -437,7 +437,7 @@ static int bl_update_status(struct backlight_device *b)
437 return ret; 437 return ret;
438} 438}
439 439
440static struct backlight_ops fujitsubl_ops = { 440static const struct backlight_ops fujitsubl_ops = {
441 .get_brightness = bl_get_brightness, 441 .get_brightness = bl_get_brightness,
442 .update_status = bl_update_status, 442 .update_status = bl_update_status,
443}; 443};
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index f200677851b8..f8b2fc992276 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -856,7 +856,7 @@ static int sony_backlight_get_brightness(struct backlight_device *bd)
856} 856}
857 857
858static struct backlight_device *sony_backlight_device; 858static struct backlight_device *sony_backlight_device;
859static struct backlight_ops sony_backlight_ops = { 859static const struct backlight_ops sony_backlight_ops = {
860 .update_status = sony_backlight_update_status, 860 .update_status = sony_backlight_update_status,
861 .get_brightness = sony_backlight_get_brightness, 861 .get_brightness = sony_backlight_get_brightness,
862}; 862};
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 304333faf441..efda9c54e0e2 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6109,7 +6109,7 @@ static void tpacpi_brightness_notify_change(void)
6109 BACKLIGHT_UPDATE_HOTKEY); 6109 BACKLIGHT_UPDATE_HOTKEY);
6110} 6110}
6111 6111
6112static struct backlight_ops ibm_backlight_data = { 6112static const struct backlight_ops ibm_backlight_data = {
6113 .get_brightness = brightness_get, 6113 .get_brightness = brightness_get,
6114 .update_status = brightness_update_status, 6114 .update_status = brightness_update_status,
6115}; 6115};
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
index 06f304f46e02..81bca5a4d8aa 100644
--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -840,7 +840,7 @@ static void remove_toshiba_proc_entries(void)
840 remove_proc_entry("version", toshiba_proc_dir); 840 remove_proc_entry("version", toshiba_proc_dir);
841} 841}
842 842
843static struct backlight_ops toshiba_backlight_data = { 843static const struct backlight_ops toshiba_backlight_data = {
844 .get_brightness = get_lcd, 844 .get_brightness = get_lcd,
845 .update_status = set_lcd_status, 845 .update_status = set_lcd_status,
846}; 846};
diff --git a/drivers/staging/msm/msm_fb_bl.c b/drivers/staging/msm/msm_fb_bl.c
index 033fc9486e01..2a8077511fc0 100644
--- a/drivers/staging/msm/msm_fb_bl.c
+++ b/drivers/staging/msm/msm_fb_bl.c
@@ -42,7 +42,7 @@ static int msm_fb_bl_update_status(struct backlight_device *pbd)
42 return 0; 42 return 0;
43} 43}
44 44
45static struct backlight_ops msm_fb_bl_ops = { 45static const struct backlight_ops msm_fb_bl_ops = {
46 .get_brightness = msm_fb_bl_get_brightness, 46 .get_brightness = msm_fb_bl_get_brightness,
47 .update_status = msm_fb_bl_update_status, 47 .update_status = msm_fb_bl_update_status,
48}; 48};
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
index 75aa7a36307d..d40ff41774be 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -616,7 +616,7 @@ static struct device_attribute dcon_device_files[] = {
616 __ATTR(resumeline, 0644, dcon_resumeline_show, dcon_resumeline_store), 616 __ATTR(resumeline, 0644, dcon_resumeline_show, dcon_resumeline_store),
617}; 617};
618 618
619static struct backlight_ops dcon_bl_ops = { 619static const struct backlight_ops dcon_bl_ops = {
620 .get_brightness = dconbl_get, 620 .get_brightness = dconbl_get,
621 .update_status = dconbl_set 621 .update_status = dconbl_set
622}; 622};
diff --git a/drivers/staging/samsung-laptop/samsung-laptop.c b/drivers/staging/samsung-laptop/samsung-laptop.c
index eb44b60e1eb5..80eeec6d6719 100644
--- a/drivers/staging/samsung-laptop/samsung-laptop.c
+++ b/drivers/staging/samsung-laptop/samsung-laptop.c
@@ -269,7 +269,7 @@ static int update_status(struct backlight_device *bd)
269 return 0; 269 return 0;
270} 270}
271 271
272static struct backlight_ops backlight_ops = { 272static const struct backlight_ops backlight_ops = {
273 .get_brightness = get_brightness, 273 .get_brightness = get_brightness,
274 .update_status = update_status, 274 .update_status = update_status,
275}; 275};
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index 8dce25126330..bac163450216 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -111,7 +111,7 @@ static int atmel_bl_get_brightness(struct backlight_device *bl)
111 return lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL); 111 return lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
112} 112}
113 113
114static struct backlight_ops atmel_lcdc_bl_ops = { 114static const struct backlight_ops atmel_lcdc_bl_ops = {
115 .update_status = atmel_bl_update_status, 115 .update_status = atmel_bl_update_status,
116 .get_brightness = atmel_bl_get_brightness, 116 .get_brightness = atmel_bl_get_brightness,
117}; 117};
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index 34a0851bcbfa..dd9de2e80580 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1786,7 +1786,7 @@ static int aty128_bl_get_brightness(struct backlight_device *bd)
1786 return bd->props.brightness; 1786 return bd->props.brightness;
1787} 1787}
1788 1788
1789static struct backlight_ops aty128_bl_data = { 1789static const struct backlight_ops aty128_bl_data = {
1790 .get_brightness = aty128_bl_get_brightness, 1790 .get_brightness = aty128_bl_get_brightness,
1791 .update_status = aty128_bl_update_status, 1791 .update_status = aty128_bl_update_status,
1792}; 1792};
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 5bf91236c701..4d5c41371543 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -2221,7 +2221,7 @@ static int aty_bl_get_brightness(struct backlight_device *bd)
2221 return bd->props.brightness; 2221 return bd->props.brightness;
2222} 2222}
2223 2223
2224static struct backlight_ops aty_bl_data = { 2224static const struct backlight_ops aty_bl_data = {
2225 .get_brightness = aty_bl_get_brightness, 2225 .get_brightness = aty_bl_get_brightness,
2226 .update_status = aty_bl_update_status, 2226 .update_status = aty_bl_update_status,
2227}; 2227};
diff --git a/drivers/video/aty/radeon_backlight.c b/drivers/video/aty/radeon_backlight.c
index 256966e9667d..9b811ddbce83 100644
--- a/drivers/video/aty/radeon_backlight.c
+++ b/drivers/video/aty/radeon_backlight.c
@@ -128,7 +128,7 @@ static int radeon_bl_get_brightness(struct backlight_device *bd)
128 return bd->props.brightness; 128 return bd->props.brightness;
129} 129}
130 130
131static struct backlight_ops radeon_bl_data = { 131static const struct backlight_ops radeon_bl_data = {
132 .get_brightness = radeon_bl_get_brightness, 132 .get_brightness = radeon_bl_get_brightness,
133 .update_status = radeon_bl_update_status, 133 .update_status = radeon_bl_update_status,
134}; 134};
diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c
index 38ffc3fbcbe4..c789c46e38af 100644
--- a/drivers/video/backlight/88pm860x_bl.c
+++ b/drivers/video/backlight/88pm860x_bl.c
@@ -155,7 +155,7 @@ out:
155 return -EINVAL; 155 return -EINVAL;
156} 156}
157 157
158static struct backlight_ops pm860x_backlight_ops = { 158static const struct backlight_ops pm860x_backlight_ops = {
159 .options = BL_CORE_SUSPENDRESUME, 159 .options = BL_CORE_SUSPENDRESUME,
160 .update_status = pm860x_backlight_update_status, 160 .update_status = pm860x_backlight_update_status,
161 .get_brightness = pm860x_backlight_get_brightness, 161 .get_brightness = pm860x_backlight_get_brightness,
diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c
index b2b2c7ba1f63..209acc105cbc 100644
--- a/drivers/video/backlight/max8925_bl.c
+++ b/drivers/video/backlight/max8925_bl.c
@@ -92,7 +92,7 @@ static int max8925_backlight_get_brightness(struct backlight_device *bl)
92 return ret; 92 return ret;
93} 93}
94 94
95static struct backlight_ops max8925_backlight_ops = { 95static const struct backlight_ops max8925_backlight_ops = {
96 .options = BL_CORE_SUSPENDRESUME, 96 .options = BL_CORE_SUSPENDRESUME,
97 .update_status = max8925_backlight_update_status, 97 .update_status = max8925_backlight_update_status,
98 .get_brightness = max8925_backlight_get_brightness, 98 .get_brightness = max8925_backlight_get_brightness,
diff --git a/drivers/video/nvidia/nv_backlight.c b/drivers/video/nvidia/nv_backlight.c
index 2fb552a6f32c..6aac6d1b937b 100644
--- a/drivers/video/nvidia/nv_backlight.c
+++ b/drivers/video/nvidia/nv_backlight.c
@@ -87,7 +87,7 @@ static int nvidia_bl_get_brightness(struct backlight_device *bd)
87 return bd->props.brightness; 87 return bd->props.brightness;
88} 88}
89 89
90static struct backlight_ops nvidia_bl_ops = { 90static const struct backlight_ops nvidia_bl_ops = {
91 .get_brightness = nvidia_bl_get_brightness, 91 .get_brightness = nvidia_bl_get_brightness,
92 .update_status = nvidia_bl_update_status, 92 .update_status = nvidia_bl_update_status,
93}; 93};
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index e1c765d11419..61026f96ad20 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -465,7 +465,7 @@ static int taal_bl_get_intensity(struct backlight_device *dev)
465 return 0; 465 return 0;
466} 466}
467 467
468static struct backlight_ops taal_bl_ops = { 468static const struct backlight_ops taal_bl_ops = {
469 .get_brightness = taal_bl_get_intensity, 469 .get_brightness = taal_bl_get_intensity,
470 .update_status = taal_bl_update_status, 470 .update_status = taal_bl_update_status,
471}; 471};
diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c
index 618f36bec10d..da388186d617 100644
--- a/drivers/video/riva/fbdev.c
+++ b/drivers/video/riva/fbdev.c
@@ -331,7 +331,7 @@ static int riva_bl_get_brightness(struct backlight_device *bd)
331 return bd->props.brightness; 331 return bd->props.brightness;
332} 332}
333 333
334static struct backlight_ops riva_bl_ops = { 334static const struct backlight_ops riva_bl_ops = {
335 .get_brightness = riva_bl_get_brightness, 335 .get_brightness = riva_bl_get_brightness,
336 .update_status = riva_bl_update_status, 336 .update_status = riva_bl_update_status,
337}; 337};