mtd: rawnand: s3c2410: enhance the probe function error path
Prepare the migration of the lpc32xx_slc driver to use nand_scan() by cleaning the error path in the probe function. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
This commit is contained in:
parent
0eaa879be6
commit
bb00ff2f4a
@ -124,13 +124,11 @@ struct s3c2410_nand_info;
|
|||||||
* @chip: The NAND chip information.
|
* @chip: The NAND chip information.
|
||||||
* @set: The platform information supplied for this set of NAND chips.
|
* @set: The platform information supplied for this set of NAND chips.
|
||||||
* @info: Link back to the hardware information.
|
* @info: Link back to the hardware information.
|
||||||
* @scan_res: The result from calling nand_scan_ident().
|
|
||||||
*/
|
*/
|
||||||
struct s3c2410_nand_mtd {
|
struct s3c2410_nand_mtd {
|
||||||
struct nand_chip chip;
|
struct nand_chip chip;
|
||||||
struct s3c2410_nand_set *set;
|
struct s3c2410_nand_set *set;
|
||||||
struct s3c2410_nand_info *info;
|
struct s3c2410_nand_info *info;
|
||||||
int scan_res;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum s3c_cpu_type {
|
enum s3c_cpu_type {
|
||||||
@ -1163,17 +1161,19 @@ static int s3c24xx_nand_probe(struct platform_device *pdev)
|
|||||||
mtd->dev.parent = &pdev->dev;
|
mtd->dev.parent = &pdev->dev;
|
||||||
s3c2410_nand_init_chip(info, nmtd, sets);
|
s3c2410_nand_init_chip(info, nmtd, sets);
|
||||||
|
|
||||||
nmtd->scan_res = nand_scan_ident(mtd,
|
err = nand_scan_ident(mtd, (sets) ? sets->nr_chips : 1, NULL);
|
||||||
(sets) ? sets->nr_chips : 1,
|
if (err)
|
||||||
NULL);
|
goto exit_error;
|
||||||
|
|
||||||
if (nmtd->scan_res == 0) {
|
|
||||||
err = s3c2410_nand_update_chip(info, nmtd);
|
err = s3c2410_nand_update_chip(info, nmtd);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto exit_error;
|
goto exit_error;
|
||||||
nand_scan_tail(mtd);
|
|
||||||
|
err = nand_scan_tail(mtd);
|
||||||
|
if (err)
|
||||||
|
goto exit_error;
|
||||||
|
|
||||||
s3c2410_nand_add_partition(info, nmtd, sets);
|
s3c2410_nand_add_partition(info, nmtd, sets);
|
||||||
}
|
|
||||||
|
|
||||||
if (sets != NULL)
|
if (sets != NULL)
|
||||||
sets++;
|
sets++;
|
||||||
|
Loading…
Reference in New Issue
Block a user