aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-12-17 06:16:10 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-03 13:21:48 -0500
commit6a53fa2350f724ca84b0a1946f3046855e1efd41 (patch)
tree2ecb4b969006f871392f74719524037b35d6d85a /drivers/media
parenta6f62431a0c166c171b6b7a62d6cad79fbbdc5da (diff)
[media] rtl28xxu: do not refcount rtl2832_sdr module
This driver, rtl28xxu, offers frontend service for rtl2832_sdr module, thus we are producer and rtl2832_sdr module is consumer. Due to that, reference counting should be done in way rtl2832_sdr takes refrence to rtl28xxu. Remove wrong refcount. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/dvb-usb-v2/rtl28xxu.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index f4750189e948..27cf3419d4f1 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -1142,16 +1142,12 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
1142 pdata.v4l2_subdev = subdev; 1142 pdata.v4l2_subdev = subdev;
1143 1143
1144 request_module("%s", "rtl2832_sdr"); 1144 request_module("%s", "rtl2832_sdr");
1145 pdev = platform_device_register_data(&priv->i2c_client_demod->dev, 1145 pdev = platform_device_register_data(&d->intf->dev,
1146 "rtl2832_sdr", 1146 "rtl2832_sdr",
1147 PLATFORM_DEVID_AUTO, 1147 PLATFORM_DEVID_AUTO,
1148 &pdata, sizeof(pdata)); 1148 &pdata, sizeof(pdata));
1149 if (pdev == NULL || pdev->dev.driver == NULL) 1149 if (pdev == NULL || pdev->dev.driver == NULL)
1150 break; 1150 break;
1151 if (!try_module_get(pdev->dev.driver->owner)) {
1152 platform_device_unregister(pdev);
1153 break;
1154 }
1155 priv->platform_device_sdr = pdev; 1151 priv->platform_device_sdr = pdev;
1156 break; 1152 break;
1157 default: 1153 default:
@@ -1175,10 +1171,8 @@ static int rtl2832u_tuner_detach(struct dvb_usb_adapter *adap)
1175 1171
1176 /* remove platform SDR */ 1172 /* remove platform SDR */
1177 pdev = priv->platform_device_sdr; 1173 pdev = priv->platform_device_sdr;
1178 if (pdev) { 1174 if (pdev)
1179 module_put(pdev->dev.driver->owner);
1180 platform_device_unregister(pdev); 1175 platform_device_unregister(pdev);
1181 }
1182 1176
1183 /* remove I2C tuner */ 1177 /* remove I2C tuner */
1184 client = priv->i2c_client_tuner; 1178 client = priv->i2c_client_tuner;