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

misc: cleanup minor number definitions in c file into miscdevice.h

HWRNG_MINOR and RNG_MISCDEV_MINOR are duplicate definitions, use
unified HWRNG_MINOR instead and moved into miscdevice.h

ANSLCD_MINOR and LCD_MINOR are duplicate definitions, use unified
LCD_MINOR instead and moved into miscdevice.h

MISCDEV_MINOR is renamed to PXA3XX_GCU_MINOR and moved into
miscdevice.h

Other definitions are just moved without any change.

Link: https://lore.kernel.org/lkml/20200120221323.GJ15860@mit.edu/t/
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Build-tested-by: Willy TARREAU <wtarreau@haproxy.com>
Build-tested-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@gmail.com>
Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Link: https://lore.kernel.org/r/20200311071654.335-2-zhenzhong.duan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Zhenzhong Duan and committed by
Greg Kroah-Hartman
6ce6ae7c c23df7de

+15 -27
+1 -3
arch/um/drivers/random.c
··· 23 23 #define RNG_VERSION "1.0.0" 24 24 #define RNG_MODULE_NAME "hw_random" 25 25 26 - #define RNG_MISCDEV_MINOR 183 /* official */ 27 - 28 26 /* Changed at init time, in the non-modular case, and at module load 29 27 * time, in the module case. Presumably, the module subsystem 30 28 * protects against a module being loaded twice at the same time. ··· 102 104 103 105 /* rng_init shouldn't be called more than once at boot time */ 104 106 static struct miscdevice rng_miscdev = { 105 - RNG_MISCDEV_MINOR, 107 + HWRNG_MINOR, 106 108 RNG_MODULE_NAME, 107 109 &rng_chrdev_ops, 108 110 };
-2
drivers/auxdisplay/charlcd.c
··· 22 22 23 23 #include "charlcd.h" 24 24 25 - #define LCD_MINOR 156 26 - 27 25 #define DEFAULT_LCD_BWIDTH 40 28 26 #define DEFAULT_LCD_HWIDTH 64 29 27
-2
drivers/auxdisplay/panel.c
··· 57 57 58 58 #include "charlcd.h" 59 59 60 - #define KEYPAD_MINOR 185 61 - 62 60 #define LCD_MAXBYTES 256 /* max burst write */ 63 61 64 62 #define KEYPAD_BUFFER 64
-1
drivers/char/applicom.c
··· 53 53 #define MAX_BOARD 8 /* maximum of pc board possible */ 54 54 #define MAX_ISA_BOARD 4 55 55 #define LEN_RAM_IO 0x800 56 - #define AC_MINOR 157 57 56 58 57 #ifndef PCI_VENDOR_ID_APPLICOM 59 58 #define PCI_VENDOR_ID_APPLICOM 0x1389
-1
drivers/char/nwbutton.h
··· 14 14 #define NUM_PRESSES_REBOOT 2 /* How many presses to activate shutdown */ 15 15 #define BUTTON_DELAY 30 /* How many jiffies for sequence to end */ 16 16 #define VERSION "0.3" /* Driver version number */ 17 - #define BUTTON_MINOR 158 /* Major 10, Minor 158, /dev/nwbutton */ 18 17 19 18 /* Structure definitions: */ 20 19
-2
drivers/char/toshiba.c
··· 61 61 #include <linux/mutex.h> 62 62 #include <linux/toshiba.h> 63 63 64 - #define TOSH_MINOR_DEV 181 65 - 66 64 MODULE_LICENSE("GPL"); 67 65 MODULE_AUTHOR("Jonathan Buzzard <jonathan@buzzard.org.uk>"); 68 66 MODULE_DESCRIPTION("Toshiba laptop SMM driver");
+1 -1
drivers/macintosh/ans-lcd.c
··· 142 142 }; 143 143 144 144 static struct miscdevice anslcd_dev = { 145 - ANSLCD_MINOR, 145 + LCD_MINOR, 146 146 "anslcd", 147 147 &anslcd_fops 148 148 };
-2
drivers/macintosh/ans-lcd.h
··· 2 2 #ifndef _PPC_ANS_LCD_H 3 3 #define _PPC_ANS_LCD_H 4 4 5 - #define ANSLCD_MINOR 156 6 - 7 5 #define ANSLCD_CLEAR 0x01 8 6 #define ANSLCD_SENDCTRL 0x02 9 7 #define ANSLCD_SETSHORTDELAY 0x03
-3
drivers/macintosh/via-pmu.c
··· 75 75 /* Some compile options */ 76 76 #undef DEBUG_SLEEP 77 77 78 - /* Misc minor number allocated for /dev/pmu */ 79 - #define PMU_MINOR 154 80 - 81 78 /* How many iterations between battery polls */ 82 79 #define BATTERY_POLLING_COUNT 2 83 80
-2
drivers/sbus/char/envctrl.c
··· 37 37 #define DRIVER_NAME "envctrl" 38 38 #define PFX DRIVER_NAME ": " 39 39 40 - #define ENVCTRL_MINOR 162 41 - 42 40 #define PCF8584_ADDRESS 0x55 43 41 44 42 #define CONTROL_PIN 0x80
-2
drivers/sbus/char/uctrl.c
··· 23 23 #include <asm/io.h> 24 24 #include <asm/pgtable.h> 25 25 26 - #define UCTRL_MINOR 174 27 - 28 26 #define DEBUG 1 29 27 #ifdef DEBUG 30 28 #define dprintk(x) printk x
+3 -4
drivers/video/fbdev/pxa3xx-gcu.c
··· 36 36 #include "pxa3xx-gcu.h" 37 37 38 38 #define DRV_NAME "pxa3xx-gcu" 39 - #define MISCDEV_MINOR 197 40 39 41 40 #define REG_GCCR 0x00 42 41 #define GCCR_SYNC_CLR (1 << 9) ··· 594 595 * container_of(). This isn't really necessary as we have a fixed minor 595 596 * number anyway, but this is to avoid statics. */ 596 597 597 - priv->misc_dev.minor = MISCDEV_MINOR, 598 + priv->misc_dev.minor = PXA3XX_GCU_MINOR, 598 599 priv->misc_dev.name = DRV_NAME, 599 600 priv->misc_dev.fops = &pxa3xx_gcu_miscdev_fops; 600 601 ··· 637 638 ret = misc_register(&priv->misc_dev); 638 639 if (ret < 0) { 639 640 dev_err(dev, "misc_register() for minor %d failed\n", 640 - MISCDEV_MINOR); 641 + PXA3XX_GCU_MINOR); 641 642 goto err_free_dma; 642 643 } 643 644 ··· 713 714 714 715 MODULE_DESCRIPTION("PXA3xx graphics controller unit driver"); 715 716 MODULE_LICENSE("GPL"); 716 - MODULE_ALIAS_MISCDEV(MISCDEV_MINOR); 717 + MODULE_ALIAS_MISCDEV(PXA3XX_GCU_MINOR); 717 718 MODULE_AUTHOR("Janine Kropp <nin@directfb.org>, " 718 719 "Denis Oliver Kropp <dok@directfb.org>, " 719 720 "Daniel Mack <daniel@caiaq.de>");
+10
include/linux/miscdevice.h
··· 31 31 #define DMAPI_MINOR 140 /* unused */ 32 32 #define NVRAM_MINOR 144 33 33 #define SGI_MMTIMER 153 34 + #define PMU_MINOR 154 34 35 #define STORE_QUEUE_MINOR 155 /* unused */ 36 + #define LCD_MINOR 156 37 + #define AC_MINOR 157 38 + #define BUTTON_MINOR 158 /* Major 10, Minor 158, /dev/nwbutton */ 39 + #define ENVCTRL_MINOR 162 35 40 #define I2O_MINOR 166 41 + #define UCTRL_MINOR 174 36 42 #define AGPGART_MINOR 175 43 + #define TOSH_MINOR_DEV 181 37 44 #define HWRNG_MINOR 183 38 45 #define MICROCODE_MINOR 184 46 + #define KEYPAD_MINOR 185 39 47 #define IRNET_MINOR 187 40 48 #define D7S_MINOR 193 41 49 #define VFIO_MINOR 196 50 + #define PXA3XX_GCU_MINOR 197 42 51 #define TUN_MINOR 200 43 52 #define CUSE_MINOR 203 44 53 #define MWAVE_MINOR 219 /* ACP/Mwave Modem */ ··· 58 49 #define MISC_MCELOG_MINOR 227 59 50 #define HPET_MINOR 228 60 51 #define FUSE_MINOR 229 52 + #define SNAPSHOT_MINOR 231 61 53 #define KVM_MINOR 232 62 54 #define BTRFS_MINOR 234 63 55 #define AUTOFS_MINOR 235
-2
kernel/power/user.c
··· 27 27 #include "power.h" 28 28 29 29 30 - #define SNAPSHOT_MINOR 231 31 - 32 30 static struct snapshot_data { 33 31 struct snapshot_handle handle; 34 32 int swap;