Commit 6a53fa23 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[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: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent a6f62431
...@@ -1142,16 +1142,12 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap) ...@@ -1142,16 +1142,12 @@ static int rtl2832u_tuner_attach(struct dvb_usb_adapter *adap)
pdata.v4l2_subdev = subdev; pdata.v4l2_subdev = subdev;
request_module("%s", "rtl2832_sdr"); request_module("%s", "rtl2832_sdr");
pdev = platform_device_register_data(&priv->i2c_client_demod->dev, pdev = platform_device_register_data(&d->intf->dev,
"rtl2832_sdr", "rtl2832_sdr",
PLATFORM_DEVID_AUTO, PLATFORM_DEVID_AUTO,
&pdata, sizeof(pdata)); &pdata, sizeof(pdata));
if (pdev == NULL || pdev->dev.driver == NULL) if (pdev == NULL || pdev->dev.driver == NULL)
break; break;
if (!try_module_get(pdev->dev.driver->owner)) {
platform_device_unregister(pdev);
break;
}
priv->platform_device_sdr = pdev; priv->platform_device_sdr = pdev;
break; break;
default: default:
...@@ -1175,10 +1171,8 @@ static int rtl2832u_tuner_detach(struct dvb_usb_adapter *adap) ...@@ -1175,10 +1171,8 @@ static int rtl2832u_tuner_detach(struct dvb_usb_adapter *adap)
/* remove platform SDR */ /* remove platform SDR */
pdev = priv->platform_device_sdr; pdev = priv->platform_device_sdr;
if (pdev) { if (pdev)
module_put(pdev->dev.driver->owner);
platform_device_unregister(pdev); platform_device_unregister(pdev);
}
/* remove I2C tuner */ /* remove I2C tuner */
client = priv->i2c_client_tuner; client = priv->i2c_client_tuner;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment