Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp594265imm; Fri, 31 Aug 2018 08:14:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdagY6VzhlOFOBH8tM8KFir1wUdxlHJviDIMAt/bSokHYwLt1KpUfs3dNz23RWSK+Ykh2jEy X-Received: by 2002:a65:6499:: with SMTP id e25-v6mr14266020pgv.224.1535728489340; Fri, 31 Aug 2018 08:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535728489; cv=none; d=google.com; s=arc-20160816; b=wOdqMzK0Pb211PLeiH3PExNRu8L81Czs+PIMTwTomgtU1E6uBkGS4ywLvzB0TQmNeo G8J25fcplBlFuv6rp1lDrKYoqdaNS3w7+sB5dicxKAoQWwE3QI/KgzpdtCM99pBsaxzw DkySYGtonGKhDzHpZhy5s9reK16CwVuKcNDH1zzE/Wa5mcrRE86Y5XDmIgYDnG5D8t2x HeIf5J6LGGDUAz6OxNj99AjMSBLuz2i5pWz+3K5dNspFII741qttBuIoHoCA+TRRVi4k GX3L/Ux64iwKli58HDogvNgXNqUdoW1/lPbshOaCLjR/drMp4hGqgityFHQrXGtTyAtI uSZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Tdv2t4X0DEQ04WN5BlUUpNYudWoNN85MfGuTC2p2to4=; b=fX2xi+9WEV8z14+kdlOb4i3HdhmfM8xiWB+dmqQy4Q9f77fYdcVSrmfBQZly6Xz4E1 NQhLoS5t5dyGFw2SBb6/FsK7Asx6//3KmnW5o0VBFd5EUAz6vHCXa53PpI3xDvpyRGyl IXPnY0xxj396pLFYWpTWZTXOmGJlSo4v1+sI8bfGVVF+/sy/Ru07JLBmNKi5V2fceM3c qHwzqrBlbxWsb2rSaJHftcbdKGvO/Rd90Cip8Ivsi8p+6jcc0vMBr09F0J7OoLoZ5SEy YyuJvblpFat6yDyalW9y9iIpiJMyJLGziISbq7MIRksfiGDq9bIhUnvyrVaX7Ps/A/mJ HUXA== 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 h2-v6si9932026pgk.330.2018.08.31.08.14.34; Fri, 31 Aug 2018 08:14:49 -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 S1728696AbeHaTTr (ORCPT + 99 others); Fri, 31 Aug 2018 15:19:47 -0400 Received: from mail.bootlin.com ([62.4.15.54]:46993 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727303AbeHaTTr (ORCPT ); Fri, 31 Aug 2018 15:19:47 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 9F61D207EB; Fri, 31 Aug 2018 17:11:50 +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 (242.171.71.37.rev.sfr.net [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id EE3A0215E6; Fri, 31 Aug 2018 17:11:27 +0200 (CEST) From: Alexandre Belloni To: Wolfram Sang , Jarkko Nikula , James Hogan , Paul Burton Cc: 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 v5 2/7] i2c: designware: move #ifdef CONFIG_OF to the top Date: Fri, 31 Aug 2018 17:11:09 +0200 Message-Id: <20180831151114.25739-3-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.19.0.rc1 In-Reply-To: <20180831151114.25739-1-alexandre.belloni@bootlin.com> References: <20180831151114.25739-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Tested-by: Jarkko Nikula Acked-by: Jarkko Nikula 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 72f403e75fa6..e88090a62cb5 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.19.0.rc1