Commit 4cae5b84 authored by Sascha Hauer's avatar Sascha Hauer Committed by Dave Airlie

drm: add proper return value for drm_mode_crtc_set_gamma_size

drm_mode_crtc_set_gamma_size returns boolean true for success
and false for failure. This is not very kernel conform, so
change it to return 0 for success and a propert error code
otherwise. Noone checks the return value, so no users have to
be fixed.
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent a1b7736d
...@@ -3024,7 +3024,7 @@ void drm_mode_connector_detach_encoder(struct drm_connector *connector, ...@@ -3024,7 +3024,7 @@ void drm_mode_connector_detach_encoder(struct drm_connector *connector,
} }
EXPORT_SYMBOL(drm_mode_connector_detach_encoder); EXPORT_SYMBOL(drm_mode_connector_detach_encoder);
bool drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
int gamma_size) int gamma_size)
{ {
crtc->gamma_size = gamma_size; crtc->gamma_size = gamma_size;
...@@ -3032,10 +3032,10 @@ bool drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, ...@@ -3032,10 +3032,10 @@ bool drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
crtc->gamma_store = kzalloc(gamma_size * sizeof(uint16_t) * 3, GFP_KERNEL); crtc->gamma_store = kzalloc(gamma_size * sizeof(uint16_t) * 3, GFP_KERNEL);
if (!crtc->gamma_store) { if (!crtc->gamma_store) {
crtc->gamma_size = 0; crtc->gamma_size = 0;
return false; return -ENOMEM;
} }
return true; return 0;
} }
EXPORT_SYMBOL(drm_mode_crtc_set_gamma_size); EXPORT_SYMBOL(drm_mode_crtc_set_gamma_size);
......
...@@ -919,7 +919,7 @@ extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, ...@@ -919,7 +919,7 @@ extern int drm_mode_connector_attach_encoder(struct drm_connector *connector,
struct drm_encoder *encoder); struct drm_encoder *encoder);
extern void drm_mode_connector_detach_encoder(struct drm_connector *connector, extern void drm_mode_connector_detach_encoder(struct drm_connector *connector,
struct drm_encoder *encoder); struct drm_encoder *encoder);
extern bool drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, extern int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
int gamma_size); int gamma_size);
extern struct drm_mode_object *drm_mode_object_find(struct drm_device *dev, extern struct drm_mode_object *drm_mode_object_find(struct drm_device *dev,
uint32_t id, uint32_t type); uint32_t id, uint32_t type);
......
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