Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4293606rwb; Sat, 21 Jan 2023 09:03:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXsnQpCGzJATwaOwBDCIfbTzfnJOfrevjzfA/RTtiv3gSWjtEfMODYVUDFCcqLtUXKQG1gbz X-Received: by 2002:a17:906:c283:b0:86a:833d:e7d8 with SMTP id r3-20020a170906c28300b0086a833de7d8mr19182801ejz.17.1674320639232; Sat, 21 Jan 2023 09:03:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674320639; cv=none; d=google.com; s=arc-20160816; b=HmLg8N8S6DAWmy0wKBLqJBtLNIUm92ieK3s4QZWt280qtzCObutpChOsa/NBkrws9J 1EMAE/ypZH+V/QMRSt2dFg2U5nbqanqLL8BZFzTxjBGKMw5Z/VcBkW8bdMeotOkt0sA5 9tUyOKUgOKLA+HdhMlaPbhdBxvHOBO5mIj5APqBuBl8iwEVlSFf+tQPzCjecb9sOL1It 089S55zC9OAUGotbJBGZdQ3UC1txl67B8f+42DkKRTBpCs0r/m7g6bE2hVPbfd4LIHCK vUyop0mzds6ivs/MCDsD8/6wLDHVGyVMZNAUb79drUv4C6ShoFzv8xmAdTaJw9mTNl2Z QMeA== 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 :dkim-signature; bh=POvmYWcz0Hy4dDGRLrQk2Z+CWYp5WY4L8Qn+ldpMGuk=; b=LWe9aGw+ZQR9TJO1EeOJtV8K+o1cdMK2BQFUtAThDgmcwHo1OX2V1JWPBLhqr9xX9v MhBUSnWBGqy2BPq9H60bKrIjTj38Au4EjAegMxqHisNa/0O6ArkNrAKMUyotayUUk32L AZdZPN4hu8tWtK7tw3H/8L3FXdngI6lvLckK4SRf48NLr/VmTdD9yUiLfQ/ISOWQ81mT gPD+uAupQN1Vzs7po7cY76nsKChiRhVelvOqIN4zgMBNd9pFHRgMZgjEWfABsbu7kwNG D8xgS6lcztAVw6sWeTWOBoMh7XIdqgry28nETAcnOFnP8BKiwTMkGmOv0DlFLrwinKjM kegg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T2T2vnT1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds18-20020a170907725200b007fed8db38a8si24835491ejc.114.2023.01.21.09.03.39; Sat, 21 Jan 2023 09:03:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=T2T2vnT1; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S229924AbjAUQjQ (ORCPT + 63 others); Sat, 21 Jan 2023 11:39:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjAUQjO (ORCPT ); Sat, 21 Jan 2023 11:39:14 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8880827488; Sat, 21 Jan 2023 08:39:13 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2CD08B8075D; Sat, 21 Jan 2023 16:39:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FBD0C433D2; Sat, 21 Jan 2023 16:38:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674319150; bh=gT/5AvVpeDrgKjkh47OXtzrBPwHm9WVXPk88PeHkYdg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=T2T2vnT1Xs4tW5V/oTrCVF/YscJHiNq+7HTjvmQMO07kIVdALzUWUY/Lg7jgN8oeV wDH/jrinV14zyuMq2EWtvqw0MJqCVYQkQmSM97I02rGKmkJT8mWnP+XySroZ4rplWG RlAswjzAZLSIUe5xREEi1xk7mpGRJ+el+yXQps4AW3OLVqJhTAobryzkTKQ7IcmeFR gz9n7eY4kKn03iiqGBkjRAI/u36bgFn5jBskRGSmm4cNBL/uaGM08TtLTQYXpHtqxx meoZpovFIIHToxzFIsTk068dsFlMtc5YJ3ropDVVqr5LoNdkRAl4Bqac9L/I3U7BVM lonUWh/lOpEIw== Date: Sat, 21 Jan 2023 16:52:35 +0000 From: Jonathan Cameron To: Amit Kumar Mahapatra Cc: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v2 04/13] iio: imu: Replace all spi->chip_select and spi->cs_gpiod references with function call Message-ID: <20230121165235.13da9db2@jic23-huawei> In-Reply-To: <20230119185342.2093323-5-amit.kumar-mahapatra@amd.com> References: <20230119185342.2093323-1-amit.kumar-mahapatra@amd.com> <20230119185342.2093323-5-amit.kumar-mahapatra@amd.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.36; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, 20 Jan 2023 00:23:33 +0530 Amit Kumar Mahapatra wrote: > Supporting multi-cs in spi drivers would require the chip_select & cs_gpiod > members of struct spi_device to be an array. But changing the type of these > members to array would break the spi driver functionality. To make the > transition smoother introduced four new APIs to get/set the > spi->chip_select & spi->cs_gpiod and replaced all spi->chip_select and > spi->cs_gpiod references with get or set API calls. > While adding multi-cs support in further patches the chip_select & cs_gpiod > members of the spi_device structure would be converted to arrays & the > "idx" parameter of the APIs would be used as array index i.e., > spi->chip_select[idx] & spi->cs_gpiod[idx] respectively. > > Signed-off-by: Amit Kumar Mahapatra Acked-by: Jonathan Cameron > --- > drivers/iio/imu/adis16400.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/imu/adis16400.c b/drivers/iio/imu/adis16400.c > index c02fc35dceb4..3eda32e12a53 100644 > --- a/drivers/iio/imu/adis16400.c > +++ b/drivers/iio/imu/adis16400.c > @@ -466,7 +466,7 @@ static int adis16400_initial_setup(struct iio_dev *indio_dev) > > dev_info(&indio_dev->dev, "%s: prod_id 0x%04x at CS%d (irq %d)\n", > indio_dev->name, prod_id, > - st->adis.spi->chip_select, st->adis.spi->irq); > + spi_get_chipselect(st->adis.spi, 0), st->adis.spi->irq); > } > /* use high spi speed if possible */ > if (st->variant->flags & ADIS16400_HAS_SLOW_MODE) {