Skip to content

Commit

Permalink
V4L/DVB (6893): tuner-xc2028: fix xc2028_attach function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jan 25, 2008
1 parent fb6d8e2 commit 7972f98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion drivers/media/video/tuner-xc2028.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,8 @@ static const struct dvb_tuner_ops xc2028_dvb_tuner_ops = {

};

void *xc2028_attach(struct dvb_frontend *fe, struct xc2028_config *cfg)
struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
struct xc2028_config *cfg)
{
struct xc2028_data *priv;
void *video_dev;
Expand Down
9 changes: 5 additions & 4 deletions drivers/media/video/tuner-xc2028.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ struct xc2028_config {
#define XC2028_RESET_CLK 1

#if defined(CONFIG_TUNER_XC2028) || (defined(CONFIG_TUNER_XC2028_MODULE) && defined(MODULE))
void *xc2028_attach(struct dvb_frontend *fe, struct xc2028_config *cfg);
extern struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
struct xc2028_config *cfg);
#else
void *xc2028_attach(struct dvb_frontend *fe,
struct xc2028_config *cfg)
static inline struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
struct xc2028_config *cfg)
{
printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
__FUNCTION__);
return -EINVAL;
return NULL;
}
#endif

Expand Down

0 comments on commit 7972f98

Please sign in to comment.