]> www.infradead.org Git - mtd-utils.git/commit
libmtd: improve mtd_islocked interface
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 8 Jun 2011 12:30:14 +0000 (15:30 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 8 Jun 2011 12:30:14 +0000 (15:30 +0300)
commit92a06994b7c3f146cbdb770b30780e32f021118f
tree2e655126d20013d522b237a87d2ba1feb1cb8873
parentd1bc539a3a77bd38f1776d5026277d66b1661c8a
libmtd: improve mtd_islocked interface

This patch first of all, re-names 'mtd_islocked()' into 'mtd_is_locked()' since
this seems to be the name Mike wanted, and it looks a bit nicer.

This patch also makes 'mtd_is_locked()' print an error message if it fails. I'm
not sure if it is good idea for a library to do so, but all functions do this,
so it certainly _not_ a good idea to be inconsistent.

However, for the special case, when the the "is locked" ioctl is not supported
or is not valid for this device, we do not print an error message and return
ENOTSUPP error code.

Thus, the user can distinguish between real errors and non-fatal "not
supported" cases.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
include/libmtd.h
lib/libmtd.c