Re: [PATCH] i2c: replace i2c_new_secondary_device with an ERR_PTR variant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Laurent,

> > > > +		if (IS_ERR(state->i2c_clients[i])) {
> > > > +			err = PTR_ERR(state->i2c_clients[i]);
> > > >  			v4l2_err(sd, "failed to create i2c client %u\n", i);
> > > >  			goto err_i2c;
> 
> This will call adv76xx_unregister_clients(), which will try to
> i2c_unregister_device() all non-NULL i2c_clients entries. You need to

Uh, right! Sorry for missing this :(

> either set the entry to NULL here, or update
> adv76xx_unregister_clients() to skip IS_ERR() entries. My preference
> would be to store the return value of adv76xx_dummy_client() in a local
> variable here, and set state->i2c_clients[i] after the error check.

I implemented your preference and simplified
adv76xx_unregister_clients() because i2c_unregister_device is NULL
pointer aware. New patch coming in a minute.

Thanks for the review,

   Wolfram

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux