All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: dedekind1@gmail.com
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: export mtd->writebufsize attribute over sysfs
Date: Fri, 11 Feb 2011 16:35:11 +0100	[thread overview]
Message-ID: <20110211163511.061d0f96@wker> (raw)
In-Reply-To: <1297436994.2760.51.camel@localhost>

On Fri, 11 Feb 2011 17:09:54 +0200
Artem Bityutskiy <dedekind1@gmail.com> wrote:

> 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.

Yes, it is read-only by default.

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

This attribute is R/O when the appropriate file is created. For
mtd-ram test device it will be set RW by the fixup routine. I used
this to set the writebufsize to different values when working with
different UBIFS images. If I can set it dynamically, I do not need
to recompile the mtdram module or the kernel.

Anatolij

  reply	other threads:[~2011-02-11 15:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-11 11:46 [PATCH] mtd: export mtd->writebufsize attribute over sysfs Anatolij Gustschin
2011-02-11 15:09 ` Artem Bityutskiy
2011-02-11 15:35   ` Anatolij Gustschin [this message]
2011-02-14  9:15     ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110211163511.061d0f96@wker \
    --to=agust@denx.de \
    --cc=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.