Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1402201pxj; Fri, 21 May 2021 13:22:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3bymnCNYMyD/8woON4lUy+YjTDSlB2qsnU0PE6xXOZLaazpX/r92Y8Cq9zz7IbZWuznK2 X-Received: by 2002:a92:6902:: with SMTP id e2mr691800ilc.172.1621628557579; Fri, 21 May 2021 13:22:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628557; cv=none; d=google.com; s=arc-20160816; b=xxz3WnC1h07RzDqruu9KzbjIHKbj2fVBBMvk810iMceyXFAGHPy0NlJNstivCsiipB JGQKWM2onbr2ZsppGiXTLOT3D5nm+58RCarDqEEHJpAEETC4mtiYvYVIgLmm7ho340qB kdakZu/AdM44aNELhNeIBM+P+Off23xoiBKsF+21ilyyTYaioIreEaTffzeamF15j4Bj SzIOG/R6yBbnUu0GDKXXq1zhQ1+PCYJT7V/ErqKithHT69lbmZITw1tZGV2jveFWPaHK qDQw3qaVtQLECDn+oe08mq+HZTFurDSmznn6DCB0v6zhyLd/uaJ0d8HqZs2j365BPL5B m0fA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=+Try46/+8suiTR5PJRPYPieab32qmdYPBuPn7zuKzPg=; b=f94aS2jnu8DQZtAZPwmSfkE735QozwNbqgWwhcdBayki19sazrVpneQ60F+QxMns7z oAxcSwkFelcoY5NBlaljZ3gchVV/i77ZZTTKkjgAzmdhvla40DgPbsJ3ifI1iJ7UNxvZ jeIqSXWCt9Zdk9ZitsMRS6SUkxmuMLkZTEN15o0TI5wmD/BNqOg+nmx9jz8z35CJKeHe qR84QCcAcUZaLZpEqBUd77A8tHr0DbOIN0cOIZNOJO69g25jj8ttkCppcaH/Zse9QpRa PJVBoTqFipdQ5J8tmi2FcWQVt3VKUlXieWOHgMhUaFbSeUKsdJTr+uu1Rjfp5VQarwEK T30A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 z13si6046481ioj.76.2021.05.21.13.22.24; Fri, 21 May 2021 13:22:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S237757AbhEUQyM (ORCPT + 99 others); Fri, 21 May 2021 12:54:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:41480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230471AbhEUQyL (ORCPT ); Fri, 21 May 2021 12:54:11 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 436A261073; Fri, 21 May 2021 16:52:46 +0000 (UTC) Date: Fri, 21 May 2021 17:54:06 +0100 From: Jonathan Cameron To: Sean Nyekjaer Cc: trix@redhat.com, lars@metafoo.de, andy.shevchenko@gmail.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , linux-i2c@vger.kernel.org Subject: Re: [PATCH] iio: accel: fxls8962af: conditionally compile fxls8962af_i2c_raw_read_errata3() Message-ID: <20210521175406.274f713b@jic23-huawei> In-Reply-To: References: <20210518234828.1930387-1-trix@redhat.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 May 2021 07:37:16 +0200 Sean Nyekjaer wrote: > On 19/05/2021 01.48, trix@redhat.com wrote: > > From: Tom Rix > > > > 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' > > > > This is needed for the i2c variant, not the spi variant. So > > conditionally compile based on CONFIG_FXLS8962AF_I2C. > > > Fixes: 68068fad0e1c ("iio: accel: fxls8962af: fix errata bug E3 - I2C burst reads") > > Signed-off-by: Tom Rix > Reviewed-by: Sean Nyekjaer Given the purpose of that check is to verify it was an i2c_client should we be looking to instead provide a stub for the case where we don't have CONFIG_I2C? +CC Wolfram and linux-i2c list for input. > > --- > > drivers/iio/accel/fxls8962af-core.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c > > index 9fe5a18a605cc..b6d833e2058c8 100644 > > --- a/drivers/iio/accel/fxls8962af-core.c > > +++ b/drivers/iio/accel/fxls8962af-core.c > > @@ -624,6 +624,7 @@ static const struct iio_buffer_setup_ops fxls8962af_buffer_ops = { > > .postdisable = fxls8962af_buffer_postdisable, > > }; > > > > +#if IS_ENABLED(CONFIG_FXLS8962AF_I2C) > > static int fxls8962af_i2c_raw_read_errata3(struct fxls8962af_data *data, > > u16 *buffer, int samples, > > int sample_length) > > @@ -639,6 +640,7 @@ static int fxls8962af_i2c_raw_read_errata3(struct fxls8962af_data *data, > > > > return ret; > > } > > +#endif > > > > static int fxls8962af_fifo_transfer(struct fxls8962af_data *data, > > u16 *buffer, int samples) > > @@ -648,6 +650,7 @@ static int fxls8962af_fifo_transfer(struct fxls8962af_data *data, > > int total_length = samples * sample_length; > > int ret; > > > > +#if IS_ENABLED(CONFIG_FXLS8962AF_I2C) > > if (i2c_verify_client(dev)) > > /* > > * Due to errata bug: > > @@ -657,6 +660,7 @@ static int fxls8962af_fifo_transfer(struct fxls8962af_data *data, > > ret = fxls8962af_i2c_raw_read_errata3(data, buffer, samples, > > sample_length); > > else > > +#endif > > ret = regmap_raw_read(data->regmap, FXLS8962AF_BUF_X_LSB, buffer, > > total_length); > > > > >