Name: try_then_request_module() in MTD code Author: Rusty Russell Status: Trivial MTD can constructively use the try_then_request_module() macro. Index: linux-2.6.10-rc1-bk10-Module/drivers/mtd/chips/chipreg.c =================================================================== --- linux-2.6.10-rc1-bk10-Module.orig/drivers/mtd/chips/chipreg.c 2004-09-28 16:22:06.000000000 +1000 +++ linux-2.6.10-rc1-bk10-Module/drivers/mtd/chips/chipreg.c 2004-11-01 17:46:30.713367072 +1100 @@ -63,11 +63,7 @@ struct mtd_chip_driver *drv; struct mtd_info *ret; - drv = get_mtd_chip_driver(name); - - if (!drv && !request_module("%s", name)) - drv = get_mtd_chip_driver(name); - + drv = try_then_request_module(get_mtd_chip_driver(name), "%s", name); if (!drv) return NULL; Index: linux-2.6.10-rc1-bk10-Module/drivers/mtd/mtdpart.c =================================================================== --- linux-2.6.10-rc1-bk10-Module.orig/drivers/mtd/mtdpart.c 2004-09-28 16:22:06.000000000 +1000 +++ linux-2.6.10-rc1-bk10-Module/drivers/mtd/mtdpart.c 2004-11-01 17:46:30.714366920 +1100 @@ -569,11 +569,8 @@ int ret = 0; for ( ; ret <= 0 && *types; types++) { - parser = get_partition_parser(*types); -#ifdef CONFIG_KMOD - if (!parser && !request_module("%s", *types)) - parser = get_partition_parser(*types); -#endif + parser = try_then_request_module(get_partition_parser(*types), + "%s", *types); if (!parser) { printk(KERN_NOTICE "%s partition parsing not available\n", *types);