UBI: prepare debugging stuff to further debugfs conversion
We'll need the 'struct ubi_device *ubi' pointer in every debugging function (to access the ->dbg field), so add this pointer to all the functions implementing UBI debugging test modes like 'ubi_dbg_is_bitflip()' etc. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
@@ -212,7 +212,7 @@ retry:
|
||||
} else {
|
||||
ubi_assert(len == read);
|
||||
|
||||
if (ubi_dbg_is_bitflip()) {
|
||||
if (ubi_dbg_is_bitflip(ubi)) {
|
||||
dbg_gen("bit-flip (emulated)");
|
||||
err = UBI_IO_BITFLIPS;
|
||||
}
|
||||
@@ -281,7 +281,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset,
|
||||
return err;
|
||||
}
|
||||
|
||||
if (ubi_dbg_is_write_failure()) {
|
||||
if (ubi_dbg_is_write_failure(ubi)) {
|
||||
dbg_err("cannot write %d bytes to PEB %d:%d "
|
||||
"(emulated)", len, pnum, offset);
|
||||
ubi_dbg_dump_stack();
|
||||
@@ -396,7 +396,7 @@ retry:
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (ubi_dbg_is_erase_failure()) {
|
||||
if (ubi_dbg_is_erase_failure(ubi)) {
|
||||
dbg_err("cannot erase PEB %d (emulated)", pnum);
|
||||
return -EIO;
|
||||
}
|
||||
|
Reference in New Issue
Block a user