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

V4L/DVB (6893): tuner-xc2028: fix xc2028_attach function

xc2028_attach was returning an integer when disabled from the build, where it
should instead be returning NULL. Declare xc2028_attach as type dvb_frontend *
instead of void *.

The prototype declaration must be marked as extern in the header.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by

Michael Krufky and committed by
Mauro Carvalho Chehab
7972f988 fb6d8e2c

+7 -5
+2 -1
drivers/media/video/tuner-xc2028.c
··· 1140 1140 1141 1141 }; 1142 1142 1143 - void *xc2028_attach(struct dvb_frontend *fe, struct xc2028_config *cfg) 1143 + struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe, 1144 + struct xc2028_config *cfg) 1144 1145 { 1145 1146 struct xc2028_data *priv; 1146 1147 void *video_dev;
+5 -4
drivers/media/video/tuner-xc2028.h
··· 48 48 #define XC2028_RESET_CLK 1 49 49 50 50 #if defined(CONFIG_TUNER_XC2028) || (defined(CONFIG_TUNER_XC2028_MODULE) && defined(MODULE)) 51 - void *xc2028_attach(struct dvb_frontend *fe, struct xc2028_config *cfg); 51 + extern struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe, 52 + struct xc2028_config *cfg); 52 53 #else 53 - void *xc2028_attach(struct dvb_frontend *fe, 54 - struct xc2028_config *cfg) 54 + static inline struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe, 55 + struct xc2028_config *cfg) 55 56 { 56 57 printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n", 57 58 __FUNCTION__); 58 - return -EINVAL; 59 + return NULL; 59 60 } 60 61 #endif 61 62