From e6574f2fbecdb8af807169d345c10131ae060a88 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 1 Apr 2009 03:57:53 -0300 Subject: V4L/DVB (11373): v4l2-common: add explicit v4l2_device pointer as first arg to new_(probed)_subdev The functions v4l2_i2c_new_subdev and v4l2_i2c_new_probed_subdev relied on i2c_get_adapdata to return the v4l2_device. However, this is not always possible on embedded platforms. So modify the API to pass the v4l2_device pointer explicitly. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/ivtv/ivtv-i2c.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'drivers/media/video/ivtv/ivtv-i2c.c') diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c index e73a196ecc7..1a289fd33cd 100644 --- a/drivers/media/video/ivtv/ivtv-i2c.c +++ b/drivers/media/video/ivtv/ivtv-i2c.c @@ -161,15 +161,18 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx) return -1; if (hw == IVTV_HW_TUNER) { /* special tuner handling */ - sd = v4l2_i2c_new_probed_subdev(adap, mod, type, + sd = v4l2_i2c_new_probed_subdev(&itv->v4l2_dev, + adap, mod, type, itv->card_i2c->radio); if (sd) sd->grp_id = 1 << idx; - sd = v4l2_i2c_new_probed_subdev(adap, mod, type, + sd = v4l2_i2c_new_probed_subdev(&itv->v4l2_dev, + adap, mod, type, itv->card_i2c->demod); if (sd) sd->grp_id = 1 << idx; - sd = v4l2_i2c_new_probed_subdev(adap, mod, type, + sd = v4l2_i2c_new_probed_subdev(&itv->v4l2_dev, + adap, mod, type, itv->card_i2c->tv); if (sd) sd->grp_id = 1 << idx; @@ -180,9 +183,11 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx) if (hw == IVTV_HW_UPD64031A || hw == IVTV_HW_UPD6408X) { unsigned short addrs[2] = { hw_addrs[idx], I2C_CLIENT_END }; - sd = v4l2_i2c_new_probed_subdev(adap, mod, type, addrs); + sd = v4l2_i2c_new_probed_subdev(&itv->v4l2_dev, + adap, mod, type, addrs); } else { - sd = v4l2_i2c_new_subdev(adap, mod, type, hw_addrs[idx]); + sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, + adap, mod, type, hw_addrs[idx]); } if (sd) sd->grp_id = 1 << idx; -- cgit v1.2.3