From 47d7660aee2aae37fb604bd7219d764cad0a2ed0 Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Fri, 13 Jul 2012 14:28:42 -0500 Subject: [PATCH] --- yaml --- r: 320436 b: refs/heads/master c: 6269f2584a359766f53005c676daff8aee60cbed h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/powerpc/platforms/85xx/p1022_ds.c | 58 +++++++++++++------- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/[refs] b/[refs] index 993c52e5dae4..942fe02dd3ad 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 163f22dc9615e6bc446f50a626af7362cd269876 +refs/heads/master: 6269f2584a359766f53005c676daff8aee60cbed diff --git a/trunk/arch/powerpc/platforms/85xx/p1022_ds.c b/trunk/arch/powerpc/platforms/85xx/p1022_ds.c index 89ee02c54561..5ca2823ab7f2 100644 --- a/trunk/arch/powerpc/platforms/85xx/p1022_ds.c +++ b/trunk/arch/powerpc/platforms/85xx/p1022_ds.c @@ -419,18 +419,6 @@ void __init p1022_ds_pic_init(void) #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) -/* - * Disables a node in the device tree. - * - * This function is called before kmalloc() is available, so the 'new' object - * should be allocated in the global area. The easiest way is to do that is - * to allocate one static local variable for each call to this function. - */ -static void __init disable_one_node(struct device_node *np, struct property *new) -{ - prom_update_property(np, new); -} - /* TRUE if there is a "video=fslfb" command-line parameter. */ static bool fslfb; @@ -493,28 +481,58 @@ static void __init p1022_ds_setup_arch(void) diu_ops.valid_monitor_port = p1022ds_valid_monitor_port; /* - * Disable the NOR flash node if there is video=fslfb... command-line - * parameter. When the DIU is active, NOR flash is unavailable, so we - * have to disable the node before the MTD driver loads. + * Disable the NOR and NAND flash nodes if there is video=fslfb... + * command-line parameter. When the DIU is active, the localbus is + * unavailable, so we have to disable these nodes before the MTD + * driver loads. */ if (fslfb) { struct device_node *np = of_find_compatible_node(NULL, NULL, "fsl,p1022-elbc"); if (np) { - np = of_find_compatible_node(np, NULL, "cfi-flash"); - if (np) { + struct device_node *np2; + + of_node_get(np); + np2 = of_find_compatible_node(np, NULL, "cfi-flash"); + if (np2) { static struct property nor_status = { .name = "status", .value = "disabled", .length = sizeof("disabled"), }; + /* + * prom_update_property() is called before + * kmalloc() is available, so the 'new' object + * should be allocated in the global area. + * The easiest way is to do that is to + * allocate one static local variable for each + * call to this function. + */ + pr_info("p1022ds: disabling %s node", + np2->full_name); + prom_update_property(np2, &nor_status); + of_node_put(np2); + } + + of_node_get(np); + np2 = of_find_compatible_node(np, NULL, + "fsl,elbc-fcm-nand"); + if (np2) { + static struct property nand_status = { + .name = "status", + .value = "disabled", + .length = sizeof("disabled"), + }; + pr_info("p1022ds: disabling %s node", - np->full_name); - disable_one_node(np, &nor_status); - of_node_put(np); + np2->full_name); + prom_update_property(np2, &nand_status); + of_node_put(np2); } + + of_node_put(np); } }