]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/mtd/ubi/build.c
Merge tag 'upstream-4.7-rc1' of git://git.infradead.org/linux-ubifs
[mirror_ubuntu-zesty-kernel.git] / drivers / mtd / ubi / build.c
index a7d1febf667a9da0d14585301ae4dad94d3c3ae2..16baeb51b2bdfe2b37d5179b9816ba6493622e99 100644 (file)
@@ -149,6 +149,8 @@ static struct device_attribute dev_bgt_enabled =
        __ATTR(bgt_enabled, S_IRUGO, dev_attribute_show, NULL);
 static struct device_attribute dev_mtd_num =
        __ATTR(mtd_num, S_IRUGO, dev_attribute_show, NULL);
+static struct device_attribute dev_ro_mode =
+       __ATTR(ro_mode, S_IRUGO, dev_attribute_show, NULL);
 
 /**
  * ubi_volume_notify - send a volume change notification.
@@ -385,6 +387,8 @@ static ssize_t dev_attribute_show(struct device *dev,
                ret = sprintf(buf, "%d\n", ubi->thread_enabled);
        else if (attr == &dev_mtd_num)
                ret = sprintf(buf, "%d\n", ubi->mtd->index);
+       else if (attr == &dev_ro_mode)
+               ret = sprintf(buf, "%d\n", ubi->ro_mode);
        else
                ret = -EINVAL;
 
@@ -404,6 +408,7 @@ static struct attribute *ubi_dev_attrs[] = {
        &dev_min_io_size.attr,
        &dev_bgt_enabled.attr,
        &dev_mtd_num.attr,
+       &dev_ro_mode.attr,
        NULL
 };
 ATTRIBUTE_GROUPS(ubi_dev);