[PATCH] mtd: export mtd->writebufsize attribute over sysfs

Artem Bityutskiy dedekind1 at gmail.com
Fri Feb 11 10:09:54 EST 2011


On Fri, 2011-02-11 at 12:46 +0100, Anatolij Gustschin wrote:
> +static ssize_t mtd_writebufsize_store(struct device *dev,
> +				struct device_attribute *attr,
> +				const char *buf, size_t size)
> +{
> +	struct mtd_info *mtd = dev_to_mtd(dev);
> +	unsigned long value;
> +	int ret;
> +
> +	ret = strict_strtoul(buf, 0, &value);
> +	if (ret < 0)
> +		return ret;
> +
> +	mtd->writebufsize = value;
> +	return size;
> +}
> +static DEVICE_ATTR(writebufsize, S_IRUGO, mtd_writebufsize_show,
> +		   mtd_writebufsize_store);


I think writebufsize should be read-only. This is characteristic of the
flash and should not be changed. OK, if the chip allows to change it, it
could be done, but this is not what the patch seems to be about.

I mean, writebufsize is like writesize. Why writesize sysfs attribut is
R/O but writebufsize should be RW?

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list