The async sub-device was added to the async list in probe but it was not
removed in the driver's remove function. Fix this. Also unregister the
async subdev before powering down the device.

Signed-off-by: Sakari Ailus <sakari.ai...@linux.intel.com>
---
 drivers/media/i2c/tw9910.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/tw9910.c b/drivers/media/i2c/tw9910.c
index a54548cc4285..7087ce946af1 100644
--- a/drivers/media/i2c/tw9910.c
+++ b/drivers/media/i2c/tw9910.c
@@ -997,10 +997,11 @@ static int tw9910_remove(struct i2c_client *client)
 {
        struct tw9910_priv *priv = to_tw9910(client);
 
+       v4l2_async_unregister_subdev(&priv->subdev);
+
        if (priv->pdn_gpio)
                gpiod_put(priv->pdn_gpio);
        clk_put(priv->clk);
-       v4l2_device_unregister_subdev(&priv->subdev);
 
        return 0;
 }
-- 
2.11.0

Reply via email to