--- zzzz-none-000/linux-2.6.32.61/drivers/mtd/chips/chipreg.c 2013-06-10 09:43:48.000000000 +0000 +++ ar9-7330-650/linux-2.6.32.61/drivers/mtd/chips/chipreg.c 2011-07-20 07:23:51.000000000 +0000 @@ -38,6 +38,7 @@ list_for_each(pos, &chip_drvs_list) { this = list_entry(pos, typeof(*this), list); + /*--- printk("[%s] %s == %s \n", __FUNCTION__, this->name, name); ---*/ if (!strcmp(this->name, name)) { ret = this; @@ -57,30 +58,34 @@ struct mtd_info *do_map_probe(const char *name, struct map_info *map) { - struct mtd_chip_driver *drv; - struct mtd_info *ret; + struct mtd_chip_driver *drv; + struct mtd_info *ret; - drv = get_mtd_chip_driver(name); + printk("[%s] driver_name=%s\n",__FUNCTION__,name); + drv = get_mtd_chip_driver(name); - if (!drv && !request_module("%s", name)) - drv = get_mtd_chip_driver(name); + if (!drv && !request_module("%s", name)) { + drv = get_mtd_chip_driver(name); + } + + if (!drv) { + return NULL; + } + + ret = drv->probe(map); + + /* We decrease the use count here. It may have been a + probe-only module, which is no longer required from this + point, having given us a handle on (and increased the use + count of) the actual driver code. + */ + module_put(drv->module); + + if (ret) { + return ret; + } - if (!drv) - return NULL; - - ret = drv->probe(map); - - /* We decrease the use count here. It may have been a - probe-only module, which is no longer required from this - point, having given us a handle on (and increased the use - count of) the actual driver code. - */ - module_put(drv->module); - - if (ret) - return ret; - - return NULL; + return NULL; } /* * Destroy an MTD device which was created for a map device.