]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] dvb_frontend: merge duplicate dvb_tuner_ops.release implementations
authorMax Kellermann <max.kellermann@gmail.com>
Tue, 9 Aug 2016 21:32:26 +0000 (18:32 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 18 Nov 2016 17:05:44 +0000 (15:05 -0200)
Most release callback functions are identical: free the "tuner_priv"
and clear it.  Let's eliminate some bloat by providing this simple
implementation in the dvb_frontend library.

Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
29 files changed:
drivers/media/dvb-core/dvb_frontend.c
drivers/media/dvb-core/dvb_frontend.h
drivers/media/dvb-frontends/dib0070.c
drivers/media/dvb-frontends/dib0090.c
drivers/media/dvb-frontends/dvb-pll.c
drivers/media/dvb-frontends/itd1000.c
drivers/media/dvb-frontends/ix2505v.c
drivers/media/dvb-frontends/stb6000.c
drivers/media/dvb-frontends/stb6100.c
drivers/media/dvb-frontends/stv6110.c
drivers/media/dvb-frontends/stv6110x.c
drivers/media/dvb-frontends/tda18271c2dd.c
drivers/media/dvb-frontends/tda665x.c
drivers/media/dvb-frontends/tda8261.c
drivers/media/dvb-frontends/tda826x.c
drivers/media/dvb-frontends/tua6100.c
drivers/media/dvb-frontends/zl10036.c
drivers/media/tuners/fc0011.c
drivers/media/tuners/fc0012.c
drivers/media/tuners/fc0013.c
drivers/media/tuners/mc44s803.c
drivers/media/tuners/mt2060.c
drivers/media/tuners/mt20xx.c
drivers/media/tuners/mt2266.c
drivers/media/tuners/qt1010.c
drivers/media/tuners/tda18218.c
drivers/media/tuners/tda827x.c
drivers/media/tuners/tea5761.c
drivers/media/tuners/tea5767.c

index cdb7048874c5a0641748d213bb1a07cc023d81c3..7c4a50b0b963d02972bccb4f5efb2928a12a8a1c 100644 (file)
@@ -174,6 +174,15 @@ static bool has_get_frontend(struct dvb_frontend *fe)
        return fe->ops.get_frontend != NULL;
 }
 
+int
+dvb_tuner_simple_release(struct dvb_frontend *fe)
+{
+       kfree(fe->tuner_priv);
+       fe->tuner_priv = NULL;
+       return 0;
+}
+EXPORT_SYMBOL(dvb_tuner_simple_release);
+
 /*
  * Due to DVBv3 API calls, a delivery system should be mapped into one of
  * the 4 DVBv3 delivery systems (FE_QPSK, FE_QAM, FE_OFDM or FE_ATSC),
index fb6e84811504da1385939324227caa3301fa494f..6b675a83352092404eb2f139c0befb8c1a941b12 100644 (file)
@@ -266,6 +266,13 @@ struct dvb_tuner_ops {
        int (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);
 };
 
+/**
+ * A common default implementation for dvb_tuner_ops.release.  All it
+ * does is kfree() the tuner_priv and assign NULL to it.
+ */
+int
+dvb_tuner_simple_release(struct dvb_frontend *fe);
+
 /**
  * struct analog_demod_info - Information struct for analog TV part of the demod
  *
index 016ad09a87540dd7c33aa70b151a41466e16567b..d9f1bc2f778c7dc52e6bd532750fd5181e8cc445 100644 (file)
@@ -722,13 +722,6 @@ static int dib0070_get_frequency(struct dvb_frontend *fe, u32 *frequency)
        return 0;
 }
 
-static int dib0070_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static const struct dvb_tuner_ops dib0070_ops = {
        .info = {
                .name           = "DiBcom DiB0070",
@@ -736,7 +729,7 @@ static const struct dvb_tuner_ops dib0070_ops = {
                .frequency_max  = 860000000,
                .frequency_step =      1000,
        },
-       .release       = dib0070_release,
+       .release       = dvb_tuner_simple_release,
 
        .init          = dib0070_wakeup,
        .sleep         = dib0070_sleep,
index 16200582f0890ca0a117771cf49a5d079a5c60f1..7b4bee5c8e34b03b7319a12f0a676189d9cd0358 100644 (file)
@@ -2526,13 +2526,6 @@ static int dib0090_tune(struct dvb_frontend *fe)
        return ret;
 }
 
-static int dib0090_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 enum frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe)
 {
        struct dib0090_state *state = fe->tuner_priv;
@@ -2594,7 +2587,7 @@ static const struct dvb_tuner_ops dib0090_ops = {
                 .frequency_max = 860000000,
                 .frequency_step = 1000,
                 },
-       .release = dib0090_release,
+       .release = dvb_tuner_simple_release,
 
        .init = dib0090_wakeup,
        .sleep = dib0090_sleep,
@@ -2609,7 +2602,7 @@ static const struct dvb_tuner_ops dib0090_fw_ops = {
                 .frequency_max = 860000000,
                 .frequency_step = 1000,
                 },
-       .release = dib0090_release,
+       .release = dvb_tuner_simple_release,
 
        .init = NULL,
        .sleep = NULL,
index b6d199196b83e48965eb39b637130432be89a394..56832d6f47aec24ce2aeece7e5710b89189019c5 100644 (file)
@@ -606,13 +606,6 @@ static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf,
        return (div * desc->entries[i].stepsize) - desc->iffreq;
 }
 
-static int dvb_pll_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static int dvb_pll_sleep(struct dvb_frontend *fe)
 {
        struct dvb_pll_priv *priv = fe->tuner_priv;
@@ -745,7 +738,7 @@ static int dvb_pll_init(struct dvb_frontend *fe)
 }
 
 static const struct dvb_tuner_ops dvb_pll_tuner_ops = {
-       .release = dvb_pll_release,
+       .release = dvb_tuner_simple_release,
        .sleep = dvb_pll_sleep,
        .init = dvb_pll_init,
        .set_params = dvb_pll_set_params,
index cadcae4cff89122dbf90cad2d02cfa9fa13854b4..d09f718f8119023d6da54d2c776346d1cc8afba2 100644 (file)
@@ -348,13 +348,6 @@ static int itd1000_sleep(struct dvb_frontend *fe)
        return 0;
 }
 
-static int itd1000_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static const struct dvb_tuner_ops itd1000_tuner_ops = {
        .info = {
                .name           = "Integrant ITD1000",
@@ -363,7 +356,7 @@ static const struct dvb_tuner_ops itd1000_tuner_ops = {
                .frequency_step = 125,     /* kHz for QPSK frontends */
        },
 
-       .release       = itd1000_release,
+       .release       = dvb_tuner_simple_release,
 
        .init          = itd1000_init,
        .sleep         = itd1000_sleep,
index 2826bbb36b731518ae7ff9214084d796bcbbe025..7742a7a8cdbb5194bf5e2d362092ec26aaa8a153 100644 (file)
@@ -94,16 +94,6 @@ static int ix2505v_write(struct ix2505v_state *state, u8 buf[], u8 count)
        return 0;
 }
 
-static int ix2505v_release(struct dvb_frontend *fe)
-{
-       struct ix2505v_state *state = fe->tuner_priv;
-
-       fe->tuner_priv = NULL;
-       kfree(state);
-
-       return 0;
-}
-
 /**
  *  Data write format of the Sharp IX2505V B0017
  *
@@ -264,7 +254,7 @@ static const struct dvb_tuner_ops ix2505v_tuner_ops = {
                .frequency_min = 950000,
                .frequency_max = 2175000
        },
-       .release = ix2505v_release,
+       .release = dvb_tuner_simple_release,
        .set_params = ix2505v_set_params,
        .get_frequency = ix2505v_get_frequency,
 };
index 73347d51f340b5a923b2976b69fd9ab59cc54ca1..5252d485439efb0f2a6bf36ec06415de4ca085d0 100644 (file)
@@ -41,13 +41,6 @@ struct stb6000_priv {
        u32 frequency;
 };
 
-static int stb6000_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static int stb6000_sleep(struct dvb_frontend *fe)
 {
        struct stb6000_priv *priv = fe->tuner_priv;
@@ -192,7 +185,7 @@ static const struct dvb_tuner_ops stb6000_tuner_ops = {
                .frequency_min = 950000,
                .frequency_max = 2150000
        },
-       .release = stb6000_release,
+       .release = dvb_tuner_simple_release,
        .sleep = stb6000_sleep,
        .set_params = stb6000_set_params,
        .get_frequency = stb6000_get_frequency,
index 5add1182c3cae6f5f172d0a4e57e82c46ea8ed74..befd26bdfa0f3877a1f9ee8795ca1e58abb9a4e0 100644 (file)
@@ -61,8 +61,6 @@ struct stb6100_lkup {
        u8   reg;
 };
 
-static int stb6100_release(struct dvb_frontend *fe);
-
 static const struct stb6100_lkup lkup[] = {
        {       0,  950000, 0x0a },
        {  950000, 1000000, 0x0a },
@@ -536,7 +534,7 @@ static const struct dvb_tuner_ops stb6100_ops = {
        .set_params     = stb6100_set_params,
        .get_frequency  = stb6100_get_frequency,
        .get_bandwidth  = stb6100_get_bandwidth,
-       .release        = stb6100_release
+       .release        = dvb_tuner_simple_release
 };
 
 struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe,
@@ -560,16 +558,6 @@ struct dvb_frontend *stb6100_attach(struct dvb_frontend *fe,
        return fe;
 }
 
-static int stb6100_release(struct dvb_frontend *fe)
-{
-       struct stb6100_state *state = fe->tuner_priv;
-
-       fe->tuner_priv = NULL;
-       kfree(state);
-
-       return 0;
-}
-
 EXPORT_SYMBOL(stb6100_attach);
 MODULE_PARM_DESC(verbose, "Set Verbosity level");
 
index 66a5a7f2295c09f8f35538a0a7303dc4c52218d5..d9a88adc4c102ee02db88a2ac87fb2d9560b1fe0 100644 (file)
@@ -59,13 +59,6 @@ static s32 abssub(s32 a, s32 b)
                return b - a;
 };
 
-static int stv6110_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static int stv6110_write_regs(struct dvb_frontend *fe, u8 buf[],
                                                        int start, int len)
 {
@@ -390,7 +383,7 @@ static const struct dvb_tuner_ops stv6110_tuner_ops = {
                .frequency_step = 1000,
        },
        .init = stv6110_init,
-       .release = stv6110_release,
+       .release = dvb_tuner_simple_release,
        .sleep = stv6110_sleep,
        .set_params = stv6110_set_params,
        .get_frequency = stv6110_get_frequency,
index c611ad210b5c264fe2f3c5f0dfa0b452f7ed5f6c..70d5641453c28aafbbb74cee1cd3252f5809be3c 100644 (file)
@@ -335,16 +335,6 @@ static int stv6110x_get_status(struct dvb_frontend *fe, u32 *status)
 }
 
 
-static int stv6110x_release(struct dvb_frontend *fe)
-{
-       struct stv6110x_state *stv6110x = fe->tuner_priv;
-
-       fe->tuner_priv = NULL;
-       kfree(stv6110x);
-
-       return 0;
-}
-
 static const struct dvb_tuner_ops stv6110x_ops = {
        .info = {
                .name           = "STV6110(A) Silicon Tuner",
@@ -352,7 +342,7 @@ static const struct dvb_tuner_ops stv6110x_ops = {
                .frequency_max  = 2150000,
                .frequency_step = 0,
        },
-       .release                = stv6110x_release
+       .release                = dvb_tuner_simple_release,
 };
 
 static const struct stv6110x_devctl stv6110x_ctl = {
index bc247f9b553a3a659c74800db0460fe56a5bd907..a324f30f7224566d23474475dde855a23dcc4e1a 100644 (file)
@@ -1126,14 +1126,6 @@ static int init(struct dvb_frontend *fe)
        return 0;
 }
 
-static int release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
-
 static int set_params(struct dvb_frontend *fe)
 {
        struct tda_state *state = fe->tuner_priv;
@@ -1227,7 +1219,7 @@ static const struct dvb_tuner_ops tuner_ops = {
        .init              = init,
        .sleep             = sleep,
        .set_params        = set_params,
-       .release           = release,
+       .release           = dvb_tuner_simple_release,
        .get_if_frequency  = get_if_frequency,
        .get_bandwidth     = get_bandwidth,
 };
index 7ca965987f40ac10d3f3acdb48e88557e46a0290..39a1eb23ad04166debf694b23162b2ab9977f121 100644 (file)
@@ -197,20 +197,11 @@ static int tda665x_set_params(struct dvb_frontend *fe)
        return 0;
 }
 
-static int tda665x_release(struct dvb_frontend *fe)
-{
-       struct tda665x_state *state = fe->tuner_priv;
-
-       fe->tuner_priv = NULL;
-       kfree(state);
-       return 0;
-}
-
 static const struct dvb_tuner_ops tda665x_ops = {
        .get_status     = tda665x_get_status,
        .set_params     = tda665x_set_params,
        .get_frequency  = tda665x_get_frequency,
-       .release        = tda665x_release
+       .release        = dvb_tuner_simple_release,
 };
 
 struct dvb_frontend *tda665x_attach(struct dvb_frontend *fe,
index e0df93191b9e8cd6b2a62774d11630e78470ba75..65f729ff27a90e5cb8d470b7d84752cce019cf22 100644 (file)
@@ -152,15 +152,6 @@ static int tda8261_set_params(struct dvb_frontend *fe)
        return 0;
 }
 
-static int tda8261_release(struct dvb_frontend *fe)
-{
-       struct tda8261_state *state = fe->tuner_priv;
-
-       fe->tuner_priv = NULL;
-       kfree(state);
-       return 0;
-}
-
 static const struct dvb_tuner_ops tda8261_ops = {
 
        .info = {
@@ -173,7 +164,7 @@ static const struct dvb_tuner_ops tda8261_ops = {
        .set_params     = tda8261_set_params,
        .get_frequency  = tda8261_get_frequency,
        .get_status     = tda8261_get_status,
-       .release        = tda8261_release
+       .release        = dvb_tuner_simple_release,
 };
 
 struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe,
index 2ec671df1441315e49226c6ff5acb529a5bd2896..bf8946c2c04a5fe81064692aad1e5ff85c233fc5 100644 (file)
@@ -41,13 +41,6 @@ struct tda826x_priv {
        u32 frequency;
 };
 
-static int tda826x_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static int tda826x_sleep(struct dvb_frontend *fe)
 {
        struct tda826x_priv *priv = fe->tuner_priv;
@@ -135,7 +128,7 @@ static const struct dvb_tuner_ops tda826x_tuner_ops = {
                .frequency_min = 950000,
                .frequency_max = 2175000
        },
-       .release = tda826x_release,
+       .release = dvb_tuner_simple_release,
        .sleep = tda826x_sleep,
        .set_params = tda826x_set_params,
        .get_frequency = tda826x_get_frequency,
index 6da12b9e55ebe2e658a92e1d94e18afa7cde8658..9e9a8ad7f37c3f980ecfb9dbcfebed86460df801 100644 (file)
@@ -42,13 +42,6 @@ struct tua6100_priv {
        u32 frequency;
 };
 
-static int tua6100_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static int tua6100_sleep(struct dvb_frontend *fe)
 {
        struct tua6100_priv *priv = fe->tuner_priv;
@@ -164,7 +157,7 @@ static const struct dvb_tuner_ops tua6100_tuner_ops = {
                .frequency_max = 2150000,
                .frequency_step = 1000,
        },
-       .release = tua6100_release,
+       .release = dvb_tuner_simple_release,
        .sleep = tua6100_sleep,
        .set_params = tua6100_set_params,
        .get_frequency = tua6100_get_frequency,
index df5d0fe2468758da5ab6697453029868508f6fa6..0116557c0f1045e4cdae3c547a9807e4d179f699 100644 (file)
@@ -134,16 +134,6 @@ static int zl10036_write(struct zl10036_state *state, u8 buf[], u8 count)
        return 0;
 }
 
-static int zl10036_release(struct dvb_frontend *fe)
-{
-       struct zl10036_state *state = fe->tuner_priv;
-
-       fe->tuner_priv = NULL;
-       kfree(state);
-
-       return 0;
-}
-
 static int zl10036_sleep(struct dvb_frontend *fe)
 {
        struct zl10036_state *state = fe->tuner_priv;
@@ -453,7 +443,7 @@ static const struct dvb_tuner_ops zl10036_tuner_ops = {
                .frequency_max = 2175000
        },
        .init = zl10036_init,
-       .release = zl10036_release,
+       .release = dvb_tuner_simple_release,
        .sleep = zl10036_sleep,
        .set_params = zl10036_set_params,
        .get_frequency = zl10036_get_frequency,
index 2dda8d993c141230d10abf6e9df0b9c3b275bbf6..5e9e2e694f983a332c8951b8908919881db2b8da 100644 (file)
@@ -112,14 +112,6 @@ static int fc0011_readreg(struct fc0011_priv *priv, u8 reg, u8 *val)
        return 0;
 }
 
-static int fc0011_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-
-       return 0;
-}
-
 static int fc0011_init(struct dvb_frontend *fe)
 {
        struct fc0011_priv *priv = fe->tuner_priv;
@@ -483,7 +475,7 @@ static const struct dvb_tuner_ops fc0011_tuner_ops = {
                .frequency_max  = 1000000000,
        },
 
-       .release                = fc0011_release,
+       .release                = dvb_tuner_simple_release,
        .init                   = fc0011_init,
 
        .set_params             = fc0011_set_params,
index d74e920568104dad4070ad120f4ca1953939d83d..7faff84e5ea81622d41402c75a680dcb4dd3543d 100644 (file)
@@ -55,13 +55,6 @@ static int fc0012_readreg(struct fc0012_priv *priv, u8 reg, u8 *val)
        return 0;
 }
 
-static int fc0012_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static int fc0012_init(struct dvb_frontend *fe)
 {
        struct fc0012_priv *priv = fe->tuner_priv;
@@ -427,7 +420,7 @@ static const struct dvb_tuner_ops fc0012_tuner_ops = {
                .frequency_step = 0,
        },
 
-       .release        = fc0012_release,
+       .release        = dvb_tuner_simple_release,
 
        .init           = fc0012_init,
 
index 522690d97b42ff0fe65852f2aa436ce96f95cde2..b068b9702cf79b1d8ace71f65fcec22a5cb19c87 100644 (file)
@@ -52,13 +52,6 @@ static int fc0013_readreg(struct fc0013_priv *priv, u8 reg, u8 *val)
        return 0;
 }
 
-static int fc0013_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static int fc0013_init(struct dvb_frontend *fe)
 {
        struct fc0013_priv *priv = fe->tuner_priv;
@@ -586,7 +579,7 @@ static const struct dvb_tuner_ops fc0013_tuner_ops = {
                .frequency_step = 0,
        },
 
-       .release        = fc0013_release,
+       .release        = dvb_tuner_simple_release,
 
        .init           = fc0013_init,
        .sleep          = fc0013_sleep,
index d5681669d3cdccfa9ee4f554a46d2195cae22c9b..86542cbd73fb06e24dc538848f2c26385767b097 100644 (file)
@@ -80,16 +80,6 @@ static int mc44s803_readreg(struct mc44s803_priv *priv, u8 reg, u32 *val)
        return 0;
 }
 
-static int mc44s803_release(struct dvb_frontend *fe)
-{
-       struct mc44s803_priv *priv = fe->tuner_priv;
-
-       fe->tuner_priv = NULL;
-       kfree(priv);
-
-       return 0;
-}
-
 static int mc44s803_init(struct dvb_frontend *fe)
 {
        struct mc44s803_priv *priv = fe->tuner_priv;
@@ -312,7 +302,7 @@ static const struct dvb_tuner_ops mc44s803_tuner_ops = {
                .frequency_step =     100000,
        },
 
-       .release       = mc44s803_release,
+       .release       = dvb_tuner_simple_release,
        .init          = mc44s803_init,
        .set_params    = mc44s803_set_params,
        .get_frequency = mc44s803_get_frequency,
index b87b2549d58d6eab5b202dca2abb8645a04a6141..14e7b64360cb781e3b8afcc89100946758ee5803 100644 (file)
@@ -332,13 +332,6 @@ static int mt2060_sleep(struct dvb_frontend *fe)
        return ret;
 }
 
-static int mt2060_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static const struct dvb_tuner_ops mt2060_tuner_ops = {
        .info = {
                .name           = "Microtune MT2060",
@@ -347,7 +340,7 @@ static const struct dvb_tuner_ops mt2060_tuner_ops = {
                .frequency_step =     50000,
        },
 
-       .release       = mt2060_release,
+       .release       = dvb_tuner_simple_release,
 
        .init          = mt2060_init,
        .sleep         = mt2060_sleep,
index 29dadd171b318e1d615210f0147a03cadb459a3c..4237d8f159192e767ddfea4604e6d93e40b70523 100644 (file)
@@ -49,14 +49,6 @@ struct microtune_priv {
        u32 frequency;
 };
 
-static int microtune_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-
-       return 0;
-}
-
 static int microtune_get_frequency(struct dvb_frontend *fe, u32 *frequency)
 {
        struct microtune_priv *priv = fe->tuner_priv;
@@ -365,7 +357,7 @@ static int mt2032_set_params(struct dvb_frontend *fe,
 
 static const struct dvb_tuner_ops mt2032_tuner_ops = {
        .set_analog_params = mt2032_set_params,
-       .release           = microtune_release,
+       .release           = dvb_tuner_simple_release,
        .get_frequency     = microtune_get_frequency,
 };
 
@@ -560,7 +552,7 @@ static int mt2050_set_params(struct dvb_frontend *fe,
 
 static const struct dvb_tuner_ops mt2050_tuner_ops = {
        .set_analog_params = mt2050_set_params,
-       .release           = microtune_release,
+       .release           = dvb_tuner_simple_release,
        .get_frequency     = microtune_get_frequency,
 };
 
index bca4d75e42d468a6e6662a222b792b38385601e5..35ea5e7975ac18b0ae0e7bc22d013609aa2e5d89 100644 (file)
@@ -296,13 +296,6 @@ static int mt2266_sleep(struct dvb_frontend *fe)
        return 0;
 }
 
-static int mt2266_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static const struct dvb_tuner_ops mt2266_tuner_ops = {
        .info = {
                .name           = "Microtune MT2266",
@@ -310,7 +303,7 @@ static const struct dvb_tuner_ops mt2266_tuner_ops = {
                .frequency_max  = 862000000,
                .frequency_step =     50000,
        },
-       .release       = mt2266_release,
+       .release       = dvb_tuner_simple_release,
        .init          = mt2266_init,
        .sleep         = mt2266_sleep,
        .set_params    = mt2266_set_params,
index ae8cbece6d2bcbea783b2722ba1d2b5a805ebeec..5a1662aeeb875ab20e632b4aa43e4a3ff9390a7a 100644 (file)
@@ -377,13 +377,6 @@ static int qt1010_init(struct dvb_frontend *fe)
        return qt1010_set_params(fe);
 }
 
-static int qt1010_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static int qt1010_get_frequency(struct dvb_frontend *fe, u32 *frequency)
 {
        struct qt1010_priv *priv = fe->tuner_priv;
@@ -405,7 +398,7 @@ static const struct dvb_tuner_ops qt1010_tuner_ops = {
                .frequency_step = QT1010_STEP,
        },
 
-       .release       = qt1010_release,
+       .release       = dvb_tuner_simple_release,
        .init          = qt1010_init,
        /* TODO: implement sleep */
 
index 9300e9361e3bce840aa8f517b18a1c5cafd32628..4d2916fb9953c012d445d47a42df38f66059f24e 100644 (file)
@@ -265,13 +265,6 @@ static int tda18218_init(struct dvb_frontend *fe)
        return ret;
 }
 
-static int tda18218_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static const struct dvb_tuner_ops tda18218_tuner_ops = {
        .info = {
                .name           = "NXP TDA18218",
@@ -281,7 +274,7 @@ static const struct dvb_tuner_ops tda18218_tuner_ops = {
                .frequency_step =      1000,
        },
 
-       .release       = tda18218_release,
+       .release       = dvb_tuner_simple_release,
        .init          = tda18218_init,
        .sleep         = tda18218_sleep,
 
index 5050ce9be423698ba2cbdd0c7813fc981b9639f7..4befb81f0c1a4331b4ca3945dae8c34c0434ea60 100644 (file)
@@ -767,13 +767,6 @@ static void tda827xa_agcf(struct dvb_frontend *fe)
 
 /* ------------------------------------------------------------------ */
 
-static int tda827x_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-       return 0;
-}
-
 static int tda827x_get_frequency(struct dvb_frontend *fe, u32 *frequency)
 {
        struct tda827x_priv *priv = fe->tuner_priv;
@@ -825,7 +818,7 @@ static const struct dvb_tuner_ops tda827xo_tuner_ops = {
                .frequency_max  = 860000000,
                .frequency_step =    250000
        },
-       .release = tda827x_release,
+       .release = dvb_tuner_simple_release,
        .init = tda827x_initial_init,
        .sleep = tda827x_initial_sleep,
        .set_params = tda827xo_set_params,
@@ -841,7 +834,7 @@ static const struct dvb_tuner_ops tda827xa_tuner_ops = {
                .frequency_max  = 906000000,
                .frequency_step =     62500
        },
-       .release = tda827x_release,
+       .release = dvb_tuner_simple_release,
        .init = tda827x_init,
        .sleep = tda827xa_sleep,
        .set_params = tda827xa_set_params,
index 12347aa95de39359ed8db443506bf6a0fbb5594f..82f25621d9958f02bcae9ff4dcb54c4e5247ed3c 100644 (file)
@@ -284,14 +284,6 @@ int tea5761_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr)
        return 0;
 }
 
-static int tea5761_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-
-       return 0;
-}
-
 static int tea5761_get_frequency(struct dvb_frontend *fe, u32 *frequency)
 {
        struct tea5761_priv *priv = fe->tuner_priv;
@@ -305,7 +297,7 @@ static const struct dvb_tuner_ops tea5761_tuner_ops = {
        },
        .set_analog_params = set_radio_freq,
        .sleep             = set_radio_sleep,
-       .release           = tea5761_release,
+       .release           = dvb_tuner_simple_release,
        .get_frequency     = tea5761_get_frequency,
        .get_status        = tea5761_get_status,
        .get_rf_strength   = tea5761_get_rf_strength,
index d62a6d6b1f42f409408182896f91b16c54272e2f..a33c97de8b8a98296a9fe37614239773cdf7bf52 100644 (file)
@@ -401,14 +401,6 @@ int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr)
        return 0;
 }
 
-static int tea5767_release(struct dvb_frontend *fe)
-{
-       kfree(fe->tuner_priv);
-       fe->tuner_priv = NULL;
-
-       return 0;
-}
-
 static int tea5767_get_frequency(struct dvb_frontend *fe, u32 *frequency)
 {
        struct tea5767_priv *priv = fe->tuner_priv;
@@ -434,7 +426,7 @@ static const struct dvb_tuner_ops tea5767_tuner_ops = {
        .set_analog_params = set_radio_freq,
        .set_config        = tea5767_set_config,
        .sleep             = tea5767_standby,
-       .release           = tea5767_release,
+       .release           = dvb_tuner_simple_release,
        .get_frequency     = tea5767_get_frequency,
        .get_status        = tea5767_get_status,
        .get_rf_strength   = tea5767_get_rf_strength,