From patchwork Wed May 26 17:44:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 448208 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp5443555jac; Wed, 26 May 2021 10:43:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4MtqnaCJAjPxONxhLJNLZMAPdlQ3YW2fvU8fOPjkGuRG5mNTACyt2G/MDZ/qIAxFJ1qb/ X-Received: by 2002:a05:6402:95d:: with SMTP id h29mr36924835edz.233.1622050989966; Wed, 26 May 2021 10:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622050989; cv=none; d=google.com; s=arc-20160816; b=Ox+pcC/+QVV//6GdtZYlg64pxQ72+DCgCL8V2IOmClExxm3ZNCJ+iLP3Ahy6j7rzNq SOsjMAOoGBLRmE8pOT4mLh9EHNIZJiFOz6aMblI02Eh+JB7qGaoao9zimt70xGDUfHKD obT2e9+GCZbiJ584qrv1gIZvCVR68W3etdq1pqM2+YxQChfjGxs4O+4Y2bBImBe//Dcu a7ALxyzAUSD3v+3jooKTARgdVHVlgFTzGDn7M6Hnm1gzvooT5wzLY0t78oftLl6w92Rr 37IiRKP0itaecJ8wnPrH7CXoxbiQI//h9PcvzIW1KLLFxb1EliBZj1aXfOhBZ0Gkj7E8 Atkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=bQAHNg4stnN6jub3Yz5fkbxYU5cgA+gHK+wVo2hzG9E=; b=mruhqxSg2/I31FBkWhp75m6d2EiqkntbWk+w7JLav5uxx2piLDw3YVwc8Ert4f/3Zd qjVY2KVlw10MBIj5AbAO+PjW2cxO3Q5eyJXmnZmZjZEC/7plo7Kv7hvEm7qknHTkRxXa yu6MVfUIE/yEtDmpX5oRQQEhr2yS736fuLE1B8/M6bMGK1jx9/UNPS8BAq3871S8rip8 luCMdkRfjWJ7CpoO3mIkp0QNTlkUGuk/V7v0FvTazYYrPfUVdIuDaUIYuwg85gih6CMf Johto0C1s3zaYLxiBkg1TIBX39JyiQ9ebL2wy5b/P7s9Wd9oeS8ciiTnVyNJ8qfLPzZB mjYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gh0eIEbd; spf=pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hq40si15166ejc.161.2021.05.26.10.43.09; Wed, 26 May 2021 10:43:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gh0eIEbd; spf=pass (google.com: domain of linux-i2c-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234647AbhEZRoj (ORCPT + 2 others); Wed, 26 May 2021 13:44:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:55982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234719AbhEZRoi (ORCPT ); Wed, 26 May 2021 13:44:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6EF87613CA; Wed, 26 May 2021 17:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622050986; bh=L6ZERcFQRXFY5Eq7IrI3ZVK644fnEzuNtIKVNiqxfeA=; h=From:To:Cc:Subject:Date:From; b=Gh0eIEbd6lct5+00t17BNo12UZUD1H4HQEJ+rnY7PS9PGAarxK/W2fTwzVr+vMy54 paLxKy/5uR3kJwNxlgDCc+aXO5UUA+1ksq0/8qX0HBn0CyKuULqlDbn038wv3D/a3d iErpZGk4ZdxsSlHmD/ikNzN/ePLSXFz6Yiav5WKwONd7BgiRPboUfdZra8/Cxivbpv UwLXyg35FHEwu2SpL98FQi1CwLgsV/70FIumROHu87asORXrCUogiDlFkltmI5jdpU RmfNiiBU7Nyks239wTiaqcwdqxNS3kAN4y1lSY5MImZl4rqM3UanQR2jS0xAosmAq2 PTSl+hbMfiniw== From: Jonathan Cameron To: linux-iio@vger.kernel.org, linux-i2c@vger.kernel.org Cc: Jonathan Cameron , Tom Rix , Sean Nyekjaer , Wolfram Sang Subject: [PATCH] i2c: core: Add stub for i2c_verify_client() if !CONFIG_I2C Date: Wed, 26 May 2021 18:44:36 +0100 Message-Id: <20210526174436.2208277-1-jic23@kernel.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org From: Jonathan Cameron If I2C is not compiled, there is no way we should see a call to i2c_verify_client() on a device that is an i2c client. As such, provide a stub to return NULL to resolve an associated build failure. The build is failing with this link error ld: fxls8962af-core.o: in function `fxls8962af_fifo_transfer': fxls8962af-core.c: undefined reference to `i2c_verify_client' Reported-by: Tom Rix Signed-off-by: Jonathan Cameron Fixes: 68068fad0e1c ("iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads") Cc: Sean Nyekjaer Cc: Wolfram Sang --- Note the broken patch is only in the IIO/togreg branch at the moment. include/linux/i2c.h | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.31.1 Reviewed-by: Sean Nyekjaer diff --git a/include/linux/i2c.h b/include/linux/i2c.h index e8f2ac8c9c3d..aa52738b9c46 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -343,7 +343,14 @@ struct i2c_client { }; #define to_i2c_client(d) container_of(d, struct i2c_client, dev) +#if IS_ENABLED(CONFIG_I2C) struct i2c_client *i2c_verify_client(struct device *dev); +#else +static inline struct i2c_client *i2c_verify_client(struct device *dev) +{ + return NULL; +} +#endif struct i2c_adapter *i2c_verify_adapter(struct device *dev); const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id, const struct i2c_client *client);