diff options
author | Bruno Prémont <bonbons@linux-vserver.org> | 2010-02-26 07:02:04 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:55:22 -0500 |
commit | cedf8a78421943441b9011ce7bcdab55f07d2ea6 (patch) | |
tree | aaa828c89672f782a596abf5bc23b35f936ec9f9 /drivers/usb/misc | |
parent | 124d255382ddd37ffa920e9f5183efa54bbfe4f2 (diff) |
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 <bonbons@linux-vserver.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r-- | drivers/usb/misc/appledisplay.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
179 | return pdata->msgdata[1]; | 179 | return pdata->msgdata[1]; |
180 | } | 180 | } |
181 | 181 | ||
182 | static struct backlight_ops appledisplay_bl_data = { | 182 | static const struct backlight_ops appledisplay_bl_data = { |
183 | .get_brightness = appledisplay_bl_get_brightness, | 183 | .get_brightness = appledisplay_bl_get_brightness, |
184 | .update_status = appledisplay_bl_update_status, | 184 | .update_status = appledisplay_bl_update_status, |
185 | }; | 185 | }; |
@@ -283,6 +283,7 @@ static int appledisplay_probe(struct usb_interface *iface, | |||
283 | &appledisplay_bl_data); | 283 | &appledisplay_bl_data); |
284 | if (IS_ERR(pdata->bd)) { | 284 | if (IS_ERR(pdata->bd)) { |
285 | dev_err(&iface->dev, "Backlight registration failed\n"); | 285 | dev_err(&iface->dev, "Backlight registration failed\n"); |
286 | retval = PTR_ERR(pdata->bd); | ||
286 | goto error; | 287 | goto error; |
287 | } | 288 | } |
288 | 289 | ||