mirror of
https://github.com/adulau/aha.git
synced 2025-01-01 13:46:24 +00:00
V4L/DVB (6466): v4l2-i2c-drv: first call remove, then detach client
The remove driver function expects that the client is still attached to the driver, so do the detach after calling remove(). Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
188f3457c2
commit
a2e521e85c
1 changed files with 5 additions and 3 deletions
|
@ -58,12 +58,14 @@ static int v4l2_i2c_drv_probe_legacy(struct i2c_adapter *adapter)
|
||||||
|
|
||||||
static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client)
|
static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client)
|
||||||
{
|
{
|
||||||
int err = i2c_detach_client(client);
|
int err;
|
||||||
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
if (v4l2_i2c_data.remove)
|
if (v4l2_i2c_data.remove)
|
||||||
v4l2_i2c_data.remove(client);
|
v4l2_i2c_data.remove(client);
|
||||||
|
|
||||||
|
err = i2c_detach_client(client);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
kfree(client);
|
kfree(client);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue