[media] em28xx: move v4l2 dummy clock deregistration from the core to the v4l extension
authorFrank Schaefer <fschaefer.oss@googlemail.com>
Sun, 12 Jan 2014 16:24:23 +0000 (13:24 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 14 Jan 2014 16:31:49 +0000 (14:31 -0200)
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/usb/em28xx/em28xx-cards.c
drivers/media/usb/em28xx/em28xx-video.c

index 2f520a5407002b4eb28e3129de7d0bc21a7956f1..fa35a308ad67a359fb95220def30ca97695dfa88 100644 (file)
@@ -36,7 +36,6 @@
 #include <media/tvaudio.h>
 #include <media/i2c-addr.h>
 #include <media/tveeprom.h>
-#include <media/v4l2-clk.h>
 #include <media/v4l2-common.h>
 
 #include "em28xx.h"
@@ -2880,8 +2879,6 @@ void em28xx_release_resources(struct em28xx *dev)
        if (dev->def_i2c_bus)
                em28xx_i2c_unregister(dev, 1);
        em28xx_i2c_unregister(dev, 0);
-       if (dev->clk)
-               v4l2_clk_unregister_fixed(dev->clk);
 
        usb_put_dev(dev->udev);
 
index f5f716e2c5e6787510fe363ba9266623aee0144f..32b438528fdfefcd5ccac1a10f27a50488982bd5 100644 (file)
@@ -42,6 +42,7 @@
 #include <media/v4l2-common.h>
 #include <media/v4l2-ioctl.h>
 #include <media/v4l2-event.h>
+#include <media/v4l2-clk.h>
 #include <media/msp3400.h>
 #include <media/tuner.h>
 
@@ -1923,6 +1924,11 @@ static int em28xx_v4l2_fini(struct em28xx *dev)
                dev->vdev = NULL;
        }
 
+       if (dev->clk) {
+               v4l2_clk_unregister_fixed(dev->clk);
+               dev->clk = NULL;
+       }
+
        if (dev->users)
                em28xx_warn("Device is open ! Deregistration and memory deallocation are deferred on close.\n");