summaryrefslogtreecommitdiff
path: root/net/rfkill
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2019-10-24 20:40:42 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-13 10:43:18 +0300
commitfbf86f6d5ab646639f438ffdd9f546cb4d983f2a (patch)
tree264d3155cc9e90ce52e6e3c4c65d43eb47305e19 /net/rfkill
parent5ab462ef090bb78b05717ccabe4fc4ee278adb2b (diff)
downloadlinux-fbf86f6d5ab646639f438ffdd9f546cb4d983f2a.tar.xz
rfkill: allocate static minor
commit 8670b2b8b029a6650d133486be9d2ace146fd29a upstream. udev has a feature of creating /dev/<node> device-nodes if it finds a devnode:<node> modalias. This allows for auto-loading of modules that provide the node. This requires to use a statically allocated minor number for misc character devices. However, rfkill uses dynamic minor numbers and prevents auto-loading of the module. So allocate the next static misc minor number and use it for rfkill. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Link: https://lore.kernel.org/r/20191024174042.19851-1-marcel@holtmann.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/rfkill')
-rw-r--r--net/rfkill/core.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index f9b08a6d8dbe..0bf9bf1ceb8f 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -1316,10 +1316,12 @@ static const struct file_operations rfkill_fops = {
.llseek = no_llseek,
};
+#define RFKILL_NAME "rfkill"
+
static struct miscdevice rfkill_miscdev = {
- .name = "rfkill",
.fops = &rfkill_fops,
- .minor = MISC_DYNAMIC_MINOR,
+ .name = RFKILL_NAME,
+ .minor = RFKILL_MINOR,
};
static int __init rfkill_init(void)
@@ -1371,3 +1373,6 @@ static void __exit rfkill_exit(void)
class_unregister(&rfkill_class);
}
module_exit(rfkill_exit);
+
+MODULE_ALIAS_MISCDEV(RFKILL_MINOR);
+MODULE_ALIAS("devname:" RFKILL_NAME);