diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-09-17 10:13:45 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2007-09-17 10:13:45 +0200 |
commit | dfcd6af68fc687d7efab92de9b9c183ab59867cb (patch) | |
tree | ccece0065027515681a1dcc302b51c269578c4e1 /linux/include | |
parent | 3f466835bc047f9f83f11ce8dcecc3021de4dec2 (diff) | |
download | mediapointer-dvb-s2-dfcd6af68fc687d7efab92de9b9c183ab59867cb.tar.gz mediapointer-dvb-s2-dfcd6af68fc687d7efab92de9b9c183ab59867cb.tar.bz2 |
v4l2-i2c-drv: first call remove, then detach client
From: Hans Verkuil <hverkuil@xs4all.nl>
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>
---
linux/include/media/v4l2-i2c-drv-legacy.h | 8 +++++---
linux/include/media/v4l2-i2c-drv.h | 8 +++++---
2 files changed, 10 insertions(+), 6 deletions(-)
Diffstat (limited to 'linux/include')
-rw-r--r-- | linux/include/media/v4l2-i2c-drv-legacy.h | 8 | ||||
-rw-r--r-- | linux/include/media/v4l2-i2c-drv.h | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/linux/include/media/v4l2-i2c-drv-legacy.h b/linux/include/media/v4l2-i2c-drv-legacy.h index 451cbe71d..fa55a1479 100644 --- a/linux/include/media/v4l2-i2c-drv-legacy.h +++ b/linux/include/media/v4l2-i2c-drv-legacy.h @@ -71,12 +71,14 @@ static int v4l2_i2c_drv_probe_legacy(struct i2c_adapter *adapter) 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) v4l2_i2c_data.remove(client); + + err = i2c_detach_client(client); + if (err) + return err; kfree(client); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) diff --git a/linux/include/media/v4l2-i2c-drv.h b/linux/include/media/v4l2-i2c-drv.h index f5bcf0926..726120399 100644 --- a/linux/include/media/v4l2-i2c-drv.h +++ b/linux/include/media/v4l2-i2c-drv.h @@ -90,12 +90,14 @@ static int v4l2_i2c_drv_probe_legacy(struct i2c_adapter *adapter) 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) v4l2_i2c_data.remove(client); + + err = i2c_detach_client(client); + if (err) + return err; kfree(client); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) |