This prevents division by zero scan_rate.
The zero scan_rate does not need any special action as it actually means
"never poll again".
Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
do_rx_work(dev);
if (dev->polling_mode) {
- if (dev->is_open[CH_RX])
+ if (dev->is_open[CH_RX] && scan_rate)
schedule_delayed_work(&dev->rx.dwork,
msecs_to_jiffies(MSEC_PER_SEC
/ scan_rate));