Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp471179lqr; Wed, 5 Jun 2024 11:07:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFWZSItn2bSXkJ43p5TxaYX1Olvdcyj/BYI0LcAvxS8Mwov1GE6L9jQ+CDgIJWgUWSK2XdY8AV67di2N/vLv6mOW3Hk/jR4COgXDueEA== X-Google-Smtp-Source: AGHT+IFDtz+INaBcUhW8u0Oos5y9VEASpWH0/sP4AeDcadQ7mS+/dg9I7A0QjfM3JgHAj9191/8X X-Received: by 2002:a05:6a20:6a08:b0:1b2:c64:7b3c with SMTP id adf61e73a8af0-1b2b6ecaaaemr4093475637.7.1717610827811; Wed, 05 Jun 2024 11:07:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717610827; cv=pass; d=google.com; s=arc-20160816; b=pSX32dXim0F3zBxcThsNyPTXsNpg0tvMgS92roZIOfxS6/8ulKhKN3X+faMGRbLsPU yAsTwfJ1sCEP5GErUVo712xsGzlbsNEFxtxXM1h6kp+g68mF/wL3h5OK7CbygLiS+PAf 9Kau5iPA662VaGZD20b2ShmS6tnujs/VsbmkVB+7a4u2Q/QfLuPSurrjfbs57oQq+vzE 68tgpElavsOX7xX9JzgD8xvfjT1hSw/rEppZMd6+g6sOiSqk+1gOFnaoKo9tGdPqehD5 EmHGCiiCwm5+t5qwgbn26g9s2XB3cNA3sv65VQyl/UcVoiD9ymmoqHG4bgAxRw5MXzSU LGmg== 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=MVw14u+NFBf2FJ7HWAHlLpDDoc6dqDnKHHZFCo9Dzmo=; fh=fRGBNr5w4mR2MXHXvsQ7G0CXQs35a2U6Ls1e2++FZvs=; b=epg8f1OYq5tv7PqXL1G7/buZGDpWwkbiQ/Ek+r6coBgv89XqnAvRwfpS42MF7p2DNH q4m1ygWkqQ8ey/LMr8j3E2Ts5CmiYSsEr3usCAZRTui06L4ikaOXkwVjDnvAr6+/2X5e dPa9fqem/GWAIsrE29UUIOr9ZRQoFlXr0nd4EwKHLp0ZloAtZ+hmkogU02vAAs4q1ZQT PC50K1kaA0RMSYNDUUrK6sSmYLyGnkrri6XwEPbXIbY2or4hHhK0JfqcFrkTn+hm1f6o tU9nApUTIBGoTrG5P6wg49YOvJlW6MUwBODGjMcw4oXVR2qOZl5kCwK9D3r7sbybj+7M rAkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=c1tBtF+y; 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-203013-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203013-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c3540fb2d5si579526a12.68.2024.06.05.11.07.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 11:07:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203013-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=c1tBtF+y; 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-203013-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203013-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5F5E4289CA0 for ; Wed, 5 Jun 2024 18:03:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 076FA33F7; Wed, 5 Jun 2024 18:00:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="c1tBtF+y" 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 4016B3D9E for ; Wed, 5 Jun 2024 18:00:35 +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=1717610437; cv=none; b=UjzJ2w69/6mbM0qGSchNSrsSfJxBDU3zYXcmY5/1UlY9T5gI+umzn5aHrqZVGVP23l4rb2m0JkHlR/gC+xRyJxcWPdE/IwjAOqOwmZoosJY98+c/3WfMsBWTmh49ZYokErHjKWmYQncqkx5bhG1+Q9PjSsFMdUpyphJ0aUB9Lao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610437; c=relaxed/simple; bh=1Nr1idmwpwCu952z8yg01gYhGFCoooIcYkAZZCQGY7A=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=tR42IhF4LIGnKhW71oQFiM1Lh1IJV2dj6+45iFMem65/PLnxxx1fmqaRUNVf7uLPtfGOMwsNIxLvqq0UiVyqVSsBin+aVcvwYNMiXhZx5erK9v0cAEM+uO39OXsz78rQNjfLyAayx/WV3DAWJezPQzcpBJZN1I2W35x7EUGPDCY= 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=c1tBtF+y; 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-627eb3fb46cso266947b3.2 for ; Wed, 05 Jun 2024 11:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610434; x=1718215234; 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=MVw14u+NFBf2FJ7HWAHlLpDDoc6dqDnKHHZFCo9Dzmo=; b=c1tBtF+yJ8uoGUqKF3NY2+DNv0U+YbN7XP5vEddV+WJ7paLKxOEOglfOFz182dQWhI TpkluWnQxtAvQfp05jLsz4zT9dm3xfsdzDHh1yzr8/nmaSz10c9q8p1TSIS4ycb9XjL4 +kZT3Co4WBmgkH8T5xB5TRVYwTeQD9Vt+Y49WRFALEILqv0lqjfHvGNKs5cdrawGsQq0 zlcEIgFN0D27pd2iV8Hc8uPpS6COn5E86LdPT12ToZhOr4ISvKhsf5WLKdzwsRexu4qm 8nydig+D2wj90/ixelEJDLBX4o3t/wkbBmdzYkGeDePYPMVOnQXT2td5EkySC3qAkgu1 qPIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610434; x=1718215234; 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=MVw14u+NFBf2FJ7HWAHlLpDDoc6dqDnKHHZFCo9Dzmo=; b=lGr/AznFSCCdADOKGlWOP6WqyKJNEmvS+NScwKfpBc90NKSnvReais3xshVacSsjcD 8eVLqsPPC2MnV+j9AnSYemdaXMMbuw6Shn6dG42JKU3szTtqGyECl/RHYFPFq+h9FT3q VvXYGw0LyYpkSh8/1TrBGuN9kuHjrbzbxtG+3JZ7NI+fmzEK9/HNlnS3MUtiwZ80Wn93 bOqSBFNJ0s2OizZYwUMByfG8o/e3o2lihUuu4Mxqtu0PHU0LYFcjpyP+Rs05zkVZRNha +J29vKE5LtqP3HWNx2+3cWUi4JK5puDZwC714xZ/jCpbFsRr+Im+FZUVaPL6O+4ie2cK XyOg== X-Forwarded-Encrypted: i=1; AJvYcCV1++Mbocz+BHqKfIiThEEPeGSX7VGewq95jdYKV8ZZvbiqWg+QHVX68UEuPpRNabqr55mXCFXMEcY8eQH0mPMFJL458ScSg6wTXAR4 X-Gm-Message-State: AOJu0YzbGXNaO0kpjRwqX2qChFP/7Qkr7v79hGbIFBZDwoWDwJM+bbf3 KpRgEKPbkFxtH5RQhS457JV6Su+V8W+awuJak5NZFvHtVswkYFiPl9iO5mdLTJvMMI+DXGpuvR6 2enrKY6Nmxg== 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-62cbb596fc6mr8752147b3.6.1717610434368; Wed, 05 Jun 2024 11:00:34 -0700 (PDT) Date: Wed, 5 Jun 2024 17:59:52 +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-9-joychakr@google.com> Subject: [PATCH v1 08/17] misc: eeprom: 93xx46: 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/eeprom_93xx46.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c index 45c8ae0db8f9..5d618a13fe5a 100644 --- a/drivers/misc/eeprom/eeprom_93xx46.c +++ b/drivers/misc/eeprom/eeprom_93xx46.c @@ -79,10 +79,11 @@ static inline bool has_quirk_extra_read_cycle(struct eeprom_93xx46_dev *edev) return edev->pdata->quirks & EEPROM_93XX46_QUIRK_EXTRA_READ_CYCLE; } -static int eeprom_93xx46_read(void *priv, unsigned int off, - void *val, size_t count) +static ssize_t eeprom_93xx46_read(void *priv, unsigned int off, + void *val, size_t count) { struct eeprom_93xx46_dev *edev = priv; + size_t bytes_read = count; char *buf = val; int err = 0; int bits; @@ -158,7 +159,7 @@ static int eeprom_93xx46_read(void *priv, unsigned int off, mutex_unlock(&edev->lock); - return err; + return err < 0 ? err : bytes_read; } static int eeprom_93xx46_ew(struct eeprom_93xx46_dev *edev, int is_on) @@ -258,12 +259,13 @@ eeprom_93xx46_write_word(struct eeprom_93xx46_dev *edev, return ret; } -static int eeprom_93xx46_write(void *priv, unsigned int off, +static ssize_t eeprom_93xx46_write(void *priv, unsigned int off, void *val, size_t count) { struct eeprom_93xx46_dev *edev = priv; char *buf = val; int i, ret, step = 1; + size_t bytes_written = count; if (unlikely(off >= edev->size)) return -EFBIG; @@ -304,7 +306,7 @@ static int eeprom_93xx46_write(void *priv, unsigned int off, /* erase/write disable */ eeprom_93xx46_ew(edev, 0); - return ret; + return ret < 0 ? ret : bytes_written; } static int eeprom_93xx46_eral(struct eeprom_93xx46_dev *edev) -- 2.45.1.467.gbab1589fc0-goog