[ixp4xx] add inital support for the kendin switch on the gtwx5717 board
[openwrt.git] / target / linux / brcm63xx / patches-2.6.25 / 110-bcm963xx_fix_cfe_detection.patch
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
5
6 The CFE detection failed to account for zero termination.
7
8 Signed-off-by: Axel Gembe <ago@bastart.eu.org>
9 ---
10 drivers/mtd/maps/bcm963xx-flash.c | 11 ++++++-----
11 1 files changed, 6 insertions(+), 5 deletions(-)
12
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
17 @@ -1,8 +1,7 @@
18 /*
19 - * $Id$
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>
25 *
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)
30 {
31 int idoffset = 0x4e0;
32 - static char idstring[8] = "CFE1CFE1";
33 - char buf[8];
34 + static char idstring[9] = "CFE1CFE1";
35 + char buf[9];
36 int ret;
37 size_t retlen;
38
39 + memset(buf, 0, sizeof(buf));
40 +
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);
This page took 0.040425 seconds and 5 git commands to generate.