summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-core
diff options
context:
space:
mode:
authorMax Kellermann <max.kellermann@gmail.com>2016-08-10 00:32:26 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-18 20:05:44 +0300
commit22a613e89825ea7a3984a968463cc6d425bd8856 (patch)
treeec1841642bf43f88cf9b89323315dfca7418d0d6 /drivers/media/dvb-core
parent4d5030b69bb4880a760406a6d3d519f02b9351dc (diff)
downloadlinux-22a613e89825ea7a3984a968463cc6d425bd8856.tar.xz
[media] dvb_frontend: merge duplicate dvb_tuner_ops.release implementations
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>
Diffstat (limited to 'drivers/media/dvb-core')
-rw-r--r--drivers/media/dvb-core/dvb_frontend.c9
-rw-r--r--drivers/media/dvb-core/dvb_frontend.h7
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index cdb7048874c5..7c4a50b0b963 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -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),
diff --git a/drivers/media/dvb-core/dvb_frontend.h b/drivers/media/dvb-core/dvb_frontend.h
index fb6e84811504..6b675a833520 100644
--- a/drivers/media/dvb-core/dvb_frontend.h
+++ b/drivers/media/dvb-core/dvb_frontend.h
@@ -267,6 +267,13 @@ struct dvb_tuner_ops {
};
/**
+ * 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
*
* @name: Name of the analog TV demodulator