From patchwork Thu Nov 1 23:55:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jamie Lentin X-Patchwork-Id: 1686931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 0CBBB3FE1F for ; Thu, 1 Nov 2012 23:59:14 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TU4bu-0001BD-MJ; Thu, 01 Nov 2012 23:55:42 +0000 Received: from marmot.wormnet.eu ([2a03:9800:10:2d:3203:b3a5:8bdc:5b68]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TU4bq-0001Aw-Vk for linux-arm-kernel@lists.infradead.org; Thu, 01 Nov 2012 23:55:40 +0000 Received: from mijo.vandergast.wormnet.eu ([80.229.158.163] helo=bunsen.vandergast.wormnet.eu) by marmot.wormnet.eu with esmtpa (Exim 4.80) (envelope-from ) id 1TU4bh-0001Tb-3I; Thu, 01 Nov 2012 23:55:29 +0000 From: Jamie Lentin To: Fengguang Wu , Guenter Roeck , Andrew Lunn , Jason Cooper , Thierry Reding , Linus Walleij Subject: [PATCH] hwmon: Only include of_match_table with CONFIG_OF_GPIO Date: Thu, 1 Nov 2012 23:55:43 +0000 Message-Id: <1351814143-13714-1-git-send-email-jm@lentin.co.uk> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121101_195539_192205_292B1811 X-CRM114-Status: UNSURE ( 8.65 ) X-CRM114-Notice: Please train this message. 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 ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Jamie Lentin , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The following fixes build errors on sparc. Without any DT support, of_match_ptr is NULL and the below is a no-op. However, if just CONFIG_OF is defined then so is of_match_ptr. All useful parts of the gpio-fan DT support rely on CONFIG_OF_GPIO anyway, so of_match_table should too. Signed-off-by: Jamie Lentin --- drivers/hwmon/gpio-fan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index 36509ae..1381a2e 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c @@ -630,7 +630,9 @@ static struct platform_driver gpio_fan_driver = { .driver = { .name = "gpio-fan", .pm = GPIO_FAN_PM, +#ifdef CONFIG_OF_GPIO .of_match_table = of_match_ptr(of_gpio_fan_match), +#endif }, };