From patchwork Fri Dec 12 16:00:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Klauser X-Patchwork-Id: 420540 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BEB201400E9 for ; Sat, 13 Dec 2014 03:00:31 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933967AbaLLQA1 (ORCPT ); Fri, 12 Dec 2014 11:00:27 -0500 Received: from mail.zhinst.com ([212.126.164.98]:58694 "EHLO mail.zhinst.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753665AbaLLQA0 (ORCPT ); Fri, 12 Dec 2014 11:00:26 -0500 Received: from ziws06.zhinst.com ([10.42.0.71]) by mail.zhinst.com (Kerio Connect 8.4.0); Fri, 12 Dec 2014 17:00:22 +0100 From: Tobias Klauser To: Nicolas Pitre Cc: "David S. Miller" , Tony Lindgren , netdev@vger.kernel.org Subject: [PATCH net] net: smc91x: Fix build without gpiolib Date: Fri, 12 Dec 2014 17:00:22 +0100 Message-Id: <1418400022-6264-1-git-send-email-tklauser@distanz.ch> X-Mailer: git-send-email 2.2.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If GPIOLIB=n the following build error occurs: Since the toggling of the GPIOs is an optional feature, define try_toggle_control_gpio only if GPIOLIB is enabled. Fixes: 7d2911c4381 ("net: smc91x: Fix gpios for device tree based booting") Signed-off-by: Tobias Klauser --- drivers/net/ethernet/smsc/smc91x.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c index 6cc3cf6..050bcb6 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c @@ -2193,6 +2193,7 @@ MODULE_DEVICE_TABLE(of, smc91x_match); /** * of_try_set_control_gpio - configure a gpio if it exists */ +#ifdef CONFIG_GPIOLIB static int try_toggle_control_gpio(struct device *dev, struct gpio_desc **desc, const char *name, int index, @@ -2224,7 +2225,16 @@ static int try_toggle_control_gpio(struct device *dev, return 0; } -#endif +#else +static int try_toggle_control_gpio(struct device *dev, + struct gpio_desc **desc, + const char *name, int index, + int value, unsigned int nsdelay) +{ + return 0; +} +#endif /* CONFIG_GPIOLIB */ +#endif /* CONFIG_OF */ /* * smc_init(void)