Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lionel Debroux and committed by
Jiri Kosina
acc2472e 073ef1f6

+26 -26
+1 -1
drivers/acpi/video.c
··· 260 260 vd->brightness->levels[request_level]); 261 261 } 262 262 263 - static struct backlight_ops acpi_backlight_ops = { 263 + static const struct backlight_ops acpi_backlight_ops = { 264 264 .get_brightness = acpi_video_get_brightness, 265 265 .update_status = acpi_video_set_brightness, 266 266 };
+2 -2
drivers/gpu/drm/nouveau/nouveau_backlight.c
··· 58 58 return 0; 59 59 } 60 60 61 - static struct backlight_ops nv40_bl_ops = { 61 + static const struct backlight_ops nv40_bl_ops = { 62 62 .options = BL_CORE_SUSPENDRESUME, 63 63 .get_brightness = nv40_get_intensity, 64 64 .update_status = nv40_set_intensity, ··· 81 81 return 0; 82 82 } 83 83 84 - static struct backlight_ops nv50_bl_ops = { 84 + static const struct backlight_ops nv50_bl_ops = { 85 85 .options = BL_CORE_SUSPENDRESUME, 86 86 .get_brightness = nv50_get_intensity, 87 87 .update_status = nv50_set_intensity,
+2 -2
drivers/macintosh/via-pmu-backlight.c
··· 15 15 16 16 #define MAX_PMU_LEVEL 0xFF 17 17 18 - static struct backlight_ops pmu_backlight_data; 18 + static const struct backlight_ops pmu_backlight_data; 19 19 static DEFINE_SPINLOCK(pmu_backlight_lock); 20 20 static int sleeping, uses_pmu_bl; 21 21 static u8 bl_curve[FB_BACKLIGHT_LEVELS]; ··· 115 115 return bd->props.brightness; 116 116 } 117 117 118 - static struct backlight_ops pmu_backlight_data = { 118 + static const struct backlight_ops pmu_backlight_data = { 119 119 .get_brightness = pmu_backlight_get_brightness, 120 120 .update_status = pmu_backlight_update_status, 121 121
+1 -1
drivers/platform/x86/acer-wmi.c
··· 915 915 return 0; 916 916 } 917 917 918 - static struct backlight_ops acer_bl_ops = { 918 + static const struct backlight_ops acer_bl_ops = { 919 919 .get_brightness = read_brightness, 920 920 .update_status = update_bl_status, 921 921 };
+1 -1
drivers/platform/x86/asus-laptop.c
··· 621 621 return asus_lcd_set(asus, value); 622 622 } 623 623 624 - static struct backlight_ops asusbl_ops = { 624 + static const struct backlight_ops asusbl_ops = { 625 625 .get_brightness = asus_read_brightness, 626 626 .update_status = update_bl_status, 627 627 };
+1 -1
drivers/platform/x86/asus_acpi.c
··· 1467 1467 return 0; 1468 1468 } 1469 1469 1470 - static struct backlight_ops asus_backlight_data = { 1470 + static const struct backlight_ops asus_backlight_data = { 1471 1471 .get_brightness = read_brightness, 1472 1472 .update_status = set_brightness_status, 1473 1473 };
+1 -1
drivers/platform/x86/dell-laptop.c
··· 546 546 return buffer->output[1]; 547 547 } 548 548 549 - static struct backlight_ops dell_ops = { 549 + static const struct backlight_ops dell_ops = { 550 550 .get_brightness = dell_get_intensity, 551 551 .update_status = dell_send_intensity, 552 552 };
+1 -1
drivers/platform/x86/eeepc-laptop.c
··· 1115 1115 return set_brightness(bd, bd->props.brightness); 1116 1116 } 1117 1117 1118 - static struct backlight_ops eeepcbl_ops = { 1118 + static const struct backlight_ops eeepcbl_ops = { 1119 1119 .get_brightness = read_brightness, 1120 1120 .update_status = update_bl_status, 1121 1121 };
+1 -1
drivers/platform/x86/fujitsu-laptop.c
··· 437 437 return ret; 438 438 } 439 439 440 - static struct backlight_ops fujitsubl_ops = { 440 + static const struct backlight_ops fujitsubl_ops = { 441 441 .get_brightness = bl_get_brightness, 442 442 .update_status = bl_update_status, 443 443 };
+1 -1
drivers/platform/x86/sony-laptop.c
··· 856 856 } 857 857 858 858 static struct backlight_device *sony_backlight_device; 859 - static struct backlight_ops sony_backlight_ops = { 859 + static const struct backlight_ops sony_backlight_ops = { 860 860 .update_status = sony_backlight_update_status, 861 861 .get_brightness = sony_backlight_get_brightness, 862 862 };
+1 -1
drivers/platform/x86/thinkpad_acpi.c
··· 6109 6109 BACKLIGHT_UPDATE_HOTKEY); 6110 6110 } 6111 6111 6112 - static struct backlight_ops ibm_backlight_data = { 6112 + static const struct backlight_ops ibm_backlight_data = { 6113 6113 .get_brightness = brightness_get, 6114 6114 .update_status = brightness_update_status, 6115 6115 };
+1 -1
drivers/platform/x86/toshiba_acpi.c
··· 840 840 remove_proc_entry("version", toshiba_proc_dir); 841 841 } 842 842 843 - static struct backlight_ops toshiba_backlight_data = { 843 + static const struct backlight_ops toshiba_backlight_data = { 844 844 .get_brightness = get_lcd, 845 845 .update_status = set_lcd_status, 846 846 };
+1 -1
drivers/staging/msm/msm_fb_bl.c
··· 42 42 return 0; 43 43 } 44 44 45 - static struct backlight_ops msm_fb_bl_ops = { 45 + static const struct backlight_ops msm_fb_bl_ops = { 46 46 .get_brightness = msm_fb_bl_get_brightness, 47 47 .update_status = msm_fb_bl_update_status, 48 48 };
+1 -1
drivers/staging/olpc_dcon/olpc_dcon.c
··· 616 616 __ATTR(resumeline, 0644, dcon_resumeline_show, dcon_resumeline_store), 617 617 }; 618 618 619 - static struct backlight_ops dcon_bl_ops = { 619 + static const struct backlight_ops dcon_bl_ops = { 620 620 .get_brightness = dconbl_get, 621 621 .update_status = dconbl_set 622 622 };
+1 -1
drivers/staging/samsung-laptop/samsung-laptop.c
··· 269 269 return 0; 270 270 } 271 271 272 - static struct backlight_ops backlight_ops = { 272 + static const struct backlight_ops backlight_ops = { 273 273 .get_brightness = get_brightness, 274 274 .update_status = update_status, 275 275 };
+1 -1
drivers/video/atmel_lcdfb.c
··· 111 111 return lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL); 112 112 } 113 113 114 - static struct backlight_ops atmel_lcdc_bl_ops = { 114 + static const struct backlight_ops atmel_lcdc_bl_ops = { 115 115 .update_status = atmel_bl_update_status, 116 116 .get_brightness = atmel_bl_get_brightness, 117 117 };
+1 -1
drivers/video/aty/aty128fb.c
··· 1786 1786 return bd->props.brightness; 1787 1787 } 1788 1788 1789 - static struct backlight_ops aty128_bl_data = { 1789 + static const struct backlight_ops aty128_bl_data = { 1790 1790 .get_brightness = aty128_bl_get_brightness, 1791 1791 .update_status = aty128_bl_update_status, 1792 1792 };
+1 -1
drivers/video/aty/atyfb_base.c
··· 2221 2221 return bd->props.brightness; 2222 2222 } 2223 2223 2224 - static struct backlight_ops aty_bl_data = { 2224 + static const struct backlight_ops aty_bl_data = { 2225 2225 .get_brightness = aty_bl_get_brightness, 2226 2226 .update_status = aty_bl_update_status, 2227 2227 };
+1 -1
drivers/video/aty/radeon_backlight.c
··· 128 128 return bd->props.brightness; 129 129 } 130 130 131 - static struct backlight_ops radeon_bl_data = { 131 + static const struct backlight_ops radeon_bl_data = { 132 132 .get_brightness = radeon_bl_get_brightness, 133 133 .update_status = radeon_bl_update_status, 134 134 };
+1 -1
drivers/video/backlight/88pm860x_bl.c
··· 155 155 return -EINVAL; 156 156 } 157 157 158 - static struct backlight_ops pm860x_backlight_ops = { 158 + static const struct backlight_ops pm860x_backlight_ops = { 159 159 .options = BL_CORE_SUSPENDRESUME, 160 160 .update_status = pm860x_backlight_update_status, 161 161 .get_brightness = pm860x_backlight_get_brightness,
+1 -1
drivers/video/backlight/max8925_bl.c
··· 92 92 return ret; 93 93 } 94 94 95 - static struct backlight_ops max8925_backlight_ops = { 95 + static const struct backlight_ops max8925_backlight_ops = { 96 96 .options = BL_CORE_SUSPENDRESUME, 97 97 .update_status = max8925_backlight_update_status, 98 98 .get_brightness = max8925_backlight_get_brightness,
+1 -1
drivers/video/nvidia/nv_backlight.c
··· 87 87 return bd->props.brightness; 88 88 } 89 89 90 - static struct backlight_ops nvidia_bl_ops = { 90 + static const struct backlight_ops nvidia_bl_ops = { 91 91 .get_brightness = nvidia_bl_get_brightness, 92 92 .update_status = nvidia_bl_update_status, 93 93 };
+1 -1
drivers/video/omap2/displays/panel-taal.c
··· 465 465 return 0; 466 466 } 467 467 468 - static struct backlight_ops taal_bl_ops = { 468 + static const struct backlight_ops taal_bl_ops = { 469 469 .get_brightness = taal_bl_get_intensity, 470 470 .update_status = taal_bl_update_status, 471 471 };
+1 -1
drivers/video/riva/fbdev.c
··· 331 331 return bd->props.brightness; 332 332 } 333 333 334 - static struct backlight_ops riva_bl_ops = { 334 + static const struct backlight_ops riva_bl_ops = { 335 335 .get_brightness = riva_bl_get_brightness, 336 336 .update_status = riva_bl_update_status, 337 337 };