diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/devices/docg3.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c index d7df3114aa17..f7490a014e78 100644 --- a/drivers/mtd/devices/docg3.c +++ b/drivers/mtd/devices/docg3.c | |||
@@ -2027,21 +2027,24 @@ static int __init docg3_probe(struct platform_device *pdev) | |||
2027 | if (!docg3_bch) | 2027 | if (!docg3_bch) |
2028 | goto nomem2; | 2028 | goto nomem2; |
2029 | 2029 | ||
2030 | ret = 0; | ||
2031 | for (floor = 0; floor < DOC_MAX_NBFLOORS; floor++) { | 2030 | for (floor = 0; floor < DOC_MAX_NBFLOORS; floor++) { |
2032 | mtd = doc_probe_device(base, floor, dev); | 2031 | mtd = doc_probe_device(base, floor, dev); |
2033 | if (floor == 0 && !mtd) | 2032 | if (IS_ERR(mtd)) { |
2034 | goto notfound; | ||
2035 | if (!IS_ERR_OR_NULL(mtd)) | ||
2036 | ret = mtd_device_parse_register(mtd, part_probes, | ||
2037 | NULL, NULL, 0); | ||
2038 | else | ||
2039 | ret = PTR_ERR(mtd); | 2033 | ret = PTR_ERR(mtd); |
2034 | goto err_probe; | ||
2035 | } | ||
2036 | if (!mtd) { | ||
2037 | if (floor == 0) | ||
2038 | goto notfound; | ||
2039 | else | ||
2040 | continue; | ||
2041 | } | ||
2040 | docg3_floors[floor] = mtd; | 2042 | docg3_floors[floor] = mtd; |
2043 | ret = mtd_device_parse_register(mtd, part_probes, NULL, NULL, | ||
2044 | 0); | ||
2041 | if (ret) | 2045 | if (ret) |
2042 | goto err_probe; | 2046 | goto err_probe; |
2043 | if (mtd) | 2047 | found++; |
2044 | found++; | ||
2045 | } | 2048 | } |
2046 | 2049 | ||
2047 | ret = doc_register_sysfs(pdev, docg3_floors); | 2050 | ret = doc_register_sysfs(pdev, docg3_floors); |