public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] [media] adv7180: Fix remove order
@ 2014-03-07 16:14 Lars-Peter Clausen
  2014-03-07 16:14 ` [PATCH 2/7] [media] adv7180: Free control handler on remove() Lars-Peter Clausen
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Lars-Peter Clausen @ 2014-03-07 16:14 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Vladimir Barinov, linux-media, Lars-Peter Clausen

The mutex is used in the subdev callbacks, so unregister the subdev before the
mutex is destroyed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/media/i2c/adv7180.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index d7d99f1..1a3622a 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -616,8 +616,8 @@ static int adv7180_probe(struct i2c_client *client,
 err_free_ctrl:
 	adv7180_exit_controls(state);
 err_unreg_subdev:
-	mutex_destroy(&state->mutex);
 	v4l2_device_unregister_subdev(sd);
+	mutex_destroy(&state->mutex);
 err:
 	printk(KERN_ERR KBUILD_MODNAME ": Failed to probe: %d\n", ret);
 	return ret;
@@ -640,8 +640,8 @@ static int adv7180_remove(struct i2c_client *client)
 		}
 	}
 
-	mutex_destroy(&state->mutex);
 	v4l2_device_unregister_subdev(sd);
+	mutex_destroy(&state->mutex);
 	return 0;
 }
 
-- 
1.8.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-03-10 15:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-07 16:14 [PATCH 1/7] [media] adv7180: Fix remove order Lars-Peter Clausen
2014-03-07 16:14 ` [PATCH 2/7] [media] adv7180: Free control handler on remove() Lars-Peter Clausen
2014-03-07 16:14 ` [PATCH 3/7] [media] adv7180: Remove unnecessary v4l2_device_unregister_subdev() from probe error path Lars-Peter Clausen
2014-03-07 16:14 ` [PATCH 4/7] [media] adv7180: Remove duplicated probe error message Lars-Peter Clausen
2014-03-07 16:14 ` [PATCH 5/7] [media] adv7180: Use threaded IRQ instead of IRQ + workqueue Lars-Peter Clausen
2014-03-07 16:14 ` [PATCH 6/7] [media] adv7180: Add support for async device registration Lars-Peter Clausen
2014-03-07 16:14 ` [PATCH 7/7] [media] adv7180: Add support for power down Lars-Peter Clausen
2014-03-10 14:37   ` Hans Verkuil
2014-03-10 15:24     ` Lars-Peter Clausen
2014-03-10 15:28       ` Hans Verkuil
2014-03-10 15:32         ` Lars-Peter Clausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox