backlight: constify backlight_ops
backlight_device_register has been expecting a const "ops" argument, and using
it as such, since 9905a43b2d
. 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>
This commit is contained in:
parent
073ef1f6e5
commit
acc2472ed3
|
@ -260,7 +260,7 @@ static int acpi_video_set_brightness(struct backlight_device *bd)
|
|||
vd->brightness->levels[request_level]);
|
||||
}
|
||||
|
||||
static struct backlight_ops acpi_backlight_ops = {
|
||||
static const struct backlight_ops acpi_backlight_ops = {
|
||||
.get_brightness = acpi_video_get_brightness,
|
||||
.update_status = acpi_video_set_brightness,
|
||||
};
|
||||
|
|
|
@ -58,7 +58,7 @@ static int nv40_set_intensity(struct backlight_device *bd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct backlight_ops nv40_bl_ops = {
|
||||
static const struct backlight_ops nv40_bl_ops = {
|
||||
.options = BL_CORE_SUSPENDRESUME,
|
||||
.get_brightness = nv40_get_intensity,
|
||||
.update_status = nv40_set_intensity,
|
||||
|
@ -81,7 +81,7 @@ static int nv50_set_intensity(struct backlight_device *bd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct backlight_ops nv50_bl_ops = {
|
||||
static const struct backlight_ops nv50_bl_ops = {
|
||||
.options = BL_CORE_SUSPENDRESUME,
|
||||
.get_brightness = nv50_get_intensity,
|
||||
.update_status = nv50_set_intensity,
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#define MAX_PMU_LEVEL 0xFF
|
||||
|
||||
static struct backlight_ops pmu_backlight_data;
|
||||
static const struct backlight_ops pmu_backlight_data;
|
||||
static DEFINE_SPINLOCK(pmu_backlight_lock);
|
||||
static int sleeping, uses_pmu_bl;
|
||||
static u8 bl_curve[FB_BACKLIGHT_LEVELS];
|
||||
|
@ -115,7 +115,7 @@ static int pmu_backlight_get_brightness(struct backlight_device *bd)
|
|||
return bd->props.brightness;
|
||||
}
|
||||
|
||||
static struct backlight_ops pmu_backlight_data = {
|
||||
static const struct backlight_ops pmu_backlight_data = {
|
||||
.get_brightness = pmu_backlight_get_brightness,
|
||||
.update_status = pmu_backlight_update_status,
|
||||
|
||||
|
|
|
@ -915,7 +915,7 @@ static int update_bl_status(struct backlight_device *bd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct backlight_ops acer_bl_ops = {
|
||||
static const struct backlight_ops acer_bl_ops = {
|
||||
.get_brightness = read_brightness,
|
||||
.update_status = update_bl_status,
|
||||
};
|
||||
|
|
|
@ -621,7 +621,7 @@ static int update_bl_status(struct backlight_device *bd)
|
|||
return asus_lcd_set(asus, value);
|
||||
}
|
||||
|
||||
static struct backlight_ops asusbl_ops = {
|
||||
static const struct backlight_ops asusbl_ops = {
|
||||
.get_brightness = asus_read_brightness,
|
||||
.update_status = update_bl_status,
|
||||
};
|
||||
|
|
|
@ -1467,7 +1467,7 @@ static int asus_hotk_remove(struct acpi_device *device, int type)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct backlight_ops asus_backlight_data = {
|
||||
static const struct backlight_ops asus_backlight_data = {
|
||||
.get_brightness = read_brightness,
|
||||
.update_status = set_brightness_status,
|
||||
};
|
||||
|
|
|
@ -546,7 +546,7 @@ out:
|
|||
return buffer->output[1];
|
||||
}
|
||||
|
||||
static struct backlight_ops dell_ops = {
|
||||
static const struct backlight_ops dell_ops = {
|
||||
.get_brightness = dell_get_intensity,
|
||||
.update_status = dell_send_intensity,
|
||||
};
|
||||
|
|
|
@ -1115,7 +1115,7 @@ static int update_bl_status(struct backlight_device *bd)
|
|||
return set_brightness(bd, bd->props.brightness);
|
||||
}
|
||||
|
||||
static struct backlight_ops eeepcbl_ops = {
|
||||
static const struct backlight_ops eeepcbl_ops = {
|
||||
.get_brightness = read_brightness,
|
||||
.update_status = update_bl_status,
|
||||
};
|
||||
|
|
|
@ -437,7 +437,7 @@ static int bl_update_status(struct backlight_device *b)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static struct backlight_ops fujitsubl_ops = {
|
||||
static const struct backlight_ops fujitsubl_ops = {
|
||||
.get_brightness = bl_get_brightness,
|
||||
.update_status = bl_update_status,
|
||||
};
|
||||
|
|
|
@ -856,7 +856,7 @@ static int sony_backlight_get_brightness(struct backlight_device *bd)
|
|||
}
|
||||
|
||||
static struct backlight_device *sony_backlight_device;
|
||||
static struct backlight_ops sony_backlight_ops = {
|
||||
static const struct backlight_ops sony_backlight_ops = {
|
||||
.update_status = sony_backlight_update_status,
|
||||
.get_brightness = sony_backlight_get_brightness,
|
||||
};
|
||||
|
|
|
@ -6109,7 +6109,7 @@ static void tpacpi_brightness_notify_change(void)
|
|||
BACKLIGHT_UPDATE_HOTKEY);
|
||||
}
|
||||
|
||||
static struct backlight_ops ibm_backlight_data = {
|
||||
static const struct backlight_ops ibm_backlight_data = {
|
||||
.get_brightness = brightness_get,
|
||||
.update_status = brightness_update_status,
|
||||
};
|
||||
|
|
|
@ -840,7 +840,7 @@ static void remove_toshiba_proc_entries(void)
|
|||
remove_proc_entry("version", toshiba_proc_dir);
|
||||
}
|
||||
|
||||
static struct backlight_ops toshiba_backlight_data = {
|
||||
static const struct backlight_ops toshiba_backlight_data = {
|
||||
.get_brightness = get_lcd,
|
||||
.update_status = set_lcd_status,
|
||||
};
|
||||
|
|
|
@ -42,7 +42,7 @@ static int msm_fb_bl_update_status(struct backlight_device *pbd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct backlight_ops msm_fb_bl_ops = {
|
||||
static const struct backlight_ops msm_fb_bl_ops = {
|
||||
.get_brightness = msm_fb_bl_get_brightness,
|
||||
.update_status = msm_fb_bl_update_status,
|
||||
};
|
||||
|
|
|
@ -616,7 +616,7 @@ static struct device_attribute dcon_device_files[] = {
|
|||
__ATTR(resumeline, 0644, dcon_resumeline_show, dcon_resumeline_store),
|
||||
};
|
||||
|
||||
static struct backlight_ops dcon_bl_ops = {
|
||||
static const struct backlight_ops dcon_bl_ops = {
|
||||
.get_brightness = dconbl_get,
|
||||
.update_status = dconbl_set
|
||||
};
|
||||
|
|
|
@ -269,7 +269,7 @@ static int update_status(struct backlight_device *bd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct backlight_ops backlight_ops = {
|
||||
static const struct backlight_ops backlight_ops = {
|
||||
.get_brightness = get_brightness,
|
||||
.update_status = update_status,
|
||||
};
|
||||
|
|
|
@ -111,7 +111,7 @@ static int atmel_bl_get_brightness(struct backlight_device *bl)
|
|||
return lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
|
||||
}
|
||||
|
||||
static struct backlight_ops atmel_lcdc_bl_ops = {
|
||||
static const struct backlight_ops atmel_lcdc_bl_ops = {
|
||||
.update_status = atmel_bl_update_status,
|
||||
.get_brightness = atmel_bl_get_brightness,
|
||||
};
|
||||
|
|
|
@ -1786,7 +1786,7 @@ static int aty128_bl_get_brightness(struct backlight_device *bd)
|
|||
return bd->props.brightness;
|
||||
}
|
||||
|
||||
static struct backlight_ops aty128_bl_data = {
|
||||
static const struct backlight_ops aty128_bl_data = {
|
||||
.get_brightness = aty128_bl_get_brightness,
|
||||
.update_status = aty128_bl_update_status,
|
||||
};
|
||||
|
|
|
@ -2221,7 +2221,7 @@ static int aty_bl_get_brightness(struct backlight_device *bd)
|
|||
return bd->props.brightness;
|
||||
}
|
||||
|
||||
static struct backlight_ops aty_bl_data = {
|
||||
static const struct backlight_ops aty_bl_data = {
|
||||
.get_brightness = aty_bl_get_brightness,
|
||||
.update_status = aty_bl_update_status,
|
||||
};
|
||||
|
|
|
@ -128,7 +128,7 @@ static int radeon_bl_get_brightness(struct backlight_device *bd)
|
|||
return bd->props.brightness;
|
||||
}
|
||||
|
||||
static struct backlight_ops radeon_bl_data = {
|
||||
static const struct backlight_ops radeon_bl_data = {
|
||||
.get_brightness = radeon_bl_get_brightness,
|
||||
.update_status = radeon_bl_update_status,
|
||||
};
|
||||
|
|
|
@ -155,7 +155,7 @@ out:
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
static struct backlight_ops pm860x_backlight_ops = {
|
||||
static const struct backlight_ops pm860x_backlight_ops = {
|
||||
.options = BL_CORE_SUSPENDRESUME,
|
||||
.update_status = pm860x_backlight_update_status,
|
||||
.get_brightness = pm860x_backlight_get_brightness,
|
||||
|
|
|
@ -92,7 +92,7 @@ static int max8925_backlight_get_brightness(struct backlight_device *bl)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static struct backlight_ops max8925_backlight_ops = {
|
||||
static const struct backlight_ops max8925_backlight_ops = {
|
||||
.options = BL_CORE_SUSPENDRESUME,
|
||||
.update_status = max8925_backlight_update_status,
|
||||
.get_brightness = max8925_backlight_get_brightness,
|
||||
|
|
|
@ -87,7 +87,7 @@ static int nvidia_bl_get_brightness(struct backlight_device *bd)
|
|||
return bd->props.brightness;
|
||||
}
|
||||
|
||||
static struct backlight_ops nvidia_bl_ops = {
|
||||
static const struct backlight_ops nvidia_bl_ops = {
|
||||
.get_brightness = nvidia_bl_get_brightness,
|
||||
.update_status = nvidia_bl_update_status,
|
||||
};
|
||||
|
|
|
@ -465,7 +465,7 @@ static int taal_bl_get_intensity(struct backlight_device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct backlight_ops taal_bl_ops = {
|
||||
static const struct backlight_ops taal_bl_ops = {
|
||||
.get_brightness = taal_bl_get_intensity,
|
||||
.update_status = taal_bl_update_status,
|
||||
};
|
||||
|
|
|
@ -331,7 +331,7 @@ static int riva_bl_get_brightness(struct backlight_device *bd)
|
|||
return bd->props.brightness;
|
||||
}
|
||||
|
||||
static struct backlight_ops riva_bl_ops = {
|
||||
static const struct backlight_ops riva_bl_ops = {
|
||||
.get_brightness = riva_bl_get_brightness,
|
||||
.update_status = riva_bl_update_status,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue