diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2016-11-25 06:23:34 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-29 12:07:17 -0200 |
commit | f51e80804f084de269954d875c0892b081b7df3c (patch) | |
tree | cc8711c8323e5ff7fb69599b7dc2aa88c9fd438e /include/media/cec.h | |
parent | cf2113ca563191a9ee5943561827e50ad8cda4e0 (diff) | |
download | lwn-f51e80804f084de269954d875c0892b081b7df3c.tar.gz lwn-f51e80804f084de269954d875c0892b081b7df3c.zip |
[media] cec: pass parent device in register(), not allocate()
The cec_allocate_adapter function doesn't need the parent device, only the
cec_register_adapter function needs it.
Drop the cec_devnode parent field, since devnode.dev.parent can be used
instead.
This change makes the framework consistent with other frameworks where the
parent device is not used until the device is registered.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/media/cec.h')
-rw-r--r-- | include/media/cec.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/media/cec.h b/include/media/cec.h index 717eaf552f3d..96a0aa770d61 100644 --- a/include/media/cec.h +++ b/include/media/cec.h @@ -35,7 +35,6 @@ * struct cec_devnode - cec device node * @dev: cec device * @cdev: cec character device - * @parent: parent device * @minor: device node minor number * @registered: the device was correctly registered * @unregistered: the device was unregistered @@ -51,7 +50,6 @@ struct cec_devnode { /* sysfs */ struct device dev; struct cdev cdev; - struct device *parent; /* device info */ int minor; @@ -198,9 +196,8 @@ static inline bool cec_is_sink(const struct cec_adapter *adap) #if IS_ENABLED(CONFIG_MEDIA_CEC_SUPPORT) struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, - void *priv, const char *name, u32 caps, u8 available_las, - struct device *parent); -int cec_register_adapter(struct cec_adapter *adap); + void *priv, const char *name, u32 caps, u8 available_las); +int cec_register_adapter(struct cec_adapter *adap, struct device *parent); void cec_unregister_adapter(struct cec_adapter *adap); void cec_delete_adapter(struct cec_adapter *adap); @@ -218,7 +215,8 @@ void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg); #else -static inline int cec_register_adapter(struct cec_adapter *adap) +static inline int cec_register_adapter(struct cec_adapter *adap, + struct device *parent) { return 0; } |