Martin Wache 5332b62637 [media] dib7000p: avoid division by zero
dib7000p_read_word() may return zero on i2c errors, resulting in
dib7000p_get_internal_freq() returning zero.
So don't divide by the result of dib7000p_get_internal_freq()
without checking it for zero in dib7000p_set_dds().

On one of my machines the device
ID 2304:0229 Pinnacle Systems, Inc. PCTV Dual DVB-T 2001e
about once a day/every two days gets into a state, where
most (all?) I2C reads return with an error. Tuning during this
state will result in a divide by zero without this patch.
This patch doesn't fix the root cause for the device getting
into a bad state, but it allows me to unload/reload the drivers,
bringing it back into a usable state.

Signed-off-by: Martin Wache <M.Wache@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03 10:54:20 -02:00
..
2015-08-11 07:10:04 -03:00
2016-01-25 12:01:08 -02:00
2016-11-13 10:02:22 -08:00
2017-02-03 07:01:00 -02:00
2017-02-03 07:01:00 -02:00
2016-06-07 15:41:58 -03:00
2016-03-03 09:26:05 -03:00
2015-04-08 15:02:07 -03:00
2016-09-22 12:55:49 -03:00