From f2da070b5152044ff08ff853492ef5a3b9e183cd Mon Sep 17 00:00:00 2001 From: Algea Cao Date: Wed, 27 Dec 2017 14:27:26 +0800 Subject: [PATCH] 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab (cherry picked from commit 0b0b97dcc79fe2b34d320805c4389d87980a0e51) Change-Id: I2691d8328350e968b74a90d1622b8e857cefc112 Signed-off-by: Algea Cao --- include/media/cec.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/media/cec.h b/include/media/cec.h index b26565a9fa59..df3c94f05aa5 100644 --- a/include/media/cec.h +++ b/include/media/cec.h @@ -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);