summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dvb_usb.h
diff options
context:
space:
mode:
authorAntti Palosaari2012-06-16 22:58:53 +0200
committerMauro Carvalho Chehab2012-08-04 12:56:34 +0200
commitf89f9ff883cc5233933ef0b61845fc795ffa18d5 (patch)
tree9c7cebcdb3530bcbf82612c8bdc06cebdf61e727 /drivers/media/dvb/dvb-usb/dvb_usb.h
parent[media] af9015: update USB streaming configuration logic (diff)
downloadkernel-qcow2-linux-f89f9ff883cc5233933ef0b61845fc795ffa18d5.tar.gz
kernel-qcow2-linux-f89f9ff883cc5233933ef0b61845fc795ffa18d5.tar.xz
kernel-qcow2-linux-f89f9ff883cc5233933ef0b61845fc795ffa18d5.zip
[media] dvb_usb_v2: helper macros for device/adapter/frontend pointers
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dvb_usb.h')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb_usb.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb.h b/drivers/media/dvb/dvb-usb/dvb_usb.h
index 56df13fbc05e..fadc0f988efe 100644
--- a/drivers/media/dvb/dvb-usb/dvb_usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb_usb.h
@@ -22,6 +22,14 @@
#include "dmxdev.h"
#include "dvb-usb-ids.h"
+/* helper macros for every DVB USB driver use */
+#define adap_to_d(adap) ((adap)->dev)
+#define adap_to_priv(adap) (adap_to_d(adap)->priv)
+#define fe_to_adap(fe) ((struct dvb_usb_adapter *) ((fe)->dvb->priv))
+#define fe_to_d(fe) (adap_to_d(fe_to_adap(fe)))
+#define fe_to_priv(fe) (fe_to_d(fe)->priv)
+#define d_to_priv(d) (d->priv)
+
#define DVB_USB_STREAM_BULK(endpoint_, count_, size_) { \
.type = USB_BULK, \
.count = count_, \