1. 01 Feb, 2010 5 commits
    • Artem Bityutskiy's avatar
      UBI: add write checking · 6e9065d7
      Artem Bityutskiy authored
      Add an extra debugging check function which validates writes.
      After every write it reads the data back, compares it with the
      original data, and complains if they mismatch.
      
      Useful for debugging. No-op if extra debugging checks are disabled.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      6e9065d7
    • Artem Bityutskiy's avatar
      UBI: simplify debugging return codes · adbf05e3
      Artem Bityutskiy authored
      UBI debugging functions were a little bit over-engineered and
      returned more error codes than needed, and the callers had to
      do useless checks. Simplify the return codes.
      
      Impact: only debugging code is affected, which means that for
              non-developers this is a no-op patch.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      adbf05e3
    • Artem Bityutskiy's avatar
      UBI: fix attaching error path · 0bf1c439
      Artem Bityutskiy authored
      In the error path of 'ubi_attach_mtd_dev()' we have a tricky situation:
      we have to release things differently depending on at which point
      the failure happening. Namely, if @ubi->dev is not initialized, we have
      to free everything ourselves. But if it was, we should not free the @ubi
      object, because it will be freed in the 'dev_release()' function. And
      we did not get this situation right.
      
      This patch introduces additional argument to the 'uif_init()' function.
      On exit, this argument indicates whether the final 'free(ubi)' will
      happen in 'dev_release()' or not. So the caller always knows how to
      properly release the resources.
      
      Impact: all memory is now correctly released when UBI fails to attach
              an MTD device.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      0bf1c439
    • Artem Bityutskiy's avatar
      UBI: support attaching by MTD character device name · f9b0080e
      Artem Bityutskiy authored
      This patch adds a capability to attach MTD devices by their character
      device paths. For example, one can do:
      
      $ modprobe ubi mtd=/dev/mtd0
      
      to attach /dev/mtd0.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      f9b0080e
    • Artem Bityutskiy's avatar
      UBI: mark few variables as __initdata · 9e0c7ef3
      Artem Bityutskiy authored
      The @mtd_devs and @mtd_dev_param variables are used only during the
      initialization, and all functions that use the variables have
      the __init prefix. This means we can safely mark the variables
      as __initdata, which is a tiny optimization.
      
      Impact: tiny RAM consumption optimization when UBI is used as a kernel
              module.
      Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
      9e0c7ef3
  2. 29 Jan, 2010 2 commits
  3. 28 Jan, 2010 7 commits
  4. 27 Jan, 2010 26 commits