Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp509609rbb; Sat, 24 Feb 2024 09:59:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJr2zPZkVG7taOQZEktnWONixb0SjspAxuAPWPyMvXEnE1Ff7CpjxZiN9DCWnTZxyyF8a2L8dZFllm1HBjb8wPAR5kvv9yNoQC03TG8Q== X-Google-Smtp-Source: AGHT+IHYyTm32kmcmYY//Zp7KWVc6ZsMaZaa2JCjx0rIFMAtY/W5pruQK8yy3YJMulYnEz379wjt X-Received: by 2002:a05:622a:138b:b0:42e:324c:e3b8 with SMTP id o11-20020a05622a138b00b0042e324ce3b8mr3159017qtk.42.1708797554194; Sat, 24 Feb 2024 09:59:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708797554; cv=pass; d=google.com; s=arc-20160816; b=BtynNWPtdtwS1fOxHJKgf7ZuWysvzZb94KTTSZLTGJ0a8ZN4kZKWRCUuzdemcJo0SB cH7WJfRW5UDL32QLcSMVfjguM7+u7B4S8lMcBQYqONZkNVLwTp8TVhOMaJ2OUMjDKbnU taMB7O3/JDitki86xBcXMXEPxfV28l0H5S7z1bhJhUur3aTQWumCxMaSr/I+uGt6iSzo QxwVO5WjH2+qDuMl5sdMMSom8zEjEALD+ChOLwcijrtLhNdkPrzwfqZhK14fcx/U8jR0 JhMnC7KoFLIU0pPx7mhPUo/1Z2VHuPbvL5XnORUpO8HGQALdDABvWsQzZr3DwutvDT3r dw5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=CQhhKPprFX/Sk3OUm0SMK4ExMOgN8l+unCS6+8wGPGk=; fh=2uYyAJ8AuM2IliuXNf7KDlfGlSJYyvEOBiuheVvHsnk=; b=pFrbEpwmhtQNqghgAGWhPLyzN1kTr3hCDvNE4glhxgrMjyrbc8n0S+9gG05Lczsicy g2lR6rAd7AvgPZK2aRPWWDiMdMHu3TYkQAKNV8zhtm2QdoG3jFtl9295DqougnIkPYYr T4vpPiSIE/mOralArZDCPgGRWl8HQfU8peLtxNgHuYgLQ8L7TBiAIBM3KC/1+8n034pw S95ugKI+XvBHJQAUWYc2GLsVUM+h1pbBSLCBLjbsKFOdBRX6hQUdkf4zuoaIbUJ7ckgh vmT7AKQAxJFh06otKMXK3yooGH00gZ6M13DITYCNTdFyvOal1tsJnslR0iT7+d7zg9li 6WSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JGF+qR6P; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79776-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x5-20020a05622a000500b0042c2fcc55ebsi1624213qtw.24.2024.02.24.09.59.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:59:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JGF+qR6P; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79776-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79776-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id ED1901C212F7 for ; Sat, 24 Feb 2024 17:59:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84E5C482DD; Sat, 24 Feb 2024 17:59:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JGF+qR6P" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADAA0ECE; Sat, 24 Feb 2024 17:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708797545; cv=none; b=oUnA9nWexbLmjEx7Lo9voy9H4kL/x05RacFBD62S3J1GQ+rGtLKijDJArLRFQ5lBXCYTW0wwxVUCJErPS/rl5UkyT+mp9SLYhjNaIBcRv7/Flq9OGxW88L/zgmcwIcDORea64K4/X7xdKmLpRyRQ6s9iTPHO6HUmS1ICDX2EIjk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708797545; c=relaxed/simple; bh=dYi/dilkwURl8LO3PZnPi1vvfmdVHEam1XBWXkIjSkM=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OJ/4/VLqeDBysuLSO+yP0HB0bxmmcxoBUt9UT7FJL5jC0UNLimVLrZbZR3pOkWYVsMgkX5nxwyxDdkYz2k0dxFcQo+oBESmsw7pqmmOO1gf3wBz2TFkAYJKDAOwfis0vbpK+PLBXg2UO8OpOt9KAl+qF4j7YNF9Mpx542FcE7bE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JGF+qR6P; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8BD8C433C7; Sat, 24 Feb 2024 17:59:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708797545; bh=dYi/dilkwURl8LO3PZnPi1vvfmdVHEam1XBWXkIjSkM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JGF+qR6Pje6gZApaVmR0Jc9qKIuUcU3mlvJqjz4ZKod6QKREXm0BPUoG8Qx7X6Qx6 ArzSCvL1QjyGbxlz/7GT3MNGSOwt6xjYBLepIHNae+VbCN5g5rmZ0v127fQ3otIt4h 3FvvZnZJtPxgoJH+u3W/BH/c7PKSxEFckmGt2iHKTAUkHIaPe0MP0d1/cLHX5bUpPk ZVLeqp4eYcccn1eYMmpupsje+MgcWRqwk0fS5QbnvNWcEJk//j7NdJHjxhozc//gfw 0TVejky85PoDTlp2/SsNvuQtm1H25nuS52Mywm11HbTA5x9oRCyHGi5b8+zyYX3ylf R0pC2zp35AsWg== Date: Sat, 24 Feb 2024 17:58:51 +0000 From: Jonathan Cameron To: Andy Shevchenko Cc: Vasileios Amoiridis , lars@metafoo.de, ang.iglesiasg@gmail.com, linus.walleij@linaro.org, semen.protsenko@linaro.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] drivers: iio: pressure: Fixes BMP38x and BMP390 SPI support Message-ID: <20240224175851.2a60d6b4@jic23-huawei> In-Reply-To: References: <20240220184125.32602-1-vassilisamir@gmail.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 20 Feb 2024 21:57:35 +0200 Andy Shevchenko wrote: > On Tue, Feb 20, 2024 at 07:41:24PM +0100, Vasileios Amoiridis wrote: > > According to the datasheet of BMP38x and BMP390 devices, for an SPI > > read operation the first byte that is returned needs to be dropped, > > and the rest of the bytes are the actual data returned from the > > sensor. > > ... > > > +static int bmp380_regmap_spi_read(void *context, const void *reg, > > + size_t reg_size, void *val, size_t val_size) > > +{ > > + struct spi_device *spi = to_spi_device(context); > > + u8 rx_buf[4]; > > + ssize_t status; > > + > > + /* > > + * Maximum number of consecutive bytes read for a temperature or > > + * pressure measurement is 3. > > + */ > > + if (val_size > 3) > > + return -EINVAL; > > I would add a blank line here. > > > + /* > > + * According to the BMP3xx datasheets, for a basic SPI read opertion, > > + * the first byte needs to be dropped and the rest are the requested > > + * data. > > + */ > > + status = spi_write_then_read(spi, reg, 1, rx_buf, val_size + 1); > > + if (status) > > + return status; > > + > > + memcpy(val, rx_buf + 1, val_size); > > + > > + return 0; > > +} > > With above and bits.h location being addressed > Reviewed-by: Andy Shevchenko > I'd picked up previous version and tweaked it for the header being first. Now updated the spacing above and added your tag. Only did this rebase because it was the top of my fixes tree.