提交 cedf8a78 编写于 作者: B Bruno Prémont 提交者: Greg Kroah-Hartman

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: NBruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 124d2553
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册