From patchwork Wed Jun 5 18:02:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 13687290 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.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 1424814E2F6 for ; Wed, 5 Jun 2024 18:02:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610577; cv=none; b=jw38dI0bUXtLMUz7qW/VRMnmKXJMqRuBTvVo1xwq0d1/dpuYj9lB1ltiTpGT84Zs2AU2VdygdlJctox7uubryRePJf8CafSKLWibpRdTFb3b1FOIYCOTdbxSEHXQvenn37dcmTK9harCvG0sqHcGjwzeqGgzwSjA42ei/YZ4anw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610577; c=relaxed/simple; bh=3NTGVyytdVyzcHP8txKlFB9YPPGxIJEVxCzu2cUQr1M=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=NNTaf6XRnV7OHH2eRkEzdSqxqinvi4TdainEr1uND/AKkkzbPIjxdxGpgcO9STKVzNNqx6difgwsGYQo6JGiMX31s7Dt8mXcwn4vUmrnB6kqFfa/9OSAHNORdojcZgWzHu22bhzCxEkgCALYXtZMo8BFei5THQ2OM0J0V6UtVCI= 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=Zceh7r4D; arc=none smtp.client-ip=209.85.128.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Zceh7r4D" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-627dd6a56caso319967b3.3 for ; Wed, 05 Jun 2024 11:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610573; x=1718215373; 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=qDI8h7ZoQYy75CqD6I2McYIto2hpIA5emU6fq1I3LPI=; b=Zceh7r4DKjZxj+a9nK/QaXDX6PywKjBJO0UZV1S/xJdKXimp/nnCI0wZvsZf0UJhwK 7Q1RjJdda7ewUbgf1avKIEw/IlHVV0/kuQYnDpbGWhedQ8/BTcIzW73L2EnJUWVZdmg+ PZ9u65qivhbL3++hcgSBbL4DG4bWaaEbCO+dFoE8ACY4vUfP6RaLzkkrbcCyH5XWZISy wDGKnK9ja1EPb9k9WJHVTZJ5qM0WWQfoT1vIvHa7kLuHD+Sqbr7dPNAVmelsUyhgUAwX A2L8gG3AW7S8JXvOWrFgHP2ygYbSqPQRbESNpKB37Y6rSBH6lpRPJcUdj1DyHb9Jg1wz zX0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610573; x=1718215373; 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=qDI8h7ZoQYy75CqD6I2McYIto2hpIA5emU6fq1I3LPI=; b=wRpluPYLYcmB5KoCQCZIhY6gdl1zpCeHVbmDH0tRB0faVMYef0E4YRczUVLPV9/ZrY xpKoySgJiE1SaGkOtEypVb7O0qzBTciIXcY5j/IVfRkYVOTDIbG89iZ+HFqvjaf2HolG zJ4y/Tc7031sY3EI6GHcTnTjlC/grkCLjQTjLUYdzckjXO2LzzVqfl9/G9V2dFhZsuDj QLJwS74He3PLTNZ/dHZ9rSYN0p72wyo6SLFE6XG4gyca3YzMYatDHn7IpB/jczQViTmj 7as6NIDY6LWlqmrRPCd1apdfWLcKMu8YUh1P9SKzjQA9KdDYcHUkrpeps5Xco2GdFX/F 7r0g== X-Gm-Message-State: AOJu0YzplECohajW/vBbPrySWeXYND9KpeP2zkttT3l6c0niyGoTbZ36 dS9EYDtBNvmwyVqPamuk86U9bIiqZWimLhxqB6ILi03E/QeUrZ8FRZvAvxlh8OaBmXo5tOaytAi rqshOJ5M4wg== X-Google-Smtp-Source: AGHT+IHsHtY+bAgPNOkcmVi64EeRKQimO371NMHALyHppPPqEXYX97pSerbED4x3JFp6tor3148MLJe9OAqS8w== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:39c:b0:627:96bd:b2b with SMTP id 00721157ae682-62cbb596fc6mr8780427b3.6.1717610573043; Wed, 05 Jun 2024 11:02:53 -0700 (PDT) Date: Wed, 5 Jun 2024 18:02:33 +0000 In-Reply-To: <20240605180238.2617808-1-joychakr@google.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240605180238.2617808-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605180238.2617808-3-joychakr@google.com> Subject: [PATCH v1 12/17] soc: atmel: sfr: 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 Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/soc/atmel/sfr.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/soc/atmel/sfr.c b/drivers/soc/atmel/sfr.c index cc94ca1b494c..c1c8e59cf6fc 100644 --- a/drivers/soc/atmel/sfr.c +++ b/drivers/soc/atmel/sfr.c @@ -20,13 +20,16 @@ struct atmel_sfr_priv { struct regmap *regmap; }; -static int atmel_sfr_read(void *context, unsigned int offset, - void *buf, size_t bytes) +static ssize_t atmel_sfr_read(void *context, unsigned int offset, + void *buf, size_t bytes) { struct atmel_sfr_priv *priv = context; + int ret; + + ret = regmap_bulk_read(priv->regmap, SFR_SN0 + offset, + buf, bytes / 4); - return regmap_bulk_read(priv->regmap, SFR_SN0 + offset, - buf, bytes / 4); + return ret < 0 ? ret : bytes; } static struct nvmem_config atmel_sfr_nvmem_config = {