sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zijun Hu <zijun_hu@icloud.com>
To: Arnd Bergmann <arnd@arndb.de>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	 Rudolf Marek <r.marek@assembler.cz>,
	 Wim Van Sebroeck <wim@linux-watchdog.org>,
	 "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	 Helge Deller <deller@gmx.de>,
	"David S. Miller" <davem@davemloft.net>,
	 Andreas Larsson <andreas@gaisler.com>
Cc: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>,
	 Zijun Hu <zijun_hu@icloud.com>,
	linux-kernel@vger.kernel.org,  linux-hwmon@vger.kernel.org,
	linux-watchdog@vger.kernel.org,  linux-parisc@vger.kernel.org,
	sparclinux@vger.kernel.org,  Zijun Hu <zijun.hu@oss.qualcomm.com>
Subject: [PATCH v2 7/9] char: misc: Allocate 4 more fixed minors for watchdog
Date: Tue, 01 Jul 2025 23:24:45 +0800	[thread overview]
Message-ID: <20250701-rfc_miscdev-v2-7-3eb22bf533be@oss.qualcomm.com> (raw)
In-Reply-To: <20250701-rfc_miscdev-v2-0-3eb22bf533be@oss.qualcomm.com>

From: Zijun Hu <zijun.hu@oss.qualcomm.com>

There are drivers which needs more fixed minors for watchdog, but
watchdog only has one fixed minor currently, it causes hardcoded and
unregistered fixed minors are used by these drivers.

Allocate 4 more fixed minors and apply for these drivers.
---
 drivers/hwmon/fschmd.c     | 3 ++-
 drivers/hwmon/w83793.c     | 3 ++-
 drivers/watchdog/cpwd.c    | 6 +++---
 include/linux/miscdevice.h | 4 ++++
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
index a303959879efddd9bfc02e8c25766e67b1a4af8e..7ffaec12eea8473a7dd17d7477db9157230e7f31 100644
--- a/drivers/hwmon/fschmd.c
+++ b/drivers/hwmon/fschmd.c
@@ -1084,7 +1084,8 @@ static int fschmd_probe(struct i2c_client *client)
 	struct fschmd_data *data;
 	static const char * const names[7] = { "Poseidon", "Hermes", "Scylla",
 				"Heracles", "Heimdall", "Hades", "Syleus" };
-	static const int watchdog_minors[] = { WATCHDOG_MINOR, 212, 213, 214, 215 };
+	static const int watchdog_minors[] = { WATCHDOG_MINOR, WATCHDOG_MINOR_1,
+		WATCHDOG_MINOR_2, WATCHDOG_MINOR_3, WATCHDOG_MINOR_4 };
 	int i, err;
 	enum chips kind = (uintptr_t)i2c_get_match_data(client);
 
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c
index 67728f60333fe351715ccc03097f9aa2e135f384..fb4d76c87ea26366586f6f6bc2bee4f76a430880 100644
--- a/drivers/hwmon/w83793.c
+++ b/drivers/hwmon/w83793.c
@@ -1642,7 +1642,8 @@ static int w83793_probe(struct i2c_client *client)
 {
 	struct device *dev = &client->dev;
 	static const int watchdog_minors[] = {
-		WATCHDOG_MINOR, 212, 213, 214, 215
+		WATCHDOG_MINOR, WATCHDOG_MINOR_1, WATCHDOG_MINOR_2,
+		WATCHDOG_MINOR_3, WATCHDOG_MINOR_4
 	};
 	struct w83793_data *data;
 	int i, tmp, val, err;
diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c
index 13a4d47e68cd82572f103c37ec066384cc5f7cd7..7891ea8f87451ddfb377e90706310a73324fb0ce 100644
--- a/drivers/watchdog/cpwd.c
+++ b/drivers/watchdog/cpwd.c
@@ -44,9 +44,9 @@
 #define WD_BTIMEOUT	(jiffies + (HZ * 1000))
 #define WD_BLIMIT	0xFFFF
 
-#define WD0_MINOR	212
-#define WD1_MINOR	213
-#define WD2_MINOR	214
+#define WD0_MINOR	WATCHDOG_MINOR_1
+#define WD1_MINOR	WATCHDOG_MINOR_2
+#define WD2_MINOR	WATCHDOG_MINOR_3
 
 /* Internal driver definitions.  */
 #define WD0_ID			0
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 565b88efeb23d02b7d91df1cd7df4bdcf2898224..c33839df8bd261bf1ab841b7e50afe3f8b0b007e 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -52,6 +52,10 @@
 #define PXA3XX_GCU_MINOR	197
 #define TUN_MINOR		200
 #define CUSE_MINOR		203
+#define WATCHDOG_MINOR_1	212
+#define WATCHDOG_MINOR_2	213
+#define WATCHDOG_MINOR_3	214
+#define WATCHDOG_MINOR_4	215
 #define MWAVE_MINOR		219	/* ACP/Mwave Modem */
 #define MPT_MINOR		220
 #define MPT2SAS_MINOR		221

-- 
2.34.1


  parent reply	other threads:[~2025-07-01 15:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01 15:24 [PATCH v2 0/9] char: misc: Various cleanup for miscdevice Zijun Hu
2025-07-01 15:24 ` [PATCH v2 1/9] char: misc: Move drivers/misc/misc_minor_kunit.c to drivers/char/ Zijun Hu
2025-07-01 15:24 ` [PATCH v2 2/9] char: misc: Adapt and add test cases for simple minor space division Zijun Hu
2025-07-01 15:24 ` [PATCH v2 3/9] char: misc: Disallow registering miscdevice whose minor > MISC_DYNAMIC_MINOR Zijun Hu
2025-07-01 15:24 ` [PATCH v2 4/9] char: misc: Add a reentry test case for dynamic minor request Zijun Hu
2025-07-01 15:24 ` [PATCH v2 5/9] char: misc: Make registering dynamic device reentry Zijun Hu
2025-07-01 15:24 ` [PATCH v2 6/9] char: misc: Does not request module for miscdevice with dynamic minor Zijun Hu
2025-07-01 15:24 ` Zijun Hu [this message]
2025-07-01 18:45   ` [PATCH v2 7/9] char: misc: Allocate 4 more fixed minors for watchdog Arnd Bergmann
2025-07-02 12:13     ` Zijun Hu
2025-07-01 15:24 ` [PATCH v2 8/9] char: misc: Define fixed minor EISA_EEPROM_MINOR in linux/miscdevice.h Zijun Hu
2025-07-01 15:24 ` [PATCH v2 9/9] sparc: kernel: apc: Remove macro APC_MINOR defination Zijun Hu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250701-rfc_miscdev-v2-7-3eb22bf533be@oss.qualcomm.com \
    --to=zijun_hu@icloud.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=andreas@gaisler.com \
    --cc=arnd@arndb.de \
    --cc=cascardo@igalia.com \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=r.marek@assembler.cz \
    --cc=sparclinux@vger.kernel.org \
    --cc=wim@linux-watchdog.org \
    --cc=zijun.hu@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).