• Alexander Sverdlin's avatar
    mtd: phram: Repair multiple instances support · 6f6b9fee
    Alexander Sverdlin authored
    Commit b2a2a84d (mtd: phram: dot not crash when
    built-in and passing boot param) claims to be "based on Ville Herva's similar
    patch to block2mtd" (c4e7fb31), but it has
    missed the crucial point of the original path: all these "if(n)def MODULE".
    It has broken the possibility to create several phram instances when phram is
    compiled as module. The possibility to add instances via /sys writes to
    /sys/module/phram/parameters/phram was also broken with mentioned patch.
    Proposed patch takes the idea of original block2mtd patch to its full extent.
    Assumption "This function is always called before 'init_phram()'" was also
    incorrect, so removed the comment. This patch effectively reverts also
    b11ec57f (mtd: phram: fix section mismatch for
    phram_setup).
    Signed-off-by: default avatarAlexander Sverdlin <alexander.sverdlin@nsn.com>
    [Brian: remove static assigment = 0]
    Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
    6f6b9fee
phram.c 6.56 KB