[2/5] em28xx: fix i2c_set_adapdata() call in em28xx_i2c_register()

Message ID 1395493263-2158-2-git-send-email-fschaefer.oss@googlemail.com (mailing list archive)
State Superseded, archived
Delegated to: Hans Verkuil
Headers

Commit Message

Frank Schaefer March 22, 2014, 1:01 p.m. UTC
  Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
---
 drivers/media/usb/em28xx/em28xx-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Hans Verkuil May 9, 2014, 8:40 a.m. UTC | #1
Hi Frank,

I've got a comment about this patch:

On 03/22/2014 02:01 PM, Frank Schäfer wrote:
> Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
> ---
>  drivers/media/usb/em28xx/em28xx-i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c
> index ba6433c..04e8577 100644
> --- a/drivers/media/usb/em28xx/em28xx-i2c.c
> +++ b/drivers/media/usb/em28xx/em28xx-i2c.c
> @@ -939,7 +939,7 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned bus,
>  	dev->i2c_bus[bus].algo_type = algo_type;
>  	dev->i2c_bus[bus].dev = dev;
>  	dev->i2c_adap[bus].algo_data = &dev->i2c_bus[bus];
> -	i2c_set_adapdata(&dev->i2c_adap[bus], &dev->v4l2_dev);
> +	i2c_set_adapdata(&dev->i2c_adap[bus], dev);

As far as I can see nobody is calling i2c_get_adapdata. Should this line be removed
altogether?

If it is used somewhere, can you point me that?

I'm taking the other patches from this series (using the v2 version of patch 4/5) since
those look fine.

Regards,

	Hans

>  
>  	retval = i2c_add_adapter(&dev->i2c_adap[bus]);
>  	if (retval < 0) {
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Frank Schaefer May 11, 2014, 8:25 p.m. UTC | #2
Hi Hans,

Am 09.05.2014 10:40, schrieb Hans Verkuil:
> Hi Frank,
>
> I've got a comment about this patch:
>
> On 03/22/2014 02:01 PM, Frank Schäfer wrote:
>> Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
>> ---
>>  drivers/media/usb/em28xx/em28xx-i2c.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c
>> index ba6433c..04e8577 100644
>> --- a/drivers/media/usb/em28xx/em28xx-i2c.c
>> +++ b/drivers/media/usb/em28xx/em28xx-i2c.c
>> @@ -939,7 +939,7 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned bus,
>>  	dev->i2c_bus[bus].algo_type = algo_type;
>>  	dev->i2c_bus[bus].dev = dev;
>>  	dev->i2c_adap[bus].algo_data = &dev->i2c_bus[bus];
>> -	i2c_set_adapdata(&dev->i2c_adap[bus], &dev->v4l2_dev);
>> +	i2c_set_adapdata(&dev->i2c_adap[bus], dev);
> As far as I can see nobody is calling i2c_get_adapdata. Should this line be removed
> altogether?
>
> If it is used somewhere, can you point me that?
Good catch.
Indeed, nobody is using it anymore so it can removed instead.
Drop this patch, I will send a new one in a minute.

> I'm taking the other patches from this series (using the v2 version of patch 4/5) since
> those look fine.
Thanks !

Regards,
Frank


>
> Regards,
>
> 	Hans
>
>>  
>>  	retval = i2c_add_adapter(&dev->i2c_adap[bus]);
>>  	if (retval < 0) {
>>

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

Patch

diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c
index ba6433c..04e8577 100644
--- a/drivers/media/usb/em28xx/em28xx-i2c.c
+++ b/drivers/media/usb/em28xx/em28xx-i2c.c
@@ -939,7 +939,7 @@  int em28xx_i2c_register(struct em28xx *dev, unsigned bus,
 	dev->i2c_bus[bus].algo_type = algo_type;
 	dev->i2c_bus[bus].dev = dev;
 	dev->i2c_adap[bus].algo_data = &dev->i2c_bus[bus];
-	i2c_set_adapdata(&dev->i2c_adap[bus], &dev->v4l2_dev);
+	i2c_set_adapdata(&dev->i2c_adap[bus], dev);
 
 	retval = i2c_add_adapter(&dev->i2c_adap[bus]);
 	if (retval < 0) {