Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: move FLASH_MINOR into miscdevice.h and fix conflicts

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>
Acked-by: 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>
Link: https://lore.kernel.org/r/20200311071654.335-3-zhenzhong.duan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Zhenzhong Duan and committed by
Greg Kroah-Hartman
2668dba6 6ce6ae7c

+4 -5
-1
arch/arm/include/asm/nwflash.h
··· 2 2 #ifndef _FLASH_H 3 3 #define _FLASH_H 4 4 5 - #define FLASH_MINOR 160 /* MAJOR is 10 - miscdevice */ 6 5 #define CMD_WRITE_DISABLE 0 7 6 #define CMD_WRITE_ENABLE 0x28 8 7 #define CMD_WRITE_BASE64K_ENABLE 0x47
+1 -1
drivers/char/nwflash.c
··· 576 576 577 577 static struct miscdevice flash_miscdev = 578 578 { 579 - FLASH_MINOR, 579 + NWFLASH_MINOR, 580 580 "nwflash", 581 581 &flash_fops 582 582 };
+1 -3
drivers/sbus/char/flash.c
··· 31 31 unsigned long busy; /* In use? */ 32 32 } flash; 33 33 34 - #define FLASH_MINOR 152 35 - 36 34 static int 37 35 flash_mmap(struct file *file, struct vm_area_struct *vma) 38 36 { ··· 155 157 .release = flash_release, 156 158 }; 157 159 158 - static struct miscdevice flash_dev = { FLASH_MINOR, "flash", &flash_fops }; 160 + static struct miscdevice flash_dev = { SBUS_FLASH_MINOR, "flash", &flash_fops }; 159 161 160 162 static int flash_probe(struct platform_device *op) 161 163 {
+2
include/linux/miscdevice.h
··· 30 30 #define SUN_OPENPROM_MINOR 139 31 31 #define DMAPI_MINOR 140 /* unused */ 32 32 #define NVRAM_MINOR 144 33 + #define SBUS_FLASH_MINOR 152 33 34 #define SGI_MMTIMER 153 34 35 #define PMU_MINOR 154 35 36 #define STORE_QUEUE_MINOR 155 /* unused */ 36 37 #define LCD_MINOR 156 37 38 #define AC_MINOR 157 38 39 #define BUTTON_MINOR 158 /* Major 10, Minor 158, /dev/nwbutton */ 40 + #define NWFLASH_MINOR 160 /* MAJOR is 10 - miscdevice */ 39 41 #define ENVCTRL_MINOR 162 40 42 #define I2O_MINOR 166 41 43 #define UCTRL_MINOR 174