Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp468940lqr; Wed, 5 Jun 2024 11:03:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUOIxdUUjLrQJiH62GQnlv5ZQLZZCoaxqNT6+M/UA7dPYPsB+bCrNgXhlEqu+UU/rVSbY4XFXBlR0cAj6QTpAGDcr3CCB6IbR4AEGi0yw== X-Google-Smtp-Source: AGHT+IHo+I2pH4eSEaZbGgr3nLRg2cPfpx0fGMMVmCV6b9kF5aaTL5amlpWsGXQqmDMJHiLvy9fW X-Received: by 2002:a17:906:3b94:b0:a68:ee4b:1e18 with SMTP id a640c23a62f3a-a699fa9810emr193910866b.21.1717610631851; Wed, 05 Jun 2024 11:03:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717610631; cv=pass; d=google.com; s=arc-20160816; b=h2JNcDGerSOGuTyNK9y5nQD51hYo90ndv2k23CFY+3fxMSiYI8OxMiV76pUduLjKht Sfre+hUzG3YrHSGXAvvI8HMoBav6E46HttVc8eWd8z8hQvjzBEUdRu9HX+c92c+F9QK3 ciRpkhQcFN0ifCi3lrIcEMs3LTNfXL15113+tnBD8pXly3/FRz7nWo4KsNK+eScfGs7o wXipx7gHRw7gId2anJkQ0J1rhX4ZO5FnFYWkU754KvNkkO7cy6D/YQa0KRBxttaoaZ0n pMtbQ4zE4ji1DjpQ85SVpT8D3vqzWIjCMZ38AbeHhZkInQnvIiri/bn5zZG9isKXki6q gFdA== 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=GabZAVwK9FSl0VODpa0rRnhc7Hb5WIAFsUpyNY/Jkgw=; fh=Kb9K2V3+6WpJ7uJzIKDo5VMuRYXNsrWxft8weipAftM=; b=ylT9UMZMBNq4rfRy9fUxSLTOPbf+1Ralwxcc9naB9E3UyO7w6Cq1Skkl0Jslwb+JmC Qvh6CSIhOdDzMeAfYHtBTxm2HU48R37gVx3XGuusHyUfhW7hfo6XzuPHBkZDGCk8/kCa lx0jFLL5MACT3dSYmr1LvqjTZ/7BQfkBAWsl8iPduUOL5aKZbHbHutkHh2XVW5S9JYaB Cn7MfPlTzpDo08P995gr4zNeNQ85yaRmq8ak50p7j+pXL7DSuqCekxhYHMo+WQzNTSN7 t1Y2G4D+7Q9NJyrUSrMOT7O6bqXouad6xWnisX0UvLVdB6E6odEt8YXSiGhXC4mAYg/S pTng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xh8vf0dA; 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-203012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203012-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a68ef71d4e6si372059166b.403.2024.06.05.11.03.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 11:03:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xh8vf0dA; 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-203012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203012-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E029D1F25021 for ; Wed, 5 Jun 2024 18:03:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9DFDC195B38; Wed, 5 Jun 2024 18:00:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="xh8vf0dA" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (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 46986195991 for ; Wed, 5 Jun 2024 18:00:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610432; cv=none; b=mW0ew/ScNGPAL2ZromgJlIB/b6ecXd2QnU712522hhysmmWPh+En6ToytcqYgpiUeGT4Zo/ymmhJUDisdnhq9DCRPPo5IlFS8UZ/Gzne+x63RNnBtiwQ6HhJ80bSVTlYZJXpQdA+tmXWHsLK0Np0WDBoR0Mljp2C0Y2lTFn5Dqo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610432; c=relaxed/simple; bh=7YntdTNu7aMZ5zLGGRpR3JsfAB0rBOtanC3KQe4XBYY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=jzXejwfW8VVuVoYA8Fk2sWeiTbomc9TnFk6URYvUdm66OOnMbw6apV4Zo2SBsZJ5R1pLkO/Kfa/3x7+VJbkDDFVo3VETFgd64E/j4G96rNUiMR8u4CAweSZocG4y2/cFKUIyWwM9nOEe9m6H8J4VXdoWWf2bdDnmOpT9rL3Equ8= 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=xh8vf0dA; arc=none smtp.client-ip=209.85.128.201 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-yw1-f201.google.com with SMTP id 00721157ae682-62a089511f9so15305507b3.1 for ; Wed, 05 Jun 2024 11:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610430; x=1718215230; 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=GabZAVwK9FSl0VODpa0rRnhc7Hb5WIAFsUpyNY/Jkgw=; b=xh8vf0dA+TFlUnkkazIa6Em6KzJbbntuGamI4Gn8Wj1jFYYx5ZYFkn2tA0alpWg68u 9jhNXfx2DxL9m7tqmgthqmC1rUSflk24zLEIHrstf3mW39EvFDR2FeelUhLsupY30DEi /gVZrfJA0Slzv9rEogcUVgXiY8hLFc0E46E+FUZ/X8hWU6PYTTTOsgDQPMK44rgcyi4X g7UTGxktSZ/IcwoGFDfvWXQYzCbWyLYks/FVJWCMOKozF5JwJ5koJWgZ7381pzPo2fKz JwnKZftDOTv9WkuxVVV5rBvZHglYy9BQThw/il2JbfCMaxHpHsqQPdwDUsOxRCnGKcAo B5jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610430; x=1718215230; 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=GabZAVwK9FSl0VODpa0rRnhc7Hb5WIAFsUpyNY/Jkgw=; b=VrN9IB9U7vzdL8vbQS7rHjMzLOWYm/+8W/6KE3ul4RN2xlxVRC0FPMOntoYuAfqTB8 C/61iNtrLaZyeeZibuAlfLpptrg+r6ztUViTtT7k9PpNKnGYElH8ZXyJx65gKXjZPKXy xsCm4MQumuoXY2zLVW9Y8TY3yEN8sbmMxFM4r/L9qceT/GY1sU0n0Og2yVSoAK91cS8m iS6zigULACP2kcrKTPoPpJmE1J5dU2/rkKsZm+Z+AF6GejQe/NC+EbKqgRXLncHvnhUi fJHoBGiAlzSCFun0/5Jv94BtpLSYWXQzj6ktyA8oK3H+yAcTvh1UEFH7hm1WKYoTDwf0 gzUg== X-Forwarded-Encrypted: i=1; AJvYcCVs6JEm+7mYu89zNmKATCWOS5VYaMN3Dk2IYctUKsYgfozZv0X1GQd2jmuxJzBE1D14SQwsh/yui3wq6PNafeAEcJBVvLUIMGwx1Mjf X-Gm-Message-State: AOJu0YxDF74h9/qIoqZ6BJPu9v/IqEupIueu6o11t0O7XVNfRfWo3GqN VzOvkgNo1fedWzMBhl8OGFTFz0vuFJ8MOe9Se8JKwZkarx3hMbrNKQ9stOOGYoURm2qArqOsnGq MtzZ1BQWyJw== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a0d:d952:0:b0:627:de82:8077 with SMTP id 00721157ae682-62cc709af05mr798057b3.2.1717610430440; Wed, 05 Jun 2024 11:00:30 -0700 (PDT) Date: Wed, 5 Jun 2024 17:59:51 +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-8-joychakr@google.com> Subject: [PATCH v1 07/17] misc: eeprom: at25: 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/misc/eeprom/at25.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c index 595ceb9a7126..73d60f80aea8 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c @@ -74,8 +74,8 @@ struct at25_data { #define io_limit PAGE_SIZE /* bytes */ -static int at25_ee_read(void *priv, unsigned int offset, - void *val, size_t count) +static ssize_t at25_ee_read(void *priv, unsigned int offset, + void *val, size_t count) { struct at25_data *at25 = priv; char *buf = val; @@ -147,7 +147,7 @@ static int at25_ee_read(void *priv, unsigned int offset, dev_dbg(&at25->spi->dev, "read %zu bytes at %d\n", count, offset); - return 0; + return count; } /* Read extra registers as ID or serial number */ @@ -195,10 +195,11 @@ static struct attribute *sernum_attrs[] = { }; ATTRIBUTE_GROUPS(sernum); -static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count) +static ssize_t at25_ee_write(void *priv, unsigned int off, void *val, size_t count) { struct at25_data *at25 = priv; size_t maxsz = spi_max_transfer_size(at25->spi); + size_t bytes_written = count; const char *buf = val; int status = 0; unsigned buf_size; @@ -313,7 +314,7 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count) mutex_unlock(&at25->lock); kfree(bounce); - return status; + return status < 0 ? status : bytes_written; } /*-------------------------------------------------------------------------*/ -- 2.45.1.467.gbab1589fc0-goog