Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3865439imm; Mon, 6 Aug 2018 11:56:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd80f7466UDzI//GOPTqji9wZU06c1ggitFWnE4UbWQU4nFVlrCI8jDKqmwKkFJ3Z4GFlMU X-Received: by 2002:a17:902:7446:: with SMTP id e6-v6mr15183109plt.161.1533581796106; Mon, 06 Aug 2018 11:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533581796; cv=none; d=google.com; s=arc-20160816; b=f7fXq1YbTFYXGOVO3M3+TPeeNgA7XsATZNegVMZy+mBqgihRIdaoH1gUPhQecKt1h/ jKaPUF8Jp8l+1s+QbMBAYwRWUD2TLgGyBC6yPHYvqNdDNP2NvgjPkhnEFd8dU/DanbJO gJDx4nEJxo4ZnfnRSYCv78KEXzc022Bnc8NJ04s8ZTFV+XVcElWJ/EvLF+EDL4q9oqad 8Kjwm83BcRKSOJq8Y9V9jb7fRJR48RfXlu2+rCoD06qN/WA4/bzlqooUrzKbWln0Bs0O xqPXSqWBqJwC9x5eE1sGE5hlklcD3e5dBvhhE5lYtS2tCW/NEbag3vfkIonLbckglL9W DF9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=LKt42WSPDOSm2XHo4NnO3dpytZrwFdInS+1JEZnV0Mo=; b=xSBkP8VCrL/l8b3l/d8Z4iWRXkGwnV6Rrfvn+cYcDSPTcVNLlFjySyPJaRScnSbfDr eXDS/T4IOwC9m8YhZZ/h86FW91lXAXB1ZF1zxlHrCVaJQEgGy4Mj8svH9zwEFNEfNnle gCJmlxacGlOqL7a4x59yD73KlArCPMTuNLraitHn6pEPx23tN0L2osJY58jGtsXgA29S ilR7ZGE1UAvBUufR7svgmierIfJuW0Fl1hdOUyP30vgkV2UZhIOHu0sKPFxaWYrHd9fE Ogerih8acHP/QRnfoVwguldF1qXhyeNRt56Td3tewA5m7jr/NJ2zeKZ/pTl81iDtBi6D MZ/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26-v6si13245764pgo.169.2018.08.06.11.56.21; Mon, 06 Aug 2018 11:56:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732862AbeHFVEn (ORCPT + 99 others); Mon, 6 Aug 2018 17:04:43 -0400 Received: from mail.bootlin.com ([62.4.15.54]:37131 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728948AbeHFVEn (ORCPT ); Mon, 6 Aug 2018 17:04:43 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 042A7207D4; Mon, 6 Aug 2018 20:54:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LPuteaux-656-1-243-71.w82-127.abo.wanadoo.fr [82.127.120.71]) by mail.bootlin.com (Postfix) with ESMTPSA id B4F9A2072D; Mon, 6 Aug 2018 20:54:14 +0200 (CEST) From: Alexandre Belloni To: Wolfram Sang , Jarkko Nikula , James Hogan Cc: Paul Burton , Andy Shevchenko , Mika Westerberg , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Thomas Petazzoni , Allan Nielsen , Alexandre Belloni Subject: [PATCH v3 2/6] i2c: designware: move #ifdef CONFIG_OF to the top Date: Mon, 6 Aug 2018 20:54:08 +0200 Message-Id: <20180806185412.7210-3-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180806185412.7210-1-alexandre.belloni@bootlin.com> References: <20180806185412.7210-1-alexandre.belloni@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the #ifdef CONFIG_OF section to the top of the file, after the ACPI section so functions defined there can be used in dw_i2c_plat_probe. Reviewed-by: Andy Shevchenko Signed-off-by: Alexandre Belloni --- drivers/i2c/busses/i2c-designware-platdrv.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index d117c120730d..1bcaab777a2e 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -156,6 +156,14 @@ static inline int dw_i2c_acpi_configure(struct platform_device *pdev) } #endif +#ifdef CONFIG_OF +static const struct of_device_id dw_i2c_of_match[] = { + { .compatible = "snps,designware-i2c", }, + {}, +}; +MODULE_DEVICE_TABLE(of, dw_i2c_of_match); +#endif + static void i2c_dw_configure_master(struct dw_i2c_dev *dev) { struct i2c_timings *t = &dev->timings; @@ -390,14 +398,6 @@ static int dw_i2c_plat_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_OF -static const struct of_device_id dw_i2c_of_match[] = { - { .compatible = "snps,designware-i2c", }, - {}, -}; -MODULE_DEVICE_TABLE(of, dw_i2c_of_match); -#endif - #ifdef CONFIG_PM_SLEEP static int dw_i2c_plat_prepare(struct device *dev) { -- 2.18.0