1 From f1a605c36cf1659f5f486ae4135de1e285fdf86c Mon Sep 17 00:00:00 2001
2 From: Axel Gembe <ago@bastart.eu.org>
3 Date: Sat, 17 May 2008 16:17:22 +0200
4 Subject: [PATCH] bcm963xx: fix cfe detection
6 The CFE detection failed to account for zero termination.
8 Signed-off-by: Axel Gembe <ago@bastart.eu.org>
10 drivers/mtd/maps/bcm963xx-flash.c | 11 ++++++-----
11 1 files changed, 6 insertions(+), 5 deletions(-)
13 Index: linux-2.6.25.4/drivers/mtd/maps/bcm963xx-flash.c
14 ===================================================================
15 --- linux-2.6.25.4.orig/drivers/mtd/maps/bcm963xx-flash.c
16 +++ linux-2.6.25.4/drivers/mtd/maps/bcm963xx-flash.c
20 * Copyright (C) 2006 Florian Fainelli <florian@openwrt.org>
21 - * Mike Albon <malbon@openwrt.org>
22 - * Copyright (C) $Date$ $Author$
23 + * Mike Albon <malbon@openwrt.org>
24 + * Copyright (C) 2008 Axel Gembe <ago@bastart.eu.org>
26 * This program is free software; you can redistribute it and/or modify
27 * it under the terms of the GNU General Public License as published by
28 @@ -184,11 +183,13 @@ static int bcm963xx_parts_size = sizeof(
29 static int bcm963xx_detect_cfe(struct mtd_info *master)
32 - static char idstring[8] = "CFE1CFE1";
34 + static char idstring[9] = "CFE1CFE1";
39 + memset(buf, 0, sizeof(buf));
41 ret = master->read(master, idoffset, 8, &retlen, (void *)buf);
42 printk("bcm963xx: Read Signature value of %s\n", buf);
43 return strcmp(idstring,buf);