diff options
Diffstat (limited to 'drivers/video/backlight/atmel-pwm-bl.c')
-rw-r--r-- | drivers/video/backlight/atmel-pwm-bl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c index f625ffc69ad3..2d9760551a4b 100644 --- a/drivers/video/backlight/atmel-pwm-bl.c +++ b/drivers/video/backlight/atmel-pwm-bl.c | |||
@@ -120,6 +120,7 @@ static const struct backlight_ops atmel_pwm_bl_ops = { | |||
120 | 120 | ||
121 | static int atmel_pwm_bl_probe(struct platform_device *pdev) | 121 | static int atmel_pwm_bl_probe(struct platform_device *pdev) |
122 | { | 122 | { |
123 | struct backlight_properties props; | ||
123 | const struct atmel_pwm_bl_platform_data *pdata; | 124 | const struct atmel_pwm_bl_platform_data *pdata; |
124 | struct backlight_device *bldev; | 125 | struct backlight_device *bldev; |
125 | struct atmel_pwm_bl *pwmbl; | 126 | struct atmel_pwm_bl *pwmbl; |
@@ -165,8 +166,10 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev) | |||
165 | goto err_free_gpio; | 166 | goto err_free_gpio; |
166 | } | 167 | } |
167 | 168 | ||
168 | bldev = backlight_device_register("atmel-pwm-bl", | 169 | memset(&props, 0, sizeof(struct backlight_properties)); |
169 | &pdev->dev, pwmbl, &atmel_pwm_bl_ops); | 170 | props.max_brightness = pdata->pwm_duty_max - pdata->pwm_duty_min; |
171 | bldev = backlight_device_register("atmel-pwm-bl", &pdev->dev, pwmbl, | ||
172 | &atmel_pwm_bl_ops, &props); | ||
170 | if (IS_ERR(bldev)) { | 173 | if (IS_ERR(bldev)) { |
171 | retval = PTR_ERR(bldev); | 174 | retval = PTR_ERR(bldev); |
172 | goto err_free_gpio; | 175 | goto err_free_gpio; |
@@ -178,7 +181,6 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev) | |||
178 | 181 | ||
179 | /* Power up the backlight by default at middle intesity. */ | 182 | /* Power up the backlight by default at middle intesity. */ |
180 | bldev->props.power = FB_BLANK_UNBLANK; | 183 | bldev->props.power = FB_BLANK_UNBLANK; |
181 | bldev->props.max_brightness = pdata->pwm_duty_max - pdata->pwm_duty_min; | ||
182 | bldev->props.brightness = bldev->props.max_brightness / 2; | 184 | bldev->props.brightness = bldev->props.max_brightness / 2; |
183 | 185 | ||
184 | retval = atmel_pwm_bl_init_pwm(pwmbl); | 186 | retval = atmel_pwm_bl_init_pwm(pwmbl); |