diff options
author | David Härdeman <david@hardeman.nu> | 2017-06-25 09:31:24 -0300 |
---|---|---|
committer | Tao Huang <huangtao@rock-chips.com> | 2018-12-10 20:36:19 +0800 |
commit | 949b870dca6c8989c9213687cbd436b833000b30 (patch) | |
tree | 19a83cfff1fb6883a9a17bb2c5ae07860bec18ff /include | |
parent | e152352354ded0bbffef97bc74de5ffe6b590371 (diff) |
UPSTREAM: [media] media: lirc_dev: remove support for manually specifying minor number
All users of lirc_register_driver() uses dynamic minor allocation,
therefore we can remove the ability to explicitly request a given number.
This changes the function prototype of lirc_unregister_driver() to also
take a struct lirc_driver pointer as the sole argument.
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
(cherry picked from commit c3c6dd750e0b8dcee0306b9c5a45708922debbbe)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
Conflicts:
drivers/staging/media/lirc/lirc_zilog.c
Diffstat (limited to 'include')
-rw-r--r-- | include/media/lirc_dev.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h index 1f327e25a9be..4c27cb205dd7 100644 --- a/include/media/lirc_dev.h +++ b/include/media/lirc_dev.h @@ -123,10 +123,8 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, * * @name: this string will be used for logs * - * @minor: indicates minor device (/dev/lirc) number for - * registered driver if caller fills it with negative - * value, then the first free minor number will be used - * (if available). + * @minor: the minor device (/dev/lircX) number for a registered + * driver. * * @code_length: length of the remote control key code expressed in bits. * @@ -164,10 +162,12 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, * device. * * @owner: the module owning this struct + * + * @irctl: the struct irctl for this LIRC device. */ struct lirc_driver { char name[40]; - int minor; + unsigned int minor; __u32 code_length; unsigned int buffer_size; /* in chunks holding one code each */ __u32 features; @@ -182,19 +182,17 @@ struct lirc_driver { const struct file_operations *fops; struct device *dev; struct module *owner; + struct irctl *irctl; }; /* following functions can be called ONLY from user context * - * returns negative value on error or minor number - * of the registered device if success + * returns negative value on error or zero * contents of the structure pointed by p is copied */ -extern int lirc_register_driver(struct lirc_driver *d); +int lirc_register_driver(struct lirc_driver *d); -/* returns negative value on error or 0 if success -*/ -extern int lirc_unregister_driver(int minor); +void lirc_unregister_driver(struct lirc_driver *d); /* Returns the private data stored in the lirc_driver * associated with the given device file pointer. |