Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] rtl28xxu: do not hard depend on staging SDR module

RTL2832 SDR extension module is currently on staging. SDR module
headers were included from staging causing direct dependency staging
directory. As a solution, add needed headers to main driver.
Motivation of that change comes from Luis / driver backports project.

Reported-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Cc: backports@vger.kernel.org
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

authored by

Antti Palosaari and committed by
Mauro Carvalho Chehab
1fd10f98 277a163c

+20 -2
-1
drivers/media/usb/dvb-usb-v2/Makefile
··· 41 41 ccflags-y += -I$(srctree)/drivers/media/dvb-frontends 42 42 ccflags-y += -I$(srctree)/drivers/media/tuners 43 43 ccflags-y += -I$(srctree)/drivers/media/common 44 - ccflags-y += -I$(srctree)/drivers/staging/media/rtl2832u_sdr
+20 -1
drivers/media/usb/dvb-usb-v2/rtl28xxu.c
··· 24 24 25 25 #include "rtl2830.h" 26 26 #include "rtl2832.h" 27 - #include "rtl2832_sdr.h" 28 27 29 28 #include "qt1010.h" 30 29 #include "mt2060.h" ··· 34 35 #include "fc2580.h" 35 36 #include "tua9001.h" 36 37 #include "r820t.h" 38 + 39 + /* 40 + * RTL2832_SDR module is in staging. That logic is added in order to avoid any 41 + * hard dependency to drivers/staging/ directory as we want compile mainline 42 + * driver even whole staging directory is missing. 43 + */ 44 + #include <media/v4l2-subdev.h> 45 + 46 + #if IS_ENABLED(CONFIG_DVB_RTL2832_SDR) 47 + struct dvb_frontend *rtl2832_sdr_attach(struct dvb_frontend *fe, 48 + struct i2c_adapter *i2c, const struct rtl2832_config *cfg, 49 + struct v4l2_subdev *sd); 50 + #else 51 + static inline struct dvb_frontend *rtl2832_sdr_attach(struct dvb_frontend *fe, 52 + struct i2c_adapter *i2c, const struct rtl2832_config *cfg, 53 + struct v4l2_subdev *sd) 54 + { 55 + return NULL; 56 + } 57 + #endif 37 58 38 59 static int rtl28xxu_disable_rc; 39 60 module_param_named(disable_rc, rtl28xxu_disable_rc, int, 0644);