Commit e0528c94 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm/omap: dss: Constify omap_dss_driver operations structure

The structure contains function pointers that don't need to be modified.
Make all its instances const to improve security.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 21ebcbac
......@@ -154,7 +154,7 @@ static int tvc_check_timings(struct omap_dss_device *dssdev,
return in->ops.atv->check_timings(in, vm);
}
static struct omap_dss_driver tvc_driver = {
static const struct omap_dss_driver tvc_driver = {
.connect = tvc_connect,
.disconnect = tvc_disconnect,
......
......@@ -297,7 +297,7 @@ static void dvic_disable_hpd(struct omap_dss_device *dssdev)
mutex_unlock(&ddata->hpd_lock);
}
static struct omap_dss_driver dvic_driver = {
static const struct omap_dss_driver dvic_driver = {
.connect = dvic_connect,
.disconnect = dvic_disconnect,
......
......@@ -269,7 +269,7 @@ static int hdmic_set_infoframe(struct omap_dss_device *dssdev,
return in->ops.hdmi->set_infoframe(in, avi);
}
static struct omap_dss_driver hdmic_driver = {
static const struct omap_dss_driver hdmic_driver = {
.connect = hdmic_connect,
.disconnect = hdmic_disconnect,
......
......@@ -153,7 +153,7 @@ static int panel_dpi_check_timings(struct omap_dss_device *dssdev,
return in->ops.dpi->check_timings(in, vm);
}
static struct omap_dss_driver panel_dpi_ops = {
static const struct omap_dss_driver panel_dpi_ops = {
.connect = panel_dpi_connect,
.disconnect = panel_dpi_disconnect,
......
......@@ -1210,7 +1210,7 @@ static void dsicm_get_size(struct omap_dss_device *dssdev,
*height = ddata->height_mm;
}
static struct omap_dss_driver dsicm_ops = {
static const struct omap_dss_driver dsicm_ops = {
.connect = dsicm_connect,
.disconnect = dsicm_disconnect,
......
......@@ -228,7 +228,7 @@ static int lb035q02_check_timings(struct omap_dss_device *dssdev,
return in->ops.dpi->check_timings(in, vm);
}
static struct omap_dss_driver lb035q02_ops = {
static const struct omap_dss_driver lb035q02_ops = {
.connect = lb035q02_connect,
.disconnect = lb035q02_disconnect,
......
......@@ -222,7 +222,7 @@ static int nec_8048_check_timings(struct omap_dss_device *dssdev,
return in->ops.dpi->check_timings(in, vm);
}
static struct omap_dss_driver nec_8048_ops = {
static const struct omap_dss_driver nec_8048_ops = {
.connect = nec_8048_connect,
.disconnect = nec_8048_disconnect,
......
......@@ -192,7 +192,7 @@ static int sharp_ls_check_timings(struct omap_dss_device *dssdev,
return in->ops.dpi->check_timings(in, vm);
}
static struct omap_dss_driver sharp_ls_ops = {
static const struct omap_dss_driver sharp_ls_ops = {
.connect = sharp_ls_connect,
.disconnect = sharp_ls_disconnect,
......
......@@ -693,7 +693,7 @@ static int acx565akm_check_timings(struct omap_dss_device *dssdev,
return in->ops.sdi->check_timings(in, vm);
}
static struct omap_dss_driver acx565akm_ops = {
static const struct omap_dss_driver acx565akm_ops = {
.connect = acx565akm_connect,
.disconnect = acx565akm_disconnect,
......
......@@ -362,7 +362,7 @@ static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev,
return in->ops.dpi->check_timings(in, vm);
}
static struct omap_dss_driver td028ttec1_ops = {
static const struct omap_dss_driver td028ttec1_ops = {
.connect = td028ttec1_panel_connect,
.disconnect = td028ttec1_panel_disconnect,
......
......@@ -456,7 +456,7 @@ static int tpo_td043_check_timings(struct omap_dss_device *dssdev,
return in->ops.dpi->check_timings(in, vm);
}
static struct omap_dss_driver tpo_td043_ops = {
static const struct omap_dss_driver tpo_td043_ops = {
.connect = tpo_td043_connect,
.disconnect = tpo_td043_disconnect,
......
......@@ -466,7 +466,7 @@ struct omap_dss_device {
const char *name;
struct omap_dss_driver *driver;
const struct omap_dss_driver *driver;
union {
const struct omapdss_dpi_ops *dpi;
......
......@@ -62,7 +62,7 @@ static enum drm_connector_status omap_connector_detect(
{
struct omap_connector *omap_connector = to_omap_connector(connector);
struct omap_dss_device *dssdev = omap_connector->dssdev;
struct omap_dss_driver *dssdrv = dssdev->driver;
const struct omap_dss_driver *dssdrv = dssdev->driver;
enum drm_connector_status ret;
if (dssdrv->detect) {
......@@ -107,7 +107,7 @@ static int omap_connector_get_modes(struct drm_connector *connector)
{
struct omap_connector *omap_connector = to_omap_connector(connector);
struct omap_dss_device *dssdev = omap_connector->dssdev;
struct omap_dss_driver *dssdrv = dssdev->driver;
const struct omap_dss_driver *dssdrv = dssdev->driver;
struct drm_device *dev = connector->dev;
int n = 0;
......@@ -170,7 +170,7 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
{
struct omap_connector *omap_connector = to_omap_connector(connector);
struct omap_dss_device *dssdev = omap_connector->dssdev;
struct omap_dss_driver *dssdrv = dssdev->driver;
const struct omap_dss_driver *dssdrv = dssdev->driver;
struct videomode vm = {0};
struct drm_device *dev = connector->dev;
struct drm_display_mode *new_mode;
......
......@@ -94,7 +94,7 @@ static void omap_encoder_disable(struct drm_encoder *encoder)
{
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *dssdev = omap_encoder->dssdev;
struct omap_dss_driver *dssdrv = dssdev->driver;
const struct omap_dss_driver *dssdrv = dssdev->driver;
dssdrv->disable(dssdev);
}
......@@ -106,7 +106,7 @@ static int omap_encoder_update(struct drm_encoder *encoder,
struct drm_device *dev = encoder->dev;
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *dssdev = omap_encoder->dssdev;
struct omap_dss_driver *dssdrv = dssdev->driver;
const struct omap_dss_driver *dssdrv = dssdev->driver;
int ret;
if (dssdrv->check_timings) {
......@@ -137,7 +137,7 @@ static void omap_encoder_enable(struct drm_encoder *encoder)
{
struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
struct omap_dss_device *dssdev = omap_encoder->dssdev;
struct omap_dss_driver *dssdrv = dssdev->driver;
const struct omap_dss_driver *dssdrv = dssdev->driver;
int r;
omap_encoder_update(encoder, omap_crtc_channel(encoder->crtc),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment