UPSTREAM: [media] cec: Add cec_get_drvdata()

Add a helper function to get driver private data from CEC
adapter. This helps the readability a little bit and allows
to change the 'priv' field name to something else without
needing to touch all drivers.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 0b0b97dcc7)

Change-Id: I2691d8328350e968b74a90d1622b8e857cefc112
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
This commit is contained in:
Algea Cao 2017-12-27 14:27:26 +08:00 committed by Tao Huang
commit f2da070b51

View file

@ -206,6 +206,11 @@ struct cec_adapter {
char input_drv[32];
};
static inline void *cec_get_drvdata(const struct cec_adapter *adap)
{
return adap->priv;
}
static inline bool cec_has_log_addr(const struct cec_adapter *adap, u8 log_addr)
{
return adap->log_addrs.log_addr_mask & (1 << log_addr);