diff options
-rw-r--r-- | include/media/v4l2-i2c-drv-legacy.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/media/v4l2-i2c-drv-legacy.h b/include/media/v4l2-i2c-drv-legacy.h index 433c984eefa5..241854229d6f 100644 --- a/include/media/v4l2-i2c-drv-legacy.h +++ b/include/media/v4l2-i2c-drv-legacy.h | |||
@@ -58,12 +58,14 @@ static int v4l2_i2c_drv_probe_legacy(struct i2c_adapter *adapter) | |||
58 | 58 | ||
59 | static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client) | 59 | static int v4l2_i2c_drv_detach_legacy(struct i2c_client *client) |
60 | { | 60 | { |
61 | int err = i2c_detach_client(client); | 61 | int err; |
62 | 62 | ||
63 | if (err) | ||
64 | return err; | ||
65 | if (v4l2_i2c_data.remove) | 63 | if (v4l2_i2c_data.remove) |
66 | v4l2_i2c_data.remove(client); | 64 | v4l2_i2c_data.remove(client); |
65 | |||
66 | err = i2c_detach_client(client); | ||
67 | if (err) | ||
68 | return err; | ||
67 | kfree(client); | 69 | kfree(client); |
68 | 70 | ||
69 | return 0; | 71 | return 0; |