gma500: clean up an excessive and confusing helper
Subsystems (3)
PATCH 1/1 gma500: clean up an excessive and confusing helper
From: Alan Cox <[email protected]>
This is a left over from the great clean ups in the past. It's confusing as it returns an int, yet has one caller that never uses it. The caller already has all the right private variables local so the entire function can be replaced by a simple if call.
--- drivers/gpu/drm/gma500/framebuffer.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-)
drivers/gpu/drm/gma500/framebuffer.c +4 -16
@@ -674,29 +674,17 @@ static const struct drm_mode_config_funcs psb_mode_funcs = { .output_poll_changed = psbfb_output_poll_changed, }; -static int psb_create_backlight_property (struct drm_device *dev) -{ -struct drm_psb_private *dev_priv = dev->dev_private; -struct drm_property *backlight; - -if (dev_priv->backlight_property) -return 0 ; - - backlight =drm_property_create_range (dev,0 ,"backlight" ,0 ,100 ); - - dev_priv->backlight_property = backlight; - -return 0 ; -} -static void psb_setup_outputs (struct drm_device *dev) {struct drm_psb_private *dev_priv = dev->dev_private;struct drm_connector *connector;drm_mode_create_scaling_mode_property (dev); -psb_create_backlight_property (dev); +/* It is ok for this to fail - we just don't get backlight control */ +if (!dev_priv->backlight_property) + dev_priv->backlight_property =drm_property_create_range (dev,0 , +"backlight" ,0 ,100 ); dev_priv->ops->output_init (dev); list_for_each_entry(connector, &dev->mode_config.connector_list,
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Patrik Jakobsson
maintainerQuoted 8 lines · Alan
From: Alan Cox <[email protected]>
This is a left over from the great clean ups in the past. It's confusing as it returns an int, yet has one caller that never uses it. The caller already has all the right private variables local so the entire function can be replaced by a simple if call.
Signed-off-by Alan Cox <[email protected]>
Quoted 33 lines
--- drivers/gpu/drm/gma500/framebuffer.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-)drivers/gpu/drm/gma500/framebuffer.c +0
-15@@ -674,29 +674,17 @@ static const struct drm_mode_config_funcs psb_mode_funcs = { .output_poll_changed = psbfb_output_poll_changed, }; -static int psb_create_backlight_property (struct drm_device *dev) -{ -struct drm_psb_private *dev_priv = dev->dev_private; -struct drm_property *backlight; - -if (dev_priv->backlight_property) -return 0 ; - - backlight =drm_property_create_range (dev,0 ,"backlight" ,0 ,100 ); - - dev_priv->backlight_property = backlight; - -return 0 ; -} -static void psb_setup_outputs (struct drm_device *dev) {struct drm_psb_private *dev_priv = dev->dev_private;struct drm_connector *connector;
drivers/gpu/drm/gma500/framebuffer.c static const struct drm_mode_config_funcs psb_mode_funcs = { · line 690
Quoted 10 lines
drivers/gpu/drm/gma500/framebuffer.c +4
-1drm_mode_create_scaling_mode_property (dev); -psb_create_backlight_property (dev); +/* It is ok for this to fail - we just don't get backlight control */ +if (!dev_priv->backlight_property) + dev_priv->backlight_property =drm_property_create_range (dev,0 , +"backlight" ,0 ,100 ); dev_priv->ops->output_init (dev); list_for_each_entry(connector, &dev->mode_config.connector_list,
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Daniel Vetter
AppliedQuoted 11 lines · Patrik Jakobsson
Quoted 8 lines · Alan
From: Alan Cox <[email protected]>
This is a left over from the great clean ups in the past. It's confusing as it returns an int, yet has one caller that never uses it. The caller already has all the right private variables local so the entire function can be replaced by a simple if call.
Signed-off-by Alan Cox <[email protected]>Signed-off-by Patrik Jakobsson <[email protected]>
Applied to drm-misc, thanks.
-Daniel
Quoted 48 lines
Quoted 34 lines
--- drivers/gpu/drm/gma500/framebuffer.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-)drivers/gpu/drm/gma500/framebuffer.c +0
-15@@ -674,29 +674,17 @@ static const struct drm_mode_config_funcs psb_mode_funcs = { .output_poll_changed = psbfb_output_poll_changed, }; -static int psb_create_backlight_property (struct drm_device *dev) -{ -struct drm_psb_private *dev_priv = dev->dev_private; -struct drm_property *backlight; - -if (dev_priv->backlight_property) -return 0 ; - - backlight =drm_property_create_range (dev,0 ,"backlight" ,0 ,100 ); - - dev_priv->backlight_property = backlight; - -return 0 ; -} -static void psb_setup_outputs (struct drm_device *dev) {struct drm_psb_private *dev_priv = dev->dev_private;struct drm_connector *connector;drivers/gpu/drm/gma500/framebuffer.c static const struct drm_mode_config_funcs psb_mode_funcs = { · line 690
Quoted 10 lines
drivers/gpu/drm/gma500/framebuffer.c +4
-1drm_mode_create_scaling_mode_property (dev); -psb_create_backlight_property (dev); +/* It is ok for this to fail - we just don't get backlight control */ +if (!dev_priv->backlight_property) + dev_priv->backlight_property =drm_property_create_range (dev,0 , +"backlight" ,0 ,100 ); dev_priv->ops->output_init (dev); list_for_each_entry(connector, &dev->mode_config.connector_list,_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel