From patchwork Wed Jun 5 17:59:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944042 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=yW9iJgkc; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=linux-gpio+bounces-7188-incoming=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vvb0T2TRxz20Wr for ; Thu, 6 Jun 2024 04:02:49 +1000 (AEST) 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 2566C289AA9 for ; Wed, 5 Jun 2024 18:02:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4E81195B0B; Wed, 5 Jun 2024 18:00:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="yW9iJgkc" X-Original-To: linux-gpio@vger.kernel.org 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 948971957EA for ; Wed, 5 Jun 2024 18:00:27 +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=1717610429; cv=none; b=VqabGWdcDVQ/bxLKQKBY775EVs4xUfYaVT9UHPHoqbHWg/XFzXwMUw/NG8gASoaIs8YXenpWhP3EKLg+LvArk7ZxeKoZ50b+u/k9uWaIc8OstWjxgmQexcmrjI2kaLJ/st4aBKieSuAXeBDF2Evqu1CyZdD91afHK5uzrCiCIwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610429; c=relaxed/simple; bh=7s5ualCvDc0GEz4419Gj42eDU6iSkCy4DM1JO8Cp5kE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=jWCmCwUDkhczltxNvHBb2DeKZ/YdtWamGJitVPZyhWw0WTvOuQTsn1yuUKNzQmEJr1by9i6Op9sdXbu2pmkYe33D9gKUvlTqzkcK7GY53qMkummcp7qdIo5/YOkwl12wPFucPM5Pm9POI9O+8/X0HjShYoIzDXYNYiL8MXL8mhw= 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=yW9iJgkc; 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 Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-62a3dec382eso601757b3.1 for ; Wed, 05 Jun 2024 11:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610426; x=1718215226; 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=Kq8gN9PC4V0/WUeYJD+ngNL2/82oznUqnDRsVCEUyhc=; b=yW9iJgkcljzKSnVxoazsYECi5fP6QNHHLJ9IlEuTsYQL+RlaWWDmJD2d4e+DNhDTlm KIfryHEvd7FtNm8eHNyqjTI1XXd9/8uhvtg7pv/6kGvV3N26EfwVy000lhOWFWeeOYca tJ5tYDQzM0o210kyrr+IgjNfC2CA3bJ/iL77N6LlXzTEq98PU3R3wL/25tRG7uPbotgU cpbVNwzhr6IKc2fqP3RBBaMQHVM8jgX0F5gRXjSonWVCOuoyDtvr1Rlg6q+Zn0PJq947 LFpzYOwiH3TGEwZZHterdbmrVBOoTZV4ppyVHdrpANxTOrfCSPzqLu+DJ+cBDsXOimAK gLiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610426; x=1718215226; 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=Kq8gN9PC4V0/WUeYJD+ngNL2/82oznUqnDRsVCEUyhc=; b=rhWfeqo9T8hgSmRUjNxQCfqXBV12ht5BcHxnRSQ9MD0UQw6PlbirO9wOL5bd6CDYU5 wy1MkcWhZCGFnLaUfwxprRbgEE7YoOPYnZ1LXid82FEeCX///SKJHQ5cyfj3XoY3qpL2 5iOlwbzca6aG/AEUXXpyOe4sbj5j+qOWv8U2pslL9NwlAWFPypaJcAJJGCpdtyqmE6K5 v0zg/hDOeVfG+LdkL9QrkBgmkTBhV7Lfy0jcmuVax3a3tO6rmA7nNn4gH7r2jaDXgLCp EVu1VytEVIwz19AT7L3Mnf7TZ/ZA893GIDQ/9HWQ7sMF32wWrPtwAaHSWBkfHyq3syFs Q2Bg== X-Forwarded-Encrypted: i=1; AJvYcCXYSs2LxwbIvhdMkXpEY/UfCwCm87YB07E68rfUgK98kJlcwVgBuzBdIO3n2YJDAqJzkbggrBvgzH1A/p7NQHNQUJrODVYiFEEc1A== X-Gm-Message-State: AOJu0YztUa3QsCyrU9Bt3oxZStw8YAQf136YvFv7+ZR+m78Z1kzaqS2+ 1XP6fl0ahe2zJoEC30Qj4Ys7Y/WogcBLmF/9wtyHvX1ZxHjkOZgkBVZZqwqG9TZK0rPeA0wc61Z tM+kuMUibEA== X-Google-Smtp-Source: AGHT+IGpQQ4ibO82CB++j7EQg4rT4P/RHw0r35tzLXXxO3B/dL6yEQW14Z2L0s1fkq9sPWcVhlzFxs8YqockaA== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a0d:d4ca:0:b0:623:be6:d5e4 with SMTP id 00721157ae682-62cc71784bdmr605497b3.4.1717610426639; Wed, 05 Jun 2024 11:00:26 -0700 (PDT) Date: Wed, 5 Jun 2024 17:59:50 +0000 In-Reply-To: <20240605175953.2613260-1-joychakr@google.com> Precedence: bulk X-Mailing-List: linux-gpio@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-7-joychakr@google.com> Subject: [PATCH v1 06/17] misc: eeprom: at24: 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/misc/eeprom/at24.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index 4bd4f32bcdab..0e8d92d6ab1e 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -424,8 +424,9 @@ static ssize_t at24_regmap_write(struct at24_data *at24, const char *buf, return -ETIMEDOUT; } -static int at24_read(void *priv, unsigned int off, void *val, size_t count) +static ssize_t at24_read(void *priv, unsigned int off, void *val, size_t count) { + size_t bytes_read = count; struct at24_data *at24; struct device *dev; char *buf = val; @@ -465,11 +466,12 @@ static int at24_read(void *priv, unsigned int off, void *val, size_t count) if (unlikely(at24->read_post)) at24->read_post(off, buf, i); - return 0; + return bytes_read; } -static int at24_write(void *priv, unsigned int off, void *val, size_t count) +static ssize_t at24_write(void *priv, unsigned int off, void *val, size_t count) { + size_t bytes_written = count; struct at24_data *at24; struct device *dev; char *buf = val; @@ -509,7 +511,7 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count) pm_runtime_put(dev); - return 0; + return bytes_written; } static int at24_make_dummy_client(struct at24_data *at24, unsigned int index,