aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r--drivers/video/backlight/ot200_bl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/video/backlight/ot200_bl.c b/drivers/video/backlight/ot200_bl.c
index ef637ffc079..469cf0f109d 100644
--- a/drivers/video/backlight/ot200_bl.c
+++ b/drivers/video/backlight/ot200_bl.c
@@ -84,7 +84,8 @@ static int ot200_backlight_probe(struct platform_device *pdev)
84 int retval = 0; 84 int retval = 0;
85 85
86 /* request gpio */ 86 /* request gpio */
87 if (gpio_request(GPIO_DIMM, "ot200 backlight dimmer") < 0) { 87 if (devm_gpio_request(&pdev->dev, GPIO_DIMM,
88 "ot200 backlight dimmer") < 0) {
88 dev_err(&pdev->dev, "failed to request GPIO %d\n", GPIO_DIMM); 89 dev_err(&pdev->dev, "failed to request GPIO %d\n", GPIO_DIMM);
89 return -ENODEV; 90 return -ENODEV;
90 } 91 }
@@ -93,8 +94,7 @@ static int ot200_backlight_probe(struct platform_device *pdev)
93 pwm_timer = cs5535_mfgpt_alloc_timer(7, MFGPT_DOMAIN_ANY); 94 pwm_timer = cs5535_mfgpt_alloc_timer(7, MFGPT_DOMAIN_ANY);
94 if (!pwm_timer) { 95 if (!pwm_timer) {
95 dev_err(&pdev->dev, "MFGPT 7 not available\n"); 96 dev_err(&pdev->dev, "MFGPT 7 not available\n");
96 retval = -ENODEV; 97 return -ENODEV;
97 goto error_mfgpt_alloc;
98 } 98 }
99 99
100 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); 100 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
@@ -131,8 +131,6 @@ static int ot200_backlight_probe(struct platform_device *pdev)
131 131
132error_devm_kzalloc: 132error_devm_kzalloc:
133 cs5535_mfgpt_free_timer(pwm_timer); 133 cs5535_mfgpt_free_timer(pwm_timer);
134error_mfgpt_alloc:
135 gpio_free(GPIO_DIMM);
136 return retval; 134 return retval;
137} 135}
138 136
@@ -149,7 +147,6 @@ static int ot200_backlight_remove(struct platform_device *pdev)
149 MAX_COMP2 - dim_table[100]); 147 MAX_COMP2 - dim_table[100]);
150 148
151 cs5535_mfgpt_free_timer(pwm_timer); 149 cs5535_mfgpt_free_timer(pwm_timer);
152 gpio_free(GPIO_DIMM);
153 150
154 return 0; 151 return 0;
155} 152}