media: lgdt3306a: Fix module count mismatch on usb unplug
authorBrad Love <brad@nextdimension.cc>
Fri, 5 Jan 2018 14:57:12 +0000 (09:57 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:17:42 +0000 (16:17 +0200)
commitf5f6bff50f36edf9cf503d8ea56a2b2e649236f4
tree91b54f195e6fa63520285194e77549b907cbf740
parentf3f3442027b5b4f7633fc008ade8b2f5558b16c9
media: lgdt3306a: Fix module count mismatch on usb unplug

[ Upstream commit 835d66173a38538c072a7c393d02360dcfac8582 ]

When used as an i2c device there is a module usage count mismatch on
removal, preventing the driver from being used thereafter. dvb_attach
increments the usage count so it is properly balanced on removal.

On disconnect of Hauppauge SoloHD/DualHD before:

lsmod | grep lgdt3306a
lgdt3306a              28672  -1
i2c_mux                16384  1 lgdt3306a

On disconnect of Hauppauge SoloHD/DualHD after:

lsmod | grep lgdt3306a
lgdt3306a              28672  0
i2c_mux                16384  1 lgdt3306a

Signed-off-by: Brad Love <brad@nextdimension.cc>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/dvb-frontends/lgdt3306a.c