pr_err("dvb_register_adapter() failed %d\n", rc);
goto adapter_error;
}
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
- client->adapter.mdev = coredev->media_dev;
-#endif
+ dvb_register_media_controller(&client->adapter, coredev->media_dev);
/* init dvb demux */
client->demux.dmx.capabilities = DMX_TS_FILTERING;
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
void dvb_create_media_graph(struct dvb_adapter *adap);
+static inline void dvb_register_media_controller(struct dvb_adapter *adap,
+ struct media_device *mdev)
+{
+ adap->mdev = mdev;
+}
+
#else
static inline void dvb_create_media_graph(struct dvb_adapter *adap) {}
+#define dvb_register_media_controller(a, b) {}
#endif
extern int dvb_generic_open (struct inode *inode, struct file *file);
dev->name, result);
goto fail_adapter;
}
-#ifdef CONFIG_MEDIA_CONTROLLER_DVB
- dvb->adapter.mdev = dev->media_dev;
-#endif
+ dvb_register_media_controller(&dvb->adapter, dev->media_dev);
/* Ensure all frontends negotiate bus access */
dvb->frontend->ops.ts_bus_ctrl = cx231xx_dvb_bus_ctrl;
return;
}
- adap->dvb_adap.mdev = mdev;
+ dvb_register_media_controller(&adap->dvb_adap, mdev);
dev_info(&d->udev->dev, "media controller created\n");
kfree(mdev);
return;
}
- adap->dvb_adap.mdev = mdev;
+ dvb_register_media_controller(&adap->dvb_adap, mdev);
dev_info(&d->udev->dev, "media controller created\n");
#endif