Skip to contentSkip to conversation

vpif_display.c bug

DISCUSSION Hans Verkuil 3 participants 6 messages Aug 10, 2009 – Aug 11, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi Chaithrika,

This code in vpif_display.c is not correct:

        for (i = 0; i < subdev_count; i++) {
                vpif_obj.sd[i] = v4l2_i2c_new_probed_subdev(&vpif_obj.v4l2_dev,
                                                i2c_adap, subdevdata[i].name,
                                                subdevdata[i].name,
                                                &subdevdata[i].addr);
                if (!vpif_obj.sd[i]) {
                        vpif_err("Error registering v4l2 subdevice\n");
                        goto probe_subdev_out;
                }

                if (vpif_obj.sd[i])
                        vpif_obj.sd[i]->grp_id = 1 << i;
        }

This: '&subdevdata[i].addr' should be: I2C_ADDRS(subdevdata[i].addr).

The list of probe addresses must be terminated by I2C_CLIENT_END (= -1) and that isn't the case here.

An alternative solution is to use v4l2_i2c_new_subdev, but then no probing will take place. But I think that you don't want probing at all since this address information comes from the platform data, so one can assume that that data is correct.

Even better is to copy the implementation from vpfe_capture.c and to use v4l2_i2c_new_subdev_board().

Regards,

Hans

Signature · 1 line
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
#1 lore raw
Quoted 23 lines · Hans Verkuil

Hi Chaithrika,

This code in vpif_display.c is not correct:

        for (i = 0; i < subdev_count; i++) {
                vpif_obj.sd[i] = v4l2_i2c_new_probed_subdev(&vpif_obj.v4l2_dev,
                                                i2c_adap, subdevdata[i].name,
                                                subdevdata[i].name,
                                                &subdevdata[i].addr);
                if (!vpif_obj.sd[i]) {
                        vpif_err("Error registering v4l2 subdevice\n");
                        goto probe_subdev_out;
                }

                if (vpif_obj.sd[i])
                        vpif_obj.sd[i]->grp_id = 1 << i;
        }

This: '&subdevdata[i].addr' should be: I2C_ADDRS(subdevdata[i].addr).

The list of probe addresses must be terminated by I2C_CLIENT_END (= -1) and that isn't the case here.

Quoted 8 lines

An alternative solution is to use v4l2_i2c_new_subdev, but then no probing will take place. But I think that you don't want probing at all since this address information comes from the platform data, so one can assume that that data is correct.

Even better is to copy the implementation from vpfe_capture.c and to use v4l2_i2c_new_subdev_board().

Hans,
Thank you for the suggestions.
I will look into this and submit a patch to correct this bug.

Regards,
Chaithrika

Quoted 7 lines

Regards,

Hans

Signature · 1 line
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
#2 lore raw

Chaithrika,

No need to change this since this is already corrected as part of my vpif capture patch set that I had submitted for review. I had mentioned this to Hans as well.

Murali Karicheri
Software Design Engineer
Texas Instruments Inc.
Germantown, MD 20874
new phone: 301-407-9583
Old Phone : 301-515-3736 (will be deprecated)
email: [email protected]

Quoted 68 lines

-----Original Message-----
From: [email protected] [mailto:linux-media- [email protected]] On Behalf Of Subrahmanya, Chaithrika
Sent: Monday, August 10, 2009 8:51 AM
To: 'Hans Verkuil'
Cc: [email protected]
Subject: RE: vpif_display.c bug

Quoted 6 lines · Hans Verkuil

Hi Chaithrika,

This code in vpif_display.c is not correct:

        for (i = 0; i < subdev_count; i++) {
                vpif_obj.sd[i] =

v4l2_i2c_new_probed_subdev(&vpif_obj.v4l2_dev,

Quoted 1 line
                                                i2c_adap,

subdevdata[i].name,

Quoted 11 lines
                                                subdevdata[i].name,
                                                &subdevdata[i].addr);
                if (!vpif_obj.sd[i]) {
                        vpif_err("Error registering v4l2 subdevice\n");
                        goto probe_subdev_out;
                }

                if (vpif_obj.sd[i])
                        vpif_obj.sd[i]->grp_id = 1 << i;
        }
Quoted 3 lines

This: '&subdevdata[i].addr' should be: I2C_ADDRS(subdevdata[i].addr).

The list of probe addresses must be terminated by I2C_CLIENT_END (= -1)

and

Quoted 3 lines

that isn't the case here.

An alternative solution is to use v4l2_i2c_new_subdev, but then no

probing

Quoted 1 line

will take place. But I think that you don't want probing at all since

this

Quoted 6 lines

address information comes from the platform data, so one can assume that that data is correct.

Even better is to copy the implementation from vpfe_capture.c and to use v4l2_i2c_new_subdev_board().

Hans,
Thank you for the suggestions.
I will look into this and submit a patch to correct this bug.

Regards,
Chaithrika

Quoted 7 lines

Regards,

Hans

--
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 4 lines · Muralidharan

Chaithrika,

No need to change this since this is already corrected as part of my vpif capture patch set that I had submitted for review. I had mentioned this to Hans as well.

Murali,

Thank you for correcting this bug in your patch set.

Regards,
Chaithrika

Quoted 78 lines

Murali Karicheri
Software Design Engineer
Texas Instruments Inc.
Germantown, MD 20874
new phone: 301-407-9583
Old Phone : 301-515-3736 (will be deprecated)
email: [email protected]

Quoted 68 lines

-----Original Message-----
From: [email protected] [mailto:linux-media- [email protected]] On Behalf Of Subrahmanya, Chaithrika
Sent: Monday, August 10, 2009 8:51 AM
To: 'Hans Verkuil'
Cc: [email protected]
Subject: RE: vpif_display.c bug

Quoted 6 lines · Hans Verkuil

Hi Chaithrika,

This code in vpif_display.c is not correct:

        for (i = 0; i < subdev_count; i++) {
                vpif_obj.sd[i] =

v4l2_i2c_new_probed_subdev(&vpif_obj.v4l2_dev,

Quoted 1 line
                                                i2c_adap,

subdevdata[i].name,

Quoted 11 lines
                                                subdevdata[i].name,
                                                &subdevdata[i].addr);
                if (!vpif_obj.sd[i]) {
                        vpif_err("Error registering v4l2 subdevice\n");
                        goto probe_subdev_out;
                }

                if (vpif_obj.sd[i])
                        vpif_obj.sd[i]->grp_id = 1 << i;
        }
Quoted 3 lines

This: '&subdevdata[i].addr' should be: I2C_ADDRS(subdevdata[i].addr).

The list of probe addresses must be terminated by I2C_CLIENT_END (= -1)

and

Quoted 3 lines

that isn't the case here.

An alternative solution is to use v4l2_i2c_new_subdev, but then no

probing

Quoted 1 line

will take place. But I think that you don't want probing at all since

this

Quoted 6 lines

address information comes from the platform data, so one can assume that that data is correct.

Even better is to copy the implementation from vpfe_capture.c and to use v4l2_i2c_new_subdev_board().

Hans,
Thank you for the suggestions.
I will look into this and submit a patch to correct this bug.

Regards,
Chaithrika

Quoted 7 lines

Regards,

Hans

--
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to Hans Verkuil

Hans,

I have already changed v4l2_i2c_new_probed_subdev() to v4l2_i2c_new_subdev_board() in my latest patch set for adding vpif capture driver for DM6467 that you had reviewed. I think this change is not needed once that patch is applied.

Murali Karicheri
Software Design Engineer
Texas Instruments Inc.
Germantown, MD 20874
new phone: 301-407-9583
Old Phone : 301-515-3736 (will be deprecated)
email: [email protected]

Quoted 51 lines

-----Original Message-----
From: [email protected] [mailto:linux-media- [email protected]] On Behalf Of Hans Verkuil
Sent: Monday, August 10, 2009 2:07 AM
To: Subrahmanya, Chaithrika
Cc: [email protected]
Subject: vpif_display.c bug

Hi Chaithrika,

This code in vpif_display.c is not correct:

       for (i = 0; i < subdev_count; i++) {
               vpif_obj.sd[i] =
v4l2_i2c_new_probed_subdev(&vpif_obj.v4l2_dev,
                                               i2c_adap,
subdevdata[i].name,
                                               subdevdata[i].name,
                                               &subdevdata[i].addr);
               if (!vpif_obj.sd[i]) {
                       vpif_err("Error registering v4l2 subdevice\n");
                       goto probe_subdev_out;
               }

               if (vpif_obj.sd[i])
                       vpif_obj.sd[i]->grp_id = 1 << i;
       }

This: '&subdevdata[i].addr' should be: I2C_ADDRS(subdevdata[i].addr).

The list of probe addresses must be terminated by I2C_CLIENT_END (= -1) and that isn't the case here.

An alternative solution is to use v4l2_i2c_new_subdev, but then no probing will take place. But I think that you don't want probing at all since this address information comes from the platform data, so one can assume that that data is correct.

Even better is to copy the implementation from vpfe_capture.c and to use v4l2_i2c_new_subdev_board().

Regards,

Hans

--
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom --
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 4 lines · Muralidharan

Hans,

I have already changed v4l2_i2c_new_probed_subdev() to v4l2_i2c_new_subdev_board() in my latest patch set for adding vpif capture driver for DM6467 that you had reviewed. I think this change is not needed once that patch is applied.

You are right. Hmm, I really have a bad memory for these things, I reviewed it only last Friday :-(

Regards,

Hans

Quoted 64 lines

Murali Karicheri
Software Design Engineer
Texas Instruments Inc.
Germantown, MD 20874
new phone: 301-407-9583
Old Phone : 301-515-3736 (will be deprecated)
email: [email protected]

Quoted 51 lines

-----Original Message-----
From: [email protected] [mailto:linux-media- [email protected]] On Behalf Of Hans Verkuil
Sent: Monday, August 10, 2009 2:07 AM
To: Subrahmanya, Chaithrika
Cc: [email protected]
Subject: vpif_display.c bug

Hi Chaithrika,

This code in vpif_display.c is not correct:

       for (i = 0; i < subdev_count; i++) {
               vpif_obj.sd[i] =
v4l2_i2c_new_probed_subdev(&vpif_obj.v4l2_dev,
                                               i2c_adap,
subdevdata[i].name,
                                               subdevdata[i].name,
                                               &subdevdata[i].addr);
               if (!vpif_obj.sd[i]) {
                       vpif_err("Error registering v4l2 subdevice\n");
                       goto probe_subdev_out;
               }

               if (vpif_obj.sd[i])
                       vpif_obj.sd[i]->grp_id = 1 << i;
       }

This: '&subdevdata[i].addr' should be: I2C_ADDRS(subdevdata[i].addr).

The list of probe addresses must be terminated by I2C_CLIENT_END (= -1) and that isn't the case here.

An alternative solution is to use v4l2_i2c_new_subdev, but then no probing will take place. But I think that you don't want probing at all since this address information comes from the platform data, so one can assume that that data is correct.

Even better is to copy the implementation from vpfe_capture.c and to use v4l2_i2c_new_subdev_board().

Regards,

Hans

--
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom --
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom