Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp475931lqr; Wed, 5 Jun 2024 11:15:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXmry37pi31Nw6acffEU/Ycn8lRV+F/2t3GtwLt68xfOiB0eWQC9kTMN6wlvbx84zHUodDrZsliDmGpBSAsW7HYyT9rIFqQtvmTlP3Lvw== X-Google-Smtp-Source: AGHT+IFWDZ6Yq8XT9EdfxJcjc1uCaeX0InE0khBguFImb7OMX4exZecvQs4nIL6+aQGyKumAIR5w X-Received: by 2002:a05:6a00:1c8a:b0:702:2f19:65a5 with SMTP id d2e1a72fcca58-703e5a13569mr3395408b3a.25.1717611310622; Wed, 05 Jun 2024 11:15:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717611310; cv=pass; d=google.com; s=arc-20160816; b=krg/EKm1TUMB33KoxmGENj3i5syviWIi4r/mgjRKkvXmnC5P6WKmm5rhUbXSGlkmD5 8NuNZSR+NZrlJkLmcI5dWCnA+eOXd5SAxs7nbjrM8hlYIr8BAg5MARV/1CGShEJJBekI EmCfNLoTZxx2M7dHn3mywZf/IUlWarTN/yxjcJxO9n58izn2TjWR7BLcfQgD5dhrwqYK ocSPd+vj5tlUZlKIUQRS17sKqgMt+/CE7VtEKS2fw3DJzKysDprTRv9mj3TjRrvbgzRj eNrURJShASg9MC3O+ydcbnYQ5RZXzfN8GUG9HZqU2fUTT7f4JKlIFxLUxwfgTifI5KKL 48fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=AwIs39A3C8kh3vVRuRyRYkps3QbjGarBaeH82L3DU0g=; fh=Edj/Vlg9tg3RKGSVLK5WHbyMjfrNpbNJRHyrAnkAt7s=; b=DiuPTJY1pQMvPoRvuhdUOCeb4dxSCqBD3fVBFicz1cq9hebdxpCj4QfBDzSFy88GHG jLlSiO1KXtCVKQ8oa6LIBuw38f3CkVwLHsCJjDv6A3fAE/95auNEonKPwuuh8W17aOXJ esmIi0PTgeUXZiuyvrlVMXvdLem+Nl9grRVVcRAgeFKsFnfcLQvMzRdtw6WwCLAfdjsD E1aCUMnR1ghN9FFP4ELij7atsgNbUFGc1w2nTpcWEi03CJufFQSL1eAv3MlutTeoGJHF rg9sNWXF/WLumtjLkcfeS9M3dAi5/jSZ6agVywwRhG912yb3XZzuu3Kib5khygDha2RD Y2KQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=U52V+hRs; arc=pass (i=1 spf=pass spfdomain=flex--joychakr.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-702423dce6csi10303549b3a.36.2024.06.05.11.15.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 11:15:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=U52V+hRs; arc=pass (i=1 spf=pass spfdomain=flex--joychakr.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203008-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id ECE65B21C42 for ; Wed, 5 Jun 2024 18:01:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD23015531E; Wed, 5 Jun 2024 18:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="U52V+hRs" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD82015FA72 for ; Wed, 5 Jun 2024 18:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610421; cv=none; b=LiBJzwrWjqkKKnTKKRj8YtnH7PwBUosFxa6ryFEivobffpAAcxHDplmk4T0X0S8MK/m4cnpNRe2Qz1WD0fiubTrWMY7l6U8kbWzth6NrQ2usiN2iX26QoktixjjIdmGY8tHj4Bkk6BXkTLUx4Bu2qOZI8eaCCjGVMrqPc2CrG+g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610421; c=relaxed/simple; bh=DtpDZyHe3eugG9lKYAyC1ondYmKEiXhRbdfT84tszLE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=rUQlNx2v2HsY6NnkOeMRuWz6PMQuqLkka2w9WKrkRBR2HBqcdh7ICFEBgAFORE9TZy7H89VD4rgbJ/5Cusx5fAH2c3aGXX3wFl13WNcCEs65mpo5A2RpcZmw+4zWIk0VWCcO718XIwVT+AxeJBblAZTZTYP4h5e/064FKQYyFAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=U52V+hRs; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-df7721f2e70so1661631276.0 for ; Wed, 05 Jun 2024 11:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610418; x=1718215218; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=AwIs39A3C8kh3vVRuRyRYkps3QbjGarBaeH82L3DU0g=; b=U52V+hRsiJQjSRnjvYDtZ8nO3ttKXkTxiHrLjNmADwfjQ8plad8HEMYMkkxmvtoFIs QEZHHMmsbHs8oE4DsgfG7xV73VdpniuxJWGD1uX+sexyHuIPqMEjjQbpiFRleB333mzK cskQ8g8ioMRy6iE5yXCZP8fi72tXA3aLXSn2e//1mmOhKE3l2iZpjrsErUj6Nw8rXBT/ Ls5L9CJrzLx+rKGRzdTKorUXDwYGdNhd3A3/5vELUbwt6as3QITS3EdKaGbEVRNWJanK trjloEE6aIqij88o+jESh2lYoT7HqoWLxLTSIiCFGrQSEuGXKrYAGwKb/WUU8YLm9SV8 ouoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610418; x=1718215218; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AwIs39A3C8kh3vVRuRyRYkps3QbjGarBaeH82L3DU0g=; b=fz+iHQOGbA7xA4wG988IUOGEyohQ5dNXDc+6bNhwR2joBW5uRPrs78zdfRsrXXBI8z rGKDeMNud6YH3CD50lfK/LcHxkrmh2OLPUt7HWo120Z9Me80euCPYf3qZw6fGknLUPIN ZYnNl1tKbgyuBKnYTblHvO8ORQmo2HtgxG14luQyV3Hm0Vn2k3zVGgwxco/oYOikdUC8 w0rTpehof155zFBm73nbQnPXFTwQ+axF6vWDQb1Om/8MSuck7yHueai2y4PjMqPcEyLv Shw1BBxqbLcgJ0JIwunSbLy9MNQE7M5ZVnGVH8kWYeGMPJ1RXHrBtNgP125o7pYUsMjk R8+g== X-Forwarded-Encrypted: i=1; AJvYcCV6Ktxq97eNMiGEoK0zcE97uiQaOFVE+Vm1qDOa0LZZTzwnEunLwfFO7Vo8i6bXKmByXT4CMHGTm7gUtsRUgMDSwRqwQ+kcv0hU007r X-Gm-Message-State: AOJu0YzeM1mcwO0Mf5VFb51gmgJmeenorc5laAXhqHdgd85XaDWet7fD MhZnBuoFTAtksp70xrnv3Y7t+EXzMcUyEbysJU4XYBxKTmtyASoCpmihfplK4ReHFkwp2TGGMeJ 9bxHAVYbhCA== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a25:9004:0:b0:de5:a44c:25af with SMTP id 3f1490d57ef6-dfadec0b255mr68711276.5.1717610418012; Wed, 05 Jun 2024 11:00:18 -0700 (PDT) Date: Wed, 5 Jun 2024 17:59:48 +0000 In-Reply-To: <20240605175953.2613260-1-joychakr@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240605175953.2613260-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605175953.2613260-5-joychakr@google.com> Subject: [PATCH v1 04/17] iio: pressure: bmp280: Change nvmem reg_read/write return type From: Joy Chakraborty To: Srinivas Kandagatla , Greg Kroah-Hartman , AngeloGioacchino Del Regno , Lars-Peter Clausen , Sakari Ailus , Bingbu Cao , Zhihao Cheng , Jerome Brunet , Martin Blumenstingl Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-media@vger.kernel.org, linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org, linux-mtd@lists.infradead.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-usb@vger.kernel.org, manugautam@google.com, Joy Chakraborty Content-Type: text/plain; charset="UTF-8" Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/iio/pressure/bmp280-core.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index 09f53d987c7d..8d5aeabfa297 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -1465,10 +1465,11 @@ static const int bmp580_odr_table[][2] = { static const int bmp580_nvmem_addrs[] = { 0x20, 0x21, 0x22 }; -static int bmp580_nvmem_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t bmp580_nvmem_read(void *priv, unsigned int offset, void *val, + size_t bytes) { struct bmp280_data *data = priv; + size_t bytes_read = bytes; u16 *dst = val; int ret, addr; @@ -1518,13 +1519,14 @@ static int bmp580_nvmem_read(void *priv, unsigned int offset, void *val, mutex_unlock(&data->lock); pm_runtime_mark_last_busy(data->dev); pm_runtime_put_autosuspend(data->dev); - return ret; + return ret < 0 ? ret : bytes_read; } -static int bmp580_nvmem_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t bmp580_nvmem_write(void *priv, unsigned int offset, void *val, + size_t bytes) { struct bmp280_data *data = priv; + size_t bytes_written = bytes; u16 *buf = val; int ret, addr; @@ -1582,7 +1584,7 @@ static int bmp580_nvmem_write(void *priv, unsigned int offset, void *val, mutex_unlock(&data->lock); pm_runtime_mark_last_busy(data->dev); pm_runtime_put_autosuspend(data->dev); - return ret; + return ret < 0 ? ret : bytes_written; } static int bmp580_preinit(struct bmp280_data *data) -- 2.45.1.467.gbab1589fc0-goog