Skip to content

Commit

Permalink
UBI: minor tidy-ups
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Dec 26, 2007
1 parent 54b2c8f commit 732aeac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/mtd/ubi/vmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ static ssize_t vol_attribute_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int ret = -ENODEV;

struct ubi_volume *vol = container_of(dev, struct ubi_volume, dev);

spin_lock(&vol->ubi->volumes_lock);
if (vol->removed) {
spin_unlock(&vol->ubi->volumes_lock);
return ret;
}

if (attr == &attr_vol_reserved_ebs)
ret = sprintf(buf, "%d\n", vol->reserved_pebs);
else if (attr == &attr_vol_type) {
Expand All @@ -95,9 +95,9 @@ static ssize_t vol_attribute_show(struct device *dev,
ret = sprintf(buf, "%d\n", vol->corrupted);
else if (attr == &attr_vol_alignment)
ret = sprintf(buf, "%d\n", vol->alignment);
else if (attr == &attr_vol_usable_eb_size) {
else if (attr == &attr_vol_usable_eb_size)
ret = sprintf(buf, "%d\n", vol->usable_leb_size);
} else if (attr == &attr_vol_data_bytes)
else if (attr == &attr_vol_data_bytes)
ret = sprintf(buf, "%lld\n", vol->used_bytes);
else if (attr == &attr_vol_upd_marker)
ret = sprintf(buf, "%d\n", vol->upd_marker);
Expand All @@ -111,6 +111,7 @@ static ssize_t vol_attribute_show(struct device *dev,
static void vol_release(struct device *dev)
{
struct ubi_volume *vol = container_of(dev, struct ubi_volume, dev);

ubi_assert(vol->removed);
kfree(vol);
}
Expand Down

0 comments on commit 732aeac

Please sign in to comment.