diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 08:25:39 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:11 -0500 |
commit | 7e1f0dc0551b99acb5e8fa161a7ac401994d57d8 (patch) | |
tree | 19108039bb082d42fbda40d4bd3ddb11a1185cd1 /drivers/mtd/tests | |
parent | 969e57adc2589a0a0ae5edbbe7b92062565ce70b (diff) |
mtd: introduce mtd_erase interface
This patch is part of a patch-set which changes the MTD interface
from 'mtd->func()' form to 'mtd_func()' form. We need this because
we want to add common code to to all drivers in the mtd core level,
which is impossible with the current interface when MTD clients
call driver functions like 'read()' or 'write()' directly.
At this point we just introduce a new inline wrapper function, but
later some of them are expected to gain more code. E.g., the input
parameters check should be moved to the wrappers rather than be
duplicated at many drivers.
This particular patch introduced the 'mtd_erase()' interface. The
following patches add all the other interfaces one by one.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/tests')
-rw-r--r-- | drivers/mtd/tests/mtd_oobtest.c | 2 | ||||
-rw-r--r-- | drivers/mtd/tests/mtd_pagetest.c | 2 | ||||
-rw-r--r-- | drivers/mtd/tests/mtd_speedtest.c | 4 | ||||
-rw-r--r-- | drivers/mtd/tests/mtd_stresstest.c | 2 | ||||
-rw-r--r-- | drivers/mtd/tests/mtd_subpagetest.c | 2 | ||||
-rw-r--r-- | drivers/mtd/tests/mtd_torturetest.c | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mtd/tests/mtd_oobtest.c b/drivers/mtd/tests/mtd_oobtest.c index 933f7e5f32d3..7d52854c16dd 100644 --- a/drivers/mtd/tests/mtd_oobtest.c +++ b/drivers/mtd/tests/mtd_oobtest.c | |||
@@ -78,7 +78,7 @@ static int erase_eraseblock(int ebnum) | |||
78 | ei.addr = addr; | 78 | ei.addr = addr; |
79 | ei.len = mtd->erasesize; | 79 | ei.len = mtd->erasesize; |
80 | 80 | ||
81 | err = mtd->erase(mtd, &ei); | 81 | err = mtd_erase(mtd, &ei); |
82 | if (err) { | 82 | if (err) { |
83 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); | 83 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); |
84 | return err; | 84 | return err; |
diff --git a/drivers/mtd/tests/mtd_pagetest.c b/drivers/mtd/tests/mtd_pagetest.c index afafb6935fd0..271819fabb55 100644 --- a/drivers/mtd/tests/mtd_pagetest.c +++ b/drivers/mtd/tests/mtd_pagetest.c | |||
@@ -77,7 +77,7 @@ static int erase_eraseblock(int ebnum) | |||
77 | ei.addr = addr; | 77 | ei.addr = addr; |
78 | ei.len = mtd->erasesize; | 78 | ei.len = mtd->erasesize; |
79 | 79 | ||
80 | err = mtd->erase(mtd, &ei); | 80 | err = mtd_erase(mtd, &ei); |
81 | if (err) { | 81 | if (err) { |
82 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); | 82 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); |
83 | return err; | 83 | return err; |
diff --git a/drivers/mtd/tests/mtd_speedtest.c b/drivers/mtd/tests/mtd_speedtest.c index 493b367bdd35..f67a65e21043 100644 --- a/drivers/mtd/tests/mtd_speedtest.c +++ b/drivers/mtd/tests/mtd_speedtest.c | |||
@@ -79,7 +79,7 @@ static int erase_eraseblock(int ebnum) | |||
79 | ei.addr = addr; | 79 | ei.addr = addr; |
80 | ei.len = mtd->erasesize; | 80 | ei.len = mtd->erasesize; |
81 | 81 | ||
82 | err = mtd->erase(mtd, &ei); | 82 | err = mtd_erase(mtd, &ei); |
83 | if (err) { | 83 | if (err) { |
84 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); | 84 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); |
85 | return err; | 85 | return err; |
@@ -105,7 +105,7 @@ static int multiblock_erase(int ebnum, int blocks) | |||
105 | ei.addr = addr; | 105 | ei.addr = addr; |
106 | ei.len = mtd->erasesize * blocks; | 106 | ei.len = mtd->erasesize * blocks; |
107 | 107 | ||
108 | err = mtd->erase(mtd, &ei); | 108 | err = mtd_erase(mtd, &ei); |
109 | if (err) { | 109 | if (err) { |
110 | printk(PRINT_PREF "error %d while erasing EB %d, blocks %d\n", | 110 | printk(PRINT_PREF "error %d while erasing EB %d, blocks %d\n", |
111 | err, ebnum, blocks); | 111 | err, ebnum, blocks); |
diff --git a/drivers/mtd/tests/mtd_stresstest.c b/drivers/mtd/tests/mtd_stresstest.c index 811642fea6b4..a204a9f90524 100644 --- a/drivers/mtd/tests/mtd_stresstest.c +++ b/drivers/mtd/tests/mtd_stresstest.c | |||
@@ -112,7 +112,7 @@ static int erase_eraseblock(int ebnum) | |||
112 | ei.addr = addr; | 112 | ei.addr = addr; |
113 | ei.len = mtd->erasesize; | 113 | ei.len = mtd->erasesize; |
114 | 114 | ||
115 | err = mtd->erase(mtd, &ei); | 115 | err = mtd_erase(mtd, &ei); |
116 | if (unlikely(err)) { | 116 | if (unlikely(err)) { |
117 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); | 117 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); |
118 | return err; | 118 | return err; |
diff --git a/drivers/mtd/tests/mtd_subpagetest.c b/drivers/mtd/tests/mtd_subpagetest.c index 1a05bfac4eee..16d0c05024d7 100644 --- a/drivers/mtd/tests/mtd_subpagetest.c +++ b/drivers/mtd/tests/mtd_subpagetest.c | |||
@@ -80,7 +80,7 @@ static int erase_eraseblock(int ebnum) | |||
80 | ei.addr = addr; | 80 | ei.addr = addr; |
81 | ei.len = mtd->erasesize; | 81 | ei.len = mtd->erasesize; |
82 | 82 | ||
83 | err = mtd->erase(mtd, &ei); | 83 | err = mtd_erase(mtd, &ei); |
84 | if (err) { | 84 | if (err) { |
85 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); | 85 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); |
86 | return err; | 86 | return err; |
diff --git a/drivers/mtd/tests/mtd_torturetest.c b/drivers/mtd/tests/mtd_torturetest.c index 03ab649a6964..102c79b7ac66 100644 --- a/drivers/mtd/tests/mtd_torturetest.c +++ b/drivers/mtd/tests/mtd_torturetest.c | |||
@@ -105,7 +105,7 @@ static inline int erase_eraseblock(int ebnum) | |||
105 | ei.addr = addr; | 105 | ei.addr = addr; |
106 | ei.len = mtd->erasesize; | 106 | ei.len = mtd->erasesize; |
107 | 107 | ||
108 | err = mtd->erase(mtd, &ei); | 108 | err = mtd_erase(mtd, &ei); |
109 | if (err) { | 109 | if (err) { |
110 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); | 110 | printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); |
111 | return err; | 111 | return err; |