Fix ignored error when creating polling task
This commit is contained in:
parent
120b0e8904
commit
0ca551be36
|
|
@ -107,6 +107,8 @@ static void s76_input_screen_wmi(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int s76_input_open(struct input_dev *dev) {
|
static int s76_input_open(struct input_dev *dev) {
|
||||||
|
int res = 0;
|
||||||
|
|
||||||
// Run polling thread if AP key driver is used and WMI is not supported
|
// Run polling thread if AP key driver is used and WMI is not supported
|
||||||
if ((driver_flags & (DRIVER_AP_KEY | DRIVER_AP_WMI)) == DRIVER_AP_KEY) {
|
if ((driver_flags & (DRIVER_AP_KEY | DRIVER_AP_WMI)) == DRIVER_AP_KEY) {
|
||||||
s76_input_polling_task = kthread_run(
|
s76_input_polling_task = kthread_run(
|
||||||
|
|
@ -114,13 +116,14 @@ static int s76_input_open(struct input_dev *dev) {
|
||||||
NULL, "system76-polld");
|
NULL, "system76-polld");
|
||||||
|
|
||||||
if (unlikely(IS_ERR(s76_input_polling_task))) {
|
if (unlikely(IS_ERR(s76_input_polling_task))) {
|
||||||
|
res = PTR_ERR(s76_input_polling_task);
|
||||||
s76_input_polling_task = NULL;
|
s76_input_polling_task = NULL;
|
||||||
S76_ERROR("Could not create polling thread\n");
|
S76_ERROR("Could not create polling thread: %d\n", res);
|
||||||
return PTR_ERR(s76_input_polling_task);
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void s76_input_close(struct input_dev *dev) {
|
static void s76_input_close(struct input_dev *dev) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue