From: Bruno Prémont Date: Fri, 26 Feb 2010 12:02:04 +0000 (+0100) Subject: USB: backlight, appledisplay: fix incomplete registration failure handling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cedf8a78421943441b9011ce7bcdab55f07d2ea6;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git USB: backlight, appledisplay: fix incomplete registration failure handling 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index 516079d703b4..4d2952f1fb13 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -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, }; @@ -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; }