projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[adm5120] fix an unbalanced spinlock issue
[openwrt.git]
/
target
/
linux
/
adm5120
/
files
/
drivers
/
mtd
/
trxsplit.c
diff --git
a/target/linux/adm5120/files/drivers/mtd/trxsplit.c
b/target/linux/adm5120/files/drivers/mtd/trxsplit.c
index
19d1e9d
..
caf6b76
100644
(file)
--- a/
target/linux/adm5120/files/drivers/mtd/trxsplit.c
+++ b/
target/linux/adm5120/files/drivers/mtd/trxsplit.c
@@
-51,7
+51,7
@@
struct trx_header {
u32 offsets[TRX_MAX_OFFSET]; /* Offsets of partitions */
};
u32 offsets[TRX_MAX_OFFSET]; /* Offsets of partitions */
};
-#define
BLOCK_LEN_MIN 0x10
000
+#define
TRX_ALIGN 0x1
000
static int trx_nr_parts;
static unsigned long trx_offset;
static int trx_nr_parts;
static unsigned long trx_offset;
@@
-104,17
+104,12
@@
err_out:
static void trxsplit_findtrx(struct mtd_info *mtd)
{
unsigned long offset;
static void trxsplit_findtrx(struct mtd_info *mtd)
{
unsigned long offset;
- unsigned long blocklen;
int err;
int err;
- blocklen = mtd->erasesize;
- if (blocklen < BLOCK_LEN_MIN)
- blocklen = BLOCK_LEN_MIN;
-
printk(KERN_INFO PFX "searching TRX header in '%s'\n", mtd->name);
err = 0;
printk(KERN_INFO PFX "searching TRX header in '%s'\n", mtd->name);
err = 0;
- for (offset = 0; offset < mtd->size; offset +=
blocklen
) {
+ for (offset = 0; offset < mtd->size; offset +=
TRX_ALIGN
) {
err = trxsplit_checktrx(mtd, offset);
if (err == 0)
break;
err = trxsplit_checktrx(mtd, offset);
if (err == 0)
break;
@@
-192,6
+187,12
@@
err:
static void __init trxsplit_add_mtd(struct mtd_info *mtd)
{
static void __init trxsplit_add_mtd(struct mtd_info *mtd)
{
+ if (mtd->type != MTD_NORFLASH) {
+ printk(KERN_INFO PFX "'%s' is not a NOR flash, skipped\n",
+ mtd->name);
+ return;
+ }
+
if (!trx_mtd)
trxsplit_findtrx(mtd);
}
if (!trx_mtd)
trxsplit_findtrx(mtd);
}
This page took
0.024454 seconds
and
4
git commands to generate.