From: Zhenzhong Duan <zhenzhong.duan@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: jdike@addtoit.com, richard@nod.at,
anton.ivanov@cambridgegreys.com, miguel.ojeda.sandonis@gmail.com,
willy@haproxy.com, ksenija.stanojevic@gmail.com, arnd@arndb.de,
gregkh@linuxfoundation.org, mpm@selenic.com,
herbert@gondor.apana.org.au, jonathan@buzzard.org.uk,
benh@kernel.crashing.org, davem@davemloft.net,
b.zolnierkie@samsung.com, rjw@rjwysocki.net, pavel@ucw.cz,
len.brown@intel.com, Zhenzhong Duan <zhenzhong.duan@gmail.com>,
Russell King <linux@armlinux.org.uk>
Subject: [PATCH RFC 2/3] misc: move FLASH_MINOR into miscdevice.h and fix conflicts
Date: Mon, 9 Mar 2020 10:17:46 +0800 [thread overview]
Message-ID: <20200309021747.626-3-zhenzhong.duan@gmail.com> (raw)
In-Reply-To: <20200309021747.626-1-zhenzhong.duan@gmail.com>
FLASH_MINOR is used in both drivers/char/nwflash.c and
drivers/sbus/char/flash.c with conflict minor numbers.
Move all the definitions of FLASH_MINOR into miscdevice.h.
Rename FLASH_MINOR for drivers/char/nwflash.c to NWFLASH_MINOR
and FLASH_MINOR for drivers/sbus/char/flash.c to SBUS_FLASH_MINOR.
Link: https://lore.kernel.org/lkml/20200120221323.GJ15860@mit.edu/t/
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: "David S. Miller" <davem@davemloft.net>
---
arch/arm/include/asm/nwflash.h | 1 -
drivers/char/nwflash.c | 2 +-
drivers/sbus/char/flash.c | 4 +---
include/linux/miscdevice.h | 2 ++
4 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/arm/include/asm/nwflash.h b/arch/arm/include/asm/nwflash.h
index 0ec6f07..66b7e68 100644
--- a/arch/arm/include/asm/nwflash.h
+++ b/arch/arm/include/asm/nwflash.h
@@ -2,7 +2,6 @@
#ifndef _FLASH_H
#define _FLASH_H
-#define FLASH_MINOR 160 /* MAJOR is 10 - miscdevice */
#define CMD_WRITE_DISABLE 0
#define CMD_WRITE_ENABLE 0x28
#define CMD_WRITE_BASE64K_ENABLE 0x47
diff --git a/drivers/char/nwflash.c b/drivers/char/nwflash.c
index a4a0797d..0973c2c 100644
--- a/drivers/char/nwflash.c
+++ b/drivers/char/nwflash.c
@@ -576,7 +576,7 @@ static void kick_open(void)
static struct miscdevice flash_miscdev =
{
- FLASH_MINOR,
+ NWFLASH_MINOR,
"nwflash",
&flash_fops
};
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index e85a05a..4147d22 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -31,8 +31,6 @@
unsigned long busy; /* In use? */
} flash;
-#define FLASH_MINOR 152
-
static int
flash_mmap(struct file *file, struct vm_area_struct *vma)
{
@@ -157,7 +155,7 @@
.release = flash_release,
};
-static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops };
+static struct miscdevice flash_dev = { SBUS_FLASH_MINOR, "flash", &flash_fops };
static int flash_probe(struct platform_device *op)
{
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 35294c6..41dc10b 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -30,12 +30,14 @@
#define SUN_OPENPROM_MINOR 139
#define DMAPI_MINOR 140 /* unused */
#define NVRAM_MINOR 144
+#define SBUS_FLASH_MINOR 152
#define SGI_MMTIMER 153
#define PMU_MINOR 154
#define STORE_QUEUE_MINOR 155 /* unused */
#define LCD_MINOR 156
#define AC_MINOR 157
#define BUTTON_MINOR 158 /* Major 10, Minor 158, /dev/nwbutton */
+#define NWFLASH_MINOR 160 /* MAJOR is 10 - miscdevice */
#define ENVCTRL_MINOR 162
#define I2O_MINOR 166
#define UCTRL_MINOR 174
--
1.8.3.1
next prev parent reply other threads:[~2020-03-09 2:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-09 2:17 [PATCH RFC 0/3] clean up misc device minor numbers Zhenzhong Duan
2020-03-09 2:17 ` [PATCH RFC 1/3] misc: cleanup minor number definitions in c file into miscdevice.h Zhenzhong Duan
2020-03-09 8:53 ` Herbert Xu
2020-03-11 3:07 ` Zhenzhong Duan
2020-03-09 11:37 ` Miguel Ojeda
2020-03-09 13:08 ` Arnd Bergmann
2020-03-11 2:57 ` Zhenzhong Duan
2020-03-09 2:17 ` Zhenzhong Duan [this message]
2020-03-09 13:05 ` [PATCH RFC 2/3] misc: move FLASH_MINOR into miscdevice.h and fix conflicts Arnd Bergmann
2020-03-09 2:17 ` [PATCH RFC 3/3] speakup: misc: Use dynamic minor numbers for speakup devices Zhenzhong Duan
2020-03-09 7:15 ` Greg KH
2020-03-14 22:21 ` Samuel Thibault
2020-03-09 7:13 ` [PATCH RFC 0/3] clean up misc device minor numbers Greg KH
2020-03-09 9:51 ` Willy TARREAU
2020-03-09 11:36 ` Miguel Ojeda
2020-03-11 3:14 ` Zhenzhong Duan
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=20200309021747.626-3-zhenzhong.duan@gmail.com \
--to=zhenzhong.duan@gmail.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=arnd@arndb.de \
--cc=b.zolnierkie@samsung.com \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=jdike@addtoit.com \
--cc=jonathan@buzzard.org.uk \
--cc=ksenija.stanojevic@gmail.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=mpm@selenic.com \
--cc=pavel@ucw.cz \
--cc=richard@nod.at \
--cc=rjw@rjwysocki.net \
--cc=willy@haproxy.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
all inboxes | Powered by JetHome®