diff options
author | David Brownell <david-b@pacbell.net> | 2006-01-08 13:34:29 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-13 16:29:56 -0800 |
commit | 7111763d391b0c5a949a4f2575aa88cd585f0ff6 (patch) | |
tree | 376eef5003b71c6445c02bbe87950b2e365e0758 /drivers/mtd/devices | |
parent | 8275c642ccdce09a2146d0a9eb022e3698ee927e (diff) | |
download | kernel_samsung_smdk4412-7111763d391b0c5a949a4f2575aa88cd585f0ff6.zip kernel_samsung_smdk4412-7111763d391b0c5a949a4f2575aa88cd585f0ff6.tar.gz kernel_samsung_smdk4412-7111763d391b0c5a949a4f2575aa88cd585f0ff6.tar.bz2 |
[PATCH] spi: misc fixes
This collects some small SPI patches that seem to be missing from the MM tree:
- spi_butterfly kbuild hooks got dropped somehow; this restores them
- quick fix for a (theoretical?) m25p80_write() oops noted by Andrew
- quick fix for a potential config-specific oops for mtd_dataflash()
- minor doc tweaks
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r-- | drivers/mtd/devices/m25p80.c | 4 | ||||
-rw-r--r-- | drivers/mtd/devices/mtd_dataflash.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 45108ed..d5f2408 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -378,7 +378,9 @@ static int m25p80_write(struct mtd_info *mtd, loff_t to, size_t len, spi_sync(flash->spi, &m); - *retlen += m.actual_length - sizeof(flash->command); + if (retlen) + *retlen += m.actual_length + - sizeof(flash->command); } } diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 99d3a03..155737e 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c @@ -508,7 +508,7 @@ add_dataflash(struct spi_device *spi, char *name, priv->partitioned = 1; return add_mtd_partitions(device, parts, nr_parts); } - } else if (pdata->nr_parts) + } else if (pdata && pdata->nr_parts) dev_warn(&spi->dev, "ignoring %d default partitions on %s\n", pdata->nr_parts, device->name); |