mtd: return error code from mtd_unpoint

The 'mtd_unpoint()' API function should be able to return an error code because
it may fail if you specify incorrect offset. This patch changes this MTD API
function and amends all the drivers correspondingly.

Also return '-EOPNOTSUPP' from 'mtd_unpoint()' when the '->unpoint()' method is
undefined. We do not really need this currently, but this just makes
sense to be consistent with 'mtd_point()'.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
这个提交包含在:
Artem Bityutskiy
2012-02-03 13:20:43 +02:00
提交者 David Woodhouse
父节点 e2414f4c20
当前提交 5e4e6e3fdf
修改 9 个文件,包含 33 行新增20 行删除

查看文件

@@ -60,8 +60,9 @@ static int ram_point(struct mtd_info *mtd, loff_t from, size_t len,
return 0;
}
static void ram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
static int ram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
{
return 0;
}
/*