summaryrefslogtreecommitdiff
path: root/include/media
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2017-06-25 09:31:24 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2017-10-04 13:50:42 -0300
commitc3c6dd750e0b8dcee0306b9c5a45708922debbbe (patch)
treeabf9340cfba76d14ea5cdf413b86496c479d8bda /include/media
parentde226ec8a6ac10e65fcc689a28761c966986e6a6 (diff)
[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>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/lirc_dev.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index 86d15a9b6c01..1bb9890744fa 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -116,10 +116,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.
*
@@ -157,10 +155,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;
@@ -175,19 +175,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.