mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
mtd: phram: only call platform_driver_unregister if phram_setup fails
The check on ret and call to platform_driver_unregister is only required in the code path where MODULE is not defined. Fix this by moving this code into the relevant place after the call to phram_setup. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
parent
40384c840e
commit
78a56df609
|
|
@ -415,14 +415,14 @@ static int __init init_phram(void)
|
|||
return ret;
|
||||
|
||||
#ifndef MODULE
|
||||
if (phram_paramline[0])
|
||||
if (phram_paramline[0]) {
|
||||
ret = phram_setup(phram_paramline);
|
||||
if (ret)
|
||||
platform_driver_unregister(&phram_driver);
|
||||
}
|
||||
phram_init_called = 1;
|
||||
#endif
|
||||
|
||||
if (ret)
|
||||
platform_driver_unregister(&phram_driver);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user