From: Artem Bityutskiy <dedekind1@gmail.com>
To: Kevin Cernekee <cernekee@gmail.com>
Cc: saeed.bishara@gmail.com, dwmw2@infradead.org,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org
Subject: Re: [PATCH 1/2] MTD: cfi_cmdset_0002: Add reboot notifier for AMD flashes
Date: Wed, 14 Apr 2010 07:57:58 +0300 [thread overview]
Message-ID: <1271221078.2532.5.camel@localhost.localdomain> (raw)
In-Reply-To: <bb2e763d69a8cc1576fd58fbde424ff5f688c409@localhost.localdomain>
On Tue, 2010-04-13 at 13:30 -0700, Kevin Cernekee wrote:
> +static int cfi_amdstd_reset(struct mtd_info *mtd)
> +{
> + struct map_info *map = mtd->priv;
> + struct cfi_private *cfi = map->fldrv_priv;
> + int i, ret;
> + struct flchip *chip;
> +
> + for (i = 0; i < cfi->numchips; i++) {
> +
> + chip = &cfi->chips[i];
> +
> + spin_lock(chip->mutex);
> +
> + ret = get_chip(map, chip, chip->start, FL_SHUTDOWN);
> + if (!ret) {
> + map_write(map, CMD(0xF0), chip->start);
> + chip->state = FL_SHUTDOWN;
> + put_chip(map, chip, chip->start);
> + }
> +
> + spin_unlock(chip->mutex);
> + }
> +
> + return 0;
> +}
Kevin, I'd suggest to document why you do this in the code, just for the
next generation, or for the archaeologists who will dig MTD code in the
future.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
next prev parent reply other threads:[~2010-04-14 4:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-13 20:30 [PATCH 0/2] MTD: Move reboot notifier from UBI to cfi_cmdset_0002 Kevin Cernekee
2010-04-13 20:30 ` [PATCH 1/2] MTD: cfi_cmdset_0002: Add reboot notifier for AMD flashes Kevin Cernekee
2010-04-14 4:57 ` Artem Bityutskiy [this message]
2010-04-14 5:33 ` Fabio Giovagnini
2010-04-15 0:57 ` [PATCHv2 " Kevin Cernekee
2010-04-15 2:53 ` Wolfram Sang
2010-04-27 13:47 ` Jamie Lokier
2010-04-27 13:07 ` Artem Bityutskiy
2010-04-13 20:30 ` [PATCH 2/2] UBI: Remove reboot notifier Kevin Cernekee
2010-04-27 13:25 ` 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=1271221078.2532.5.camel@localhost.localdomain \
--to=dedekind1@gmail.com \
--cc=cernekee@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=saeed.bishara@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).