From: Antti Palosaari <crope@iki.fi>
To: linux-media <linux-media@vger.kernel.org>
Subject: Q: FE set_property() and get_property callbacks
Date: Wed, 11 Jul 2012 22:25:34 +0300 [thread overview]
Message-ID: <4FFDD32E.2070705@iki.fi> (raw)
I was playing with the DVB API LNA support and ended up looking common
dvb-frontend code.
There is struct dvb_frontend_ops:
int (*set_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
int (*get_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
What I can see from the dvb-core comments those are used for validating
parameters. Why? Naming is very misleading. For me those names sounds
like setting and getting parameters is something what average coder can
think.
For example if I wish to set LNA I would like to implement
set_property() to my driver and expect to catch DTV_LNA command and
handle it.
But what now is done is to add new callback "set_lna()" to struct
dvb_frontend_ops, add new parameter "lna" to struct
dtv_frontend_properties, cache value here and use new callback to set
value. Due to that selected implementation it goes complex and "struct
dvb_frontend_ops" and "struct dtv_frontend_properties" grows all the
time when new parameter is added.
It looks even more weird as you grep current use of set_property() and
get_property(). There is only two drivers, stv0288 and stv6110, defining
those callbacks. And both of those seems to have quite nonsense
implementation. So whats happening here?
regards
Antti
--
http://palosaari.fi/
reply other threads:[~2012-07-11 19:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FFDD32E.2070705@iki.fi \
--to=crope@iki.fi \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).