aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2018-03-21 09:01:57 -0400
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-03-29 03:38:21 -0400
commitbb00ff2f4a746db95a44758d45bd3f715169ef6f (patch)
tree58b80e2486bc1810c6d22e83435fc34c94341303
parent0eaa879be623f5e209e79a40f5e281f9c5c9170b (diff)
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>
-rw-r--r--drivers/mtd/nand/raw/s3c2410.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/mtd/nand/raw/s3c2410.c b/drivers/mtd/nand/raw/s3c2410.c
index b5bc5f106c09..1bc0458063d8 100644
--- a/drivers/mtd/nand/raw/s3c2410.c
+++ b/drivers/mtd/nand/raw/s3c2410.c
@@ -124,13 +124,11 @@ struct s3c2410_nand_info;
124 * @chip: The NAND chip information. 124 * @chip: The NAND chip information.
125 * @set: The platform information supplied for this set of NAND chips. 125 * @set: The platform information supplied for this set of NAND chips.
126 * @info: Link back to the hardware information. 126 * @info: Link back to the hardware information.
127 * @scan_res: The result from calling nand_scan_ident().
128*/ 127*/
129struct s3c2410_nand_mtd { 128struct s3c2410_nand_mtd {
130 struct nand_chip chip; 129 struct nand_chip chip;
131 struct s3c2410_nand_set *set; 130 struct s3c2410_nand_set *set;
132 struct s3c2410_nand_info *info; 131 struct s3c2410_nand_info *info;
133 int scan_res;
134}; 132};
135 133
136enum s3c_cpu_type { 134enum s3c_cpu_type {
@@ -1163,17 +1161,19 @@ static int s3c24xx_nand_probe(struct platform_device *pdev)
1163 mtd->dev.parent = &pdev->dev; 1161 mtd->dev.parent = &pdev->dev;
1164 s3c2410_nand_init_chip(info, nmtd, sets); 1162 s3c2410_nand_init_chip(info, nmtd, sets);
1165 1163
1166 nmtd->scan_res = nand_scan_ident(mtd, 1164 err = nand_scan_ident(mtd, (sets) ? sets->nr_chips : 1, NULL);
1167 (sets) ? sets->nr_chips : 1, 1165 if (err)
1168 NULL); 1166 goto exit_error;
1169 1167
1170 if (nmtd->scan_res == 0) { 1168 err = s3c2410_nand_update_chip(info, nmtd);
1171 err = s3c2410_nand_update_chip(info, nmtd); 1169 if (err < 0)
1172 if (err < 0) 1170 goto exit_error;
1173 goto exit_error; 1171
1174 nand_scan_tail(mtd); 1172 err = nand_scan_tail(mtd);
1175 s3c2410_nand_add_partition(info, nmtd, sets); 1173 if (err)
1176 } 1174 goto exit_error;
1175
1176 s3c2410_nand_add_partition(info, nmtd, sets);
1177 1177
1178 if (sets != NULL) 1178 if (sets != NULL)
1179 sets++; 1179 sets++;