diff options
| author | Bartlomiej Zolnierkiewicz <[email protected]> | 2018-09-26 15:54:31 +0200 |
|---|---|---|
| committer | Bartlomiej Zolnierkiewicz <[email protected]> | 2018-09-26 15:54:31 +0200 |
| commit | aaccf3c97418f169afdbb5855e9cbcbda34e90fd (patch) | |
| tree | 5d4207e67958bdbc23288cf30178692f5534e1a0 /drivers/siox/siox-core.c | |
| parent | f39684524b391c5a7ed0ac44db4fec3357af1c5d (diff) | |
| parent | 6bf4ca7fbc85d80446ac01c0d1d77db4d91a6d84 (diff) | |
Merge tag 'v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into fbdev-for-next
Sync with upstream (which now contains fbdev-v4.19 changes) to
prepare a base for fbdev-v4.20 changes.
Diffstat (limited to 'drivers/siox/siox-core.c')
| -rw-r--r-- | drivers/siox/siox-core.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/siox/siox-core.c b/drivers/siox/siox-core.c index 16590dfaafa4..f8c08fb9891d 100644 --- a/drivers/siox/siox-core.c +++ b/drivers/siox/siox-core.c @@ -215,26 +215,26 @@ static void siox_poll(struct siox_master *smaster) siox_status_clean(status, sdevice->status_written_lastcycle); - /* Check counter bits */ - if (siox_device_counter_error(sdevice, status_clean)) { - bool prev_counter_error; + /* Check counter and type bits */ + if (siox_device_counter_error(sdevice, status_clean) || + siox_device_type_error(sdevice, status_clean)) { + bool prev_error; synced = false; /* only report a new error if the last cycle was ok */ - prev_counter_error = + prev_error = siox_device_counter_error(sdevice, - prev_status_clean); - if (!prev_counter_error) { + prev_status_clean) || + siox_device_type_error(sdevice, + prev_status_clean); + + if (!prev_error) { sdevice->status_errors++; sysfs_notify_dirent(sdevice->status_errors_kn); } } - /* Check type bits */ - if (siox_device_type_error(sdevice, status_clean)) - synced = false; - /* If the device is unsynced report the watchdog as active */ if (!synced) { status &= ~SIOX_STATUS_WDG; @@ -715,17 +715,17 @@ int siox_master_register(struct siox_master *smaster) dev_set_name(&smaster->dev, "siox-%d", smaster->busno); + mutex_init(&smaster->lock); + INIT_LIST_HEAD(&smaster->devices); + smaster->last_poll = jiffies; - smaster->poll_thread = kthread_create(siox_poll_thread, smaster, - "siox-%d", smaster->busno); + smaster->poll_thread = kthread_run(siox_poll_thread, smaster, + "siox-%d", smaster->busno); if (IS_ERR(smaster->poll_thread)) { smaster->active = 0; return PTR_ERR(smaster->poll_thread); } - mutex_init(&smaster->lock); - INIT_LIST_HEAD(&smaster->devices); - ret = device_add(&smaster->dev); if (ret) kthread_stop(smaster->poll_thread); |