[PATCH] UBI:Force ubi driver load after mtd device drivers

Lu.Jiang lu.jiang at windriver.com
Sun Aug 26 21:10:12 EDT 2012


于 2012年08月24日 19:24, Artem Bityutskiy 写道:
> On Fri, 2012-08-24 at 12:41 +0300, Artem Bityutskiy wrote:
>> On Wed, 2012-08-08 at 10:31 +0800, Jiang Lu wrote:
>>> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
>>> index 0fde9fc..efbcaef 100644
>>> --- a/drivers/mtd/ubi/build.c
>>> +++ b/drivers/mtd/ubi/build.c
>>> @@ -1275,7 +1275,7 @@ out:
>>>   	ubi_err("UBI error: cannot initialize UBI, error %d", err);
>>>   	return err;
>>>   }
>>> -module_init(ubi_init);
>>> +late_initcall(ubi_init);
>> The problem is that UBIFS, which is usually used on top of UBI, also
>> uses 'late_initcall()'. If we do this change, how do we guarantee that
>> UBIFS is initialized after UBI?
> Although, I think it is not really a problem and UBIFS can be
> initialized at any point - it does not depend on UBI being initialized.
>
Yes, it works fine with this change. UFIFS can be mount as rootfs device 
on SPI flash after ubi_init() change to late_initcall().

Jiang Lu



More information about the linux-mtd mailing list