Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2450278imm; Thu, 16 Aug 2018 09:46:18 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxfSGCGQo/xxlpDFuhxK/8pcu/YR5tbUgzrmoXETBh1djgO+qtOVMgkmq2z37EvAbPP75ab X-Received: by 2002:a63:4763:: with SMTP id w35-v6mr29624488pgk.140.1534437977938; Thu, 16 Aug 2018 09:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534437977; cv=none; d=google.com; s=arc-20160816; b=bMSCIisaiCo7577MCAPELWZIvGrttRz1A73Ukm2cI9iRspJyNUnA4q3hjUqNLgQK60 GUCVbtpIYcQZ0a/FWcimrPYPTMhDs+RBDTyjJFt0ychb/NNcnCOmk0Xv3melU4fyd8Yn UPJkKtmBLzPPzLD4p/kdKOELHEbVpwKHQyzFst43ntxAengo2brMxymAjMcKhz2BY8xp USTReJutqlOjbvMySZOgnhMnPnMEiCUtlfGmqzXhtKw6riYBIsUAwWwheETW/v+0z7+0 /NFbzzidn847PNNBJpZMhxKYoYQkzZ2EYvnZrbJb+leXT9vhGqSslvDlMnhGsp5AiEVZ x3IQ== 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=zDrBL0V7GTWX7tC/sxjWii/F3IqyGkzvYxSGu4+MAPk=; b=BYl1FCLYaQUjQBzoXtgHEVT5SGwmenMEXnfJ+klRXbjjGpPMxmET5XhcB0aLh0OT1A ZXfTUzeMwrO+ZYFUyL56pdgTeSNcW+nAGxFeBHKL+uQhu5g1qrZ7gXudIDdnqUErbgMV 0b83gE3mW9bodlQybc6ltMTfdfG5x8zlHvbQaUqSrMVxIrwt3A0qmYC1d5uiKTYav7Lo p1Brtn0rQrHS71i1csJAcLPywKtpghVtU6cHYnoW0MSNM1PGtsUvBl3akOkzyIXstGxb mdiyW2rFIZRaqeOt+TZi5r6vG0Xr+QESOrRTGJ5IMTHEaeDInUPft8NRA/Y6r8A3ENUv qGkQ== 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 e10-v6si27981212pge.48.2018.08.16.09.46.03; Thu, 16 Aug 2018 09:46:17 -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 S2390248AbeHPLnc (ORCPT + 99 others); Thu, 16 Aug 2018 07:43:32 -0400 Received: from mail.bootlin.com ([62.4.15.54]:51592 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731159AbeHPLmi (ORCPT ); Thu, 16 Aug 2018 07:42:38 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id D3934206A6; Thu, 16 Aug 2018 10:45:36 +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 (unknown [78.250.249.73]) by mail.bootlin.com (Postfix) with ESMTPSA id 7C2A820712; Thu, 16 Aug 2018 10:45:26 +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 v4 2/7] i2c: designware: move #ifdef CONFIG_OF to the top Date: Thu, 16 Aug 2018 10:45:16 +0200 Message-Id: <20180816084521.16289-3-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180816084521.16289-1-alexandre.belloni@bootlin.com> References: <20180816084521.16289-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. 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 d5936c32c075..776d4354f366 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -169,6 +169,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; @@ -403,14 +411,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