Commit e46674c8 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] MODULE_ALIAS() in block devices

From: Rusty Russell <rusty@rustcorp.com.au>

Previously, default aliases were hardwired into modutils.  Now they should
be inside the modules, using MODULE_ALIAS() (they will be overridden by any
user alias).
parent 5eebb6f2
......@@ -4607,3 +4607,5 @@ MODULE_LICENSE("GPL");
__setup ("floppy=", floppy_setup);
module_init(floppy_init)
#endif
MODULE_ALIAS_BLOCKDEV_MAJOR(FLOPPY_MAJOR);
......@@ -1103,5 +1103,5 @@ __setup ("xd_geo=", xd_manual_geo_init);
#endif /* MODULE */
module_init(xd_init)
module_init(xd_init);
MODULE_ALIAS_BLOCKDEV_MAJOR(XT_DISK_MAJOR);
......@@ -2499,3 +2499,4 @@ static int azt_bcd2bin(unsigned char bcd)
}
MODULE_LICENSE("GPL");
MODULE_ALIAS_BLOCKDEV_MAJOR(AZTECH_CDROM_MAJOR);
......@@ -3500,3 +3500,4 @@ module_init(cdu31a_init);
module_exit(cdu31a_exit);
MODULE_LICENSE("GPL");
MODULE_ALIAS_BLOCKDEV_MAJOR(CDU31A_CDROM_MAJOR);
......@@ -1616,7 +1616,7 @@ static int __init cm206_setup(char *s)
__setup("cm206=", cm206_setup);
#endif /* !MODULE */
MODULE_ALIAS_BLOCKDEV_MAJOR(CM206_CDROM_MAJOR);
/*
* Local variables:
......
......@@ -1029,3 +1029,4 @@ MODULE_AUTHOR("Oliver Raupach <raupach@nwfs1.rz.fh-hannover.de>");
MODULE_LICENSE("GPL");
module_init(gscd_init);
module_exit(gscd_exit);
MODULE_ALIAS_BLOCKDEV_MAJOR(GOLDSTAR_CDROM_MAJOR);
......@@ -1559,3 +1559,4 @@ module_exit(mcd_exit);
MODULE_AUTHOR("Martin Harriss");
MODULE_LICENSE("GPL");
MODULE_ALIAS_BLOCKDEV_MAJOR(MITSUMI_CDROM_MAJOR);
......@@ -1970,3 +1970,4 @@ static int mcdx_setattentuator(struct s_drive_stuff *stuffp,
}
MODULE_LICENSE("GPL");
MODULE_ALIAS_BLOCKDEV_MAJOR(MITSUMI_X_CDROM_MAJOR);
......@@ -2102,3 +2102,4 @@ module_init(optcd_init);
module_exit(optcd_exit);
MODULE_LICENSE("GPL");
MODULE_ALIAS_BLOCKDEV_MAJOR(OPTICS_CDROM_MAJOR);
......@@ -5954,6 +5954,9 @@ static int sbpcd_media_changed(struct cdrom_device_info *cdi, int disc_nr)
}
MODULE_LICENSE("GPL");
/* FIXME: Old modules.conf claims MATSUSHITA_CDROM2_MAJOR and CDROM3, but
AFAICT this doesn't support those majors, so why? --RR 30 Jul 2003 */
MODULE_ALIAS_BLOCKDEV_MAJOR(MATSUSHITA_CDROM_MAJOR);
/*==========================================================================*/
/*
......
......@@ -1813,3 +1813,4 @@ module_init(sjcd_init);
module_exit(sjcd_exit);
MODULE_LICENSE("GPL");
MODULE_ALIAS_BLOCKDEV_MAJOR(SANYO_CDROM_MAJOR);
......@@ -1684,3 +1684,4 @@ module_exit(sony535_exit);
MODULE_LICENSE("GPL");
MODULE_ALIAS_BLOCKDEV_MAJOR(CDU535_CDROM_MAJOR);
......@@ -12,6 +12,8 @@
#include <linux/wait.h>
#include <linux/mempool.h>
#include <linux/bio.h>
#include <linux/module.h>
#include <linux/stringify.h>
#include <asm/scatterlist.h>
......@@ -671,6 +673,11 @@ void kblockd_flush(void);
} \
)
#endif
#define MODULE_ALIAS_BLOCKDEV(major,minor) \
MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \
MODULE_ALIAS("block-major-" __stringify(major) "-*")
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment