Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13370387ybl; Sun, 29 Dec 2019 10:16:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyXMUJHBRxhP+VsNijqcxsB8731JYABNgqxOrDc+eepykzZkGlqC0VJmAKAM0hjOxYfQYIv X-Received: by 2002:a05:6830:1d7b:: with SMTP id l27mr64927884oti.251.1577643378293; Sun, 29 Dec 2019 10:16:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577643378; cv=none; d=google.com; s=arc-20160816; b=vB3JAYSZsW6Dn6AICKO4njYD+ZV+lz9twbFsxTbKyd8WDoEBZmZMeWVGl86n6eJjrW 8JA0HobDiJZFGyok2LMoVnrRWk/GM/wCE9y0g7/fIggtBt2XapHPmUcaTShpM4xxx+Ff +gd+JfxBOMF9h+Ma4qijIt7h1mKsNk/NAgevjilgcOCZKp2gaqm8B7ttU3e9iGEcC05q sA0B95NlLf7aw3/192mJaqcyRPKZ+CHio1Q+xiboSkzdXm0jeoY5XjQYmMDiK2liMREw xdjD/HPfsio4CX6wLqLH2QcgWHfr1QfDpc/Kylca840w3q80Pip68RhNZ9rx5Ef2wh/j GZyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WxJihs+jq97xW3oU3lswjg8OYIJVYp7e7bTb3S/jGpw=; b=Vbn4Y1KltawHan1HYmrqHqZZSx2vLe1T/WZi0IN3xsL2y4hfkoyFUdflwdrmG3C42d 6XsqjPAuqIBHTIahqZC1V8aNgxMDXAiXm0DKOKZVG0++vbfOzR42xmkNT8XPxN9ntSKH owN69k1g3LaoCt/0DnAFGxoe0YK3TlZwqxIuliQsLZd/kxdGq6lvXPfX0sLgE/4OHeLC 3iKshnwyh1i2uILsHAx5y28K82vrRZZHwstUf5vQSfzVY69WFudN8i06CcyNJGFXgbx1 cSqJYSaG+MCU9QlCxZn7Lo1WHcPwwsP19jJjcefeoJoIEvWv6/P74ySJjJ5UPA+V64Lj K/Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WWsO2zgE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s128si20122847oig.204.2019.12.29.10.16.06; Sun, 29 Dec 2019 10:16:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WWsO2zgE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728105AbfL2R0C (ORCPT + 99 others); Sun, 29 Dec 2019 12:26:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:46470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728101AbfL2RZ7 (ORCPT ); Sun, 29 Dec 2019 12:25:59 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 574E4207FD; Sun, 29 Dec 2019 17:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640358; bh=c9ozy1PhH42ULCA/tCDCr1JSqK3qZXPfXqjDM0qRCz4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WWsO2zgEaz0QXZW+9WGv3ttmAnIB4ETs2s46anaCeNRiG6o2Ih0HUn1bKChdIqeq2 eJgmLdHvjKvwgdeaoNLuQFoqRzZiyekz+c6XzyuiS/KxneoRz9lTpUFaUw4KqVMNBl fu/lO0sgU6b69IDv/zqj/d2PJjwrDZhkgmbjqJVg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcel Holtmann , Sasha Levin Subject: [PATCH 4.14 087/161] rfkill: allocate static minor Date: Sun, 29 Dec 2019 18:18:55 +0100 Message-Id: <20191229162425.145028187@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162355.500086350@linuxfoundation.org> References: <20191229162355.500086350@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marcel Holtmann [ Upstream commit 8670b2b8b029a6650d133486be9d2ace146fd29a ] udev has a feature of creating /dev/ device-nodes if it finds a devnode: 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 Link: https://lore.kernel.org/r/20191024174042.19851-1-marcel@holtmann.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- include/linux/miscdevice.h | 1 + net/rfkill/core.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 4de703d9e21f..5e1e50b8f8c4 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -56,6 +56,7 @@ #define UHID_MINOR 239 #define USERIO_MINOR 240 #define VHOST_VSOCK_MINOR 241 +#define RFKILL_MINOR 242 #define MISC_DYNAMIC_MINOR 255 struct device; diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 2064c3a35ef8..99a2e55b01cf 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -1312,10 +1312,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) @@ -1367,3 +1369,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); -- 2.20.1