media: dvb-usb-v2: lmedm04: move ts2020 attach to dm04_lme2510_tuner
authorMalcolm Priestley <tvboxspy@gmail.com>
Tue, 26 Sep 2017 21:10:21 +0000 (17:10 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Feb 2018 12:21:13 +0000 (13:21 +0100)
commitf320dd20224ca9193040c379f0243030dd67fa4b
tree9459b81ba97845a5f1f588a20e0295195a73230c
parent1ff1353a03c6cde5334a94cb67f8632141b0589b
media: dvb-usb-v2: lmedm04: move ts2020 attach to dm04_lme2510_tuner

commit 7bf7a7116ed313c601307f7e585419369926ab05 upstream.

When the tuner was split from m88rs2000 the attach function is in wrong
place.

Move to dm04_lme2510_tuner to trap errors on failure and removing
a call to lme_coldreset.

Prevents driver starting up without any tuner connected.

Fixes to trap for ts2020 fail.
LME2510(C): FE Found M88RS2000
ts2020: probe of 0-0060 failed with error -11
...
LME2510(C): TUN Found RS2000 tuner
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/usb/dvb-usb-v2/lmedm04.c