From patchwork Mon Oct 26 10:08:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 55847 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9QADrka006509 for ; Mon, 26 Oct 2009 10:13:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755492AbZJZKNs (ORCPT ); Mon, 26 Oct 2009 06:13:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755500AbZJZKNr (ORCPT ); Mon, 26 Oct 2009 06:13:47 -0400 Received: from mail-yx0-f187.google.com ([209.85.210.187]:63632 "EHLO mail-yx0-f187.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755492AbZJZKNr (ORCPT ); Mon, 26 Oct 2009 06:13:47 -0400 Received: by yxe17 with SMTP id 17so9617784yxe.33 for ; Mon, 26 Oct 2009 03:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=ubBjbPiCl+1uM8btAHK7qwZAVpHaakogWeaQpcOU/T8=; b=SI0O2ZVCUOAFqd1tpdkj3y2DbjndcV0rZKUAkpOi6UmZfW75gDUt6sTVcnKzFWOxHS 3Umeq+8l33i7FQuzlQxsrdHOwQr9wuv2cHEWXnSgJRoFM/wi1jZv2IF4jNYCl+VX4+qL Idb26Jcoquj2mFpMNVbyThkNeNAAR8GcPYAiU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=vMysoQlwKWMeruyBgCTnv0TZYcAbALKEhLbN4Dvewnb5n5rNpJVOvMupwQMaz6A+/D 4pQSF9GsrViEP2rTaUUbF3WbG6fXMoFV3+Ojvx6F5PlvyPMUcGcPRKjsimyYa0YCqUob vMnYnHKxBEc9YLSszTdUsWvi6OkF+zXTSdOkQ= Received: by 10.150.130.39 with SMTP id c39mr23499485ybd.338.1256552031795; Mon, 26 Oct 2009 03:13:51 -0700 (PDT) Received: from rxone.opensource.se (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 6sm1014081ywd.37.2009.10.26.03.13.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Oct 2009 03:13:50 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org Date: Mon, 26 Oct 2009 19:08:55 +0900 Message-Id: <20091026100855.13528.68879.sendpatchset@rxone.opensource.se> Subject: [PATCH] sh: rsk7203 CONFIG_MTD=n fix Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org --- 0001/arch/sh/boards/mach-rsk/devices-rsk7203.c +++ work/arch/sh/boards/mach-rsk/devices-rsk7203.c 2009-10-26 12:32:26.000000000 +0900 @@ -11,10 +11,6 @@ #include #include #include -#include -#include -#include -#include #include #include #include --- 0001/arch/sh/boards/mach-rsk/setup.c +++ work/arch/sh/boards/mach-rsk/setup.c 2009-10-26 12:02:16.000000000 +0900 @@ -15,14 +15,12 @@ #include #include #include +#ifdef CONFIG_MTD #include +#endif #include #include -static const char *probes[] = { "cmdlinepart", NULL }; - -static struct mtd_partition *parsed_partitions; - static struct mtd_partition rsk_partitions[] = { { .name = "Bootloader", @@ -41,6 +39,8 @@ static struct mtd_partition rsk_partitio }; static struct physmap_flash_data flash_data = { + .parts = rsk_partitions, + .nr_parts = ARRAY_SIZE(rsk_partitions), .width = 2, }; @@ -60,7 +60,8 @@ static struct platform_device flash_devi }, }; -static struct mtd_info *flash_mtd; +#ifdef CONFIG_MTD +static const char *probes[] = { "cmdlinepart", NULL }; static struct map_info rsk_flash_map = { .name = "RSK+ Flash", @@ -68,6 +69,10 @@ static struct map_info rsk_flash_map = { .bankwidth = 2, }; +static struct mtd_info *flash_mtd; + +static struct mtd_partition *parsed_partitions; + static void __init set_mtd_partitions(void) { int nr_parts = 0; @@ -77,14 +82,14 @@ static void __init set_mtd_partitions(vo nr_parts = parse_mtd_partitions(flash_mtd, probes, &parsed_partitions, 0); /* If there is no partition table, used the hard coded table */ - if (nr_parts <= 0) { - flash_data.parts = rsk_partitions; - flash_data.nr_parts = ARRAY_SIZE(rsk_partitions); - } else { + if (nr_parts > 0) { flash_data.nr_parts = nr_parts; flash_data.parts = parsed_partitions; } } +#else +static inline void set_mtd_partitions(void) {} +#endif static struct platform_device *rsk_devices[] __initdata = { &flash_device,