Skip to content

Commit

Permalink
USB: backlight, appledisplay: fix incomplete registration failure han…
Browse files Browse the repository at this point in the history
…dling

On error while registering backlight, return it to caller instead of
returning 0.
Mark struct backlight_ops as const.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Bruno Prémont authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 124d255 commit cedf8a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/misc/appledisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static int appledisplay_bl_get_brightness(struct backlight_device *bd)
return pdata->msgdata[1];
}

static struct backlight_ops appledisplay_bl_data = {
static const struct backlight_ops appledisplay_bl_data = {
.get_brightness = appledisplay_bl_get_brightness,
.update_status = appledisplay_bl_update_status,
};
Expand Down Expand Up @@ -283,6 +283,7 @@ static int appledisplay_probe(struct usb_interface *iface,
&appledisplay_bl_data);
if (IS_ERR(pdata->bd)) {
dev_err(&iface->dev, "Backlight registration failed\n");
retval = PTR_ERR(pdata->bd);
goto error;
}

Expand Down

0 comments on commit cedf8a7

Please sign in to comment.