lkml.org 
[lkml]   [2010]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] MTD: cfi_cmdset_0002: Add reboot notifier for AMD flashes
From
Date
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 (Артём Битюцкий)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-04-14 07:01    [W:0.092 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site