From: Frank Schaefer Date: Sun, 12 Jan 2014 16:24:23 +0000 (-0300) Subject: [media] em28xx: move v4l2 dummy clock deregistration from the core to the v4l extension X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=25dd1652331644701a90462782ece6d0d3edf7d0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [media] em28xx: move v4l2 dummy clock deregistration from the core to the v4l extension Signed-off-by: Frank Schäfer Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 2f520a540700..fa35a308ad67 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #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); diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index f5f716e2c5e6..32b438528fdf 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -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");