[PATCH 56/66] rtl28xxu: do not refcount rtl2832_sdr module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 10 ++--------
 1 file 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 f475018..27cf341 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)
 		pdata.v4l2_subdev = subdev;
 
 		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",
 						     PLATFORM_DEVID_AUTO,
 						     &pdata, sizeof(pdata));
 		if (pdev == NULL || pdev->dev.driver == NULL)
 			break;
-		if (!try_module_get(pdev->dev.driver->owner)) {
-			platform_device_unregister(pdev);
-			break;
-		}
 		priv->platform_device_sdr = pdev;
 		break;
 	default:
@@ -1175,10 +1171,8 @@ static int rtl2832u_tuner_detach(struct dvb_usb_adapter *adap)
 
 	/* remove platform SDR */
 	pdev = priv->platform_device_sdr;
-	if (pdev) {
-		module_put(pdev->dev.driver->owner);
+	if (pdev)
 		platform_device_unregister(pdev);
-	}
 
 	/* remove I2C tuner */
 	client = priv->i2c_client_tuner;
-- 
http://palosaari.fi/

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux