return ret;
}
-static void dvb_usbv2_media_device_register(struct dvb_usb_device *d)
+static void dvb_usbv2_media_device_register(struct dvb_usb_adapter *adap)
{
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
-
struct media_device *mdev;
+ struct dvb_usb_device *d = adap_to_d(adap);
struct usb_device *udev = d->udev;
int ret;
return;
}
- d->media_dev = mdev;
+ adap->dvb_adap.mdev = mdev;
dev_info(&d->udev->dev, "media controller created\n");
#endif
}
-static void dvb_usbv2_media_device_unregister(struct dvb_usb_device *d)
+static void dvb_usbv2_media_device_unregister(struct dvb_usb_adapter *adap)
{
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
- if (!d->media_dev)
+
+ if (!adap->dvb_adap.mdev)
return;
- media_device_unregister(d->media_dev);
- kfree(d->media_dev);
- d->media_dev = NULL;
+ media_device_unregister(adap->dvb_adap.mdev);
+ kfree(adap->dvb_adap.mdev);
+ adap->dvb_adap.mdev = NULL;
#endif
}
{
int ret;
struct dvb_usb_device *d = adap_to_d(adap);
+
dev_dbg(&d->udev->dev, "%s: adap=%d\n", __func__, adap->id);
ret = dvb_register_adapter(&adap->dvb_adap, d->name, d->props->owner,
adap->dvb_adap.priv = adap;
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
- dvb_usbv2_media_device_register(d);
- adap->dvb_adap.mdev = d->media_dev;
+ dvb_usbv2_media_device_register(adap);
#endif
if (d->props->read_mac_address) {
err_dvb_dmxdev_init:
dvb_dmx_release(&adap->demux);
err_dvb_dmx_init:
- dvb_usbv2_media_device_unregister(d);
+ dvb_usbv2_media_device_unregister(adap);
dvb_unregister_adapter(&adap->dvb_adap);
err_dvb_register_adapter:
adap->dvb_adap.priv = NULL;
adap->demux.dmx.close(&adap->demux.dmx);
dvb_dmxdev_release(&adap->dmxdev);
dvb_dmx_release(&adap->demux);
- dvb_usbv2_media_device_unregister(d);
+ dvb_usbv2_media_device_unregister(adap);
dvb_unregister_adapter(&adap->dvb_adap);
}
}
}
- dvb_create_media_graph(d->media_dev);
+ dvb_create_media_graph(adap->dvb_adap.mdev);
return 0;