From 28d85873cd6d8d3176e30e02b941b1329df1024c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bruno=20Pr=C3=A9mont?= Date: Fri, 26 Feb 2010 13:17:16 +0100 Subject: [PATCH] backlight: msi-laptop, msi-wmi: fix incomplete registration failure handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Properly return backlight registration error to parent. Mark struct backlight_ops as const. Signed-off-by: Bruno Prémont Reviewed-by: Anisse Astier Signed-off-by: Richard Purdie --- drivers/platform/x86/msi-wmi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c index fb7ccaae6563..367caaae2f3c 100644 --- a/drivers/platform/x86/msi-wmi.c +++ b/drivers/platform/x86/msi-wmi.c @@ -138,7 +138,7 @@ static int bl_set_status(struct backlight_device *bd) return msi_wmi_set_block(0, backlight_map[bright]); } -static struct backlight_ops msi_backlight_ops = { +static const struct backlight_ops msi_backlight_ops = { .get_brightness = bl_get, .update_status = bl_set_status, }; @@ -255,8 +255,10 @@ static int __init msi_wmi_init(void) backlight = backlight_device_register(DRV_NAME, NULL, NULL, &msi_backlight_ops, &props); - if (IS_ERR(backlight)) + if (IS_ERR(backlight)) { + err = PTR_ERR(backlight); goto err_free_input; + } err = bl_get(NULL); if (err < 0) -- 2.20.1