From patchwork Mon May 6 07:15:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 2522971 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 2EA9BDF230 for ; Mon, 6 May 2013 07:16:21 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UZFeN-0000Ry-IO; Mon, 06 May 2013 07:15:55 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UZFe7-0007jK-2q; Mon, 06 May 2013 07:15:39 +0000 Received: from mail-da0-x235.google.com ([2607:f8b0:400e:c00::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UZFe4-0007hW-Vo for linux-arm-kernel@lists.infradead.org; Mon, 06 May 2013 07:15:37 +0000 Received: by mail-da0-f53.google.com with SMTP id o9so1673499dan.26 for ; Mon, 06 May 2013 00:15:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:subject:from:to:cc:date:content-type:x-mailer :mime-version:content-transfer-encoding:x-gm-message-state; bh=K3Z5esrLXbGmijepk2s9MMz8qsMg8XMh3uoGWFIcYSU=; b=Po2xqpsXn2u3zwjqHRdIgqHdmz26H4/87K7wquvVjonNOxqWFwE0MyZbiNalL944DB YP2Ryyv978iRWTqNSl0iaD/M5i54igi0uM83kWY/lyK+ehD1DgE8uYgPW534zF3zyQcb qyQ2FiNqK+KYet/lBxGizMLYjW4N+P0CMTQiz8WGXogBwX/amQqSR8r9h+c5ma6nfODM 4pbG7CUlLGyd6yqGyHdY/2PMGUZ49px6FDHLJRkiEv13svx1r1U3aa8KEQyCvUUISofx /opM73JpK0emtXg2Ws/Ug85piqXMiUG+Oxtm0vsTv5Vd+1fP99dO6/p4Y30qugAiPa49 plzQ== X-Received: by 10.66.161.33 with SMTP id xp1mr25820245pab.36.1367824512140; Mon, 06 May 2013 00:15:12 -0700 (PDT) Received: from [192.168.0.102] (114-39-107-91.dynamic.hinet.net. [114.39.107.91]) by mx.google.com with ESMTPSA id wl5sm24573829pac.18.2013.05.06.00.15.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 May 2013 00:15:11 -0700 (PDT) Message-ID: <1367824503.6190.1.camel@phoenix> Subject: [PATCH] ARM: U300: Add proper ifdef guard to fix build error when CONFIG_I2C_STU300=m From: Axel Lin To: Linus Walleij Date: Mon, 06 May 2013 15:15:03 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 X-Gm-Message-State: ALoCoQlZKca5xWBQp/r34DOnM6jCunve/ZW0RLlGYIANagLD+zL1ip0Ff61nygUKoJQNxzpopPVW X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130506_031537_099239_43501944 X-CRM114-Status: GOOD ( 12.42 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org I got below build error if CONFIG_I2C_STU300=m. ERROR: "i2c_register_board_info" [arch/arm/mach-u300/i2c.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 Fix it by adding proper ifdef guard in i2c.h and Makefile. So arch/arm/mach-u300/i2c.c will be compiled when CONFIG_I2C_STU300 is configured as built-in or as a module. Signed-off-by: Axel Lin --- arch/arm/mach-u300/Makefile | 4 +++- arch/arm/mach-u300/i2c.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-u300/Makefile b/arch/arm/mach-u300/Makefile index 5a86c58..f612d17 100644 --- a/arch/arm/mach-u300/Makefile +++ b/arch/arm/mach-u300/Makefile @@ -9,5 +9,7 @@ obj- := obj-$(CONFIG_SPI_PL022) += spi.o obj-$(CONFIG_MACH_U300_SPIDUMMY) += dummyspichip.o -obj-$(CONFIG_I2C_STU300) += i2c.o +ifneq ($(CONFIG_I2C_STU300),) +obj-y += i2c.o +endif obj-$(CONFIG_REGULATOR_AB3100) += regulator.o diff --git a/arch/arm/mach-u300/i2c.h b/arch/arm/mach-u300/i2c.h index 485c02e..9eec276 100644 --- a/arch/arm/mach-u300/i2c.h +++ b/arch/arm/mach-u300/i2c.h @@ -11,7 +11,7 @@ #ifndef MACH_U300_I2C_H #define MACH_U300_I2C_H -#ifdef CONFIG_I2C_STU300 +#if IS_ENABLED(ISCONFIG_I2C_STU300) void __init u300_i2c_register_board_devices(void); #else /* Compile out this stuff if no I2C adapter is available */