diff options
Diffstat (limited to 'drivers/usb/misc/appledisplay.c')
-rw-r--r-- | drivers/usb/misc/appledisplay.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index 4d2952f1fb13..3adab041355a 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c | |||
@@ -202,6 +202,7 @@ static void appledisplay_work(struct work_struct *work) | |||
202 | static int appledisplay_probe(struct usb_interface *iface, | 202 | static int appledisplay_probe(struct usb_interface *iface, |
203 | const struct usb_device_id *id) | 203 | const struct usb_device_id *id) |
204 | { | 204 | { |
205 | struct backlight_properties props; | ||
205 | struct appledisplay *pdata; | 206 | struct appledisplay *pdata; |
206 | struct usb_device *udev = interface_to_usbdev(iface); | 207 | struct usb_device *udev = interface_to_usbdev(iface); |
207 | struct usb_host_interface *iface_desc; | 208 | struct usb_host_interface *iface_desc; |
@@ -279,16 +280,16 @@ static int appledisplay_probe(struct usb_interface *iface, | |||
279 | /* Register backlight device */ | 280 | /* Register backlight device */ |
280 | snprintf(bl_name, sizeof(bl_name), "appledisplay%d", | 281 | snprintf(bl_name, sizeof(bl_name), "appledisplay%d", |
281 | atomic_inc_return(&count_displays) - 1); | 282 | atomic_inc_return(&count_displays) - 1); |
283 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
284 | props.max_brightness = 0xff; | ||
282 | pdata->bd = backlight_device_register(bl_name, NULL, pdata, | 285 | pdata->bd = backlight_device_register(bl_name, NULL, pdata, |
283 | &appledisplay_bl_data); | 286 | &appledisplay_bl_data, &props); |
284 | if (IS_ERR(pdata->bd)) { | 287 | if (IS_ERR(pdata->bd)) { |
285 | dev_err(&iface->dev, "Backlight registration failed\n"); | 288 | dev_err(&iface->dev, "Backlight registration failed\n"); |
286 | retval = PTR_ERR(pdata->bd); | 289 | retval = PTR_ERR(pdata->bd); |
287 | goto error; | 290 | goto error; |
288 | } | 291 | } |
289 | 292 | ||
290 | pdata->bd->props.max_brightness = 0xff; | ||
291 | |||
292 | /* Try to get brightness */ | 293 | /* Try to get brightness */ |
293 | brightness = appledisplay_bl_get_brightness(pdata->bd); | 294 | brightness = appledisplay_bl_get_brightness(pdata->bd); |
294 | 295 | ||