Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp467907lqr; Wed, 5 Jun 2024 11:02:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUw8eKOlP2ny+jHSAbGP5QJpB/F0DMqb8LdAJ1CV3XpJomhCtCGrpPipbm9csR1K29RbsQx7eYyQLlCGxXAPzWJ2Kp5HM+6cFGUDHDnBQ== X-Google-Smtp-Source: AGHT+IGc/IE2B+/XH095VmmoCruadgVROgHl3AdxnVWM/tOzsvT4j9YmETMKcqoHLsTduzaxD2na X-Received: by 2002:a05:6512:39c8:b0:529:96eb:6798 with SMTP id 2adb3069b0e04-52baca5aaa1mr2139782e87.25.1717610545793; Wed, 05 Jun 2024 11:02:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717610545; cv=pass; d=google.com; s=arc-20160816; b=s0568xUYCIcEt1RnW+pWAx4NiuSX54o20qYDDYqQFdfzz109N5WBMBHVtM1DwX/O5h xLAdgvLjCRx6A/GUsuFN057M83WllvJYxfv6WLUZc/toDDPrSlO7RccTdyXy7Py3SSvH fsZlvVDM7VIXPaCxIzKCigvOD3nO9Z5iUhx0DbEHoj7/vlOMkZUyzL6nasAwFhaQ1Bih 6ZzVeFg5YB2GuDP/fdltUFtEkOarS/FxmWBjdglO27NyMpaMdFV6WTiT9SX8u63CL2MV EXkJrMpZvridT5qdHClv4DxbVxhWhrdRC+7efmKuwPZTeOKCRHUbe4d6AwAeiDDlawEw 9dhg== 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=oWEvs7lXuHPW/wbGZW3HASpAVL3QgOZ/ef+Ervw8nvw=; fh=AaYJWFoHpPfW2PNPY1LKAWuwIfEDzqHV2cZyY+rR/tU=; b=jASSST070QMzPyaI1w93a1yT9MzhpYnvRC7Zjuq0qKbdoqsDa2Oi0bgw8A3X47owUU itR5j7WGT5HrinLzRscI787n1QDTCQT3FZwXCJRqSxtJglHvNxAtUGBQo50iTQ8hjF1N Vyr1XQjtlSRTaIzhJjpHepVBCeRdnQPvON7+kO80XlnbC/Q4+1mLd2Kfo4leOSkOAHwi FwN5DjlQUvF0rKrZjOb1y6ulPXsQEczeYSnxYFBd7PPJ+x0CrtaIRAFyJAq+WYR6CdkE YIZJGsj6HYpAnCRVfsKAwok2FDVhHcyB6vq6pUD/d2cKkjhFYcpP4dxDUHHUB9Ki5PqR VHRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FJuZggmh; 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-203010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203010-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68e7b2fd1esi398472666b.927.2024.06.05.11.02.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 11:02:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FJuZggmh; 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-203010-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203010-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 77EA71F235B9 for ; Wed, 5 Jun 2024 18:02:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0BAF1957E3; Wed, 5 Jun 2024 18:00:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FJuZggmh" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.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 7ABE173479 for ; Wed, 5 Jun 2024 18:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610425; cv=none; b=kBRe8NaIxaC7WDqjI1hrInHN3R3Cbz3r2IhZa+j0f9qGdFvfFdhJdWpzs7whRYQhBn9CYohZ19KKxWNsdDrusojsNmu9ZJzeWnYPmPd73N7qa1ek7KD1d5mZEJnemd1aY493qy10ZuB+d23r9AQErR9t6ANu/wiQsiwwEXWMWHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610425; c=relaxed/simple; bh=M/eENeT34qITqyMJGoLfrkcDLPx6c2gqtgSpfyqShjk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=aDDKGm5My0fYuyu5hAJ6EEIgqc4ueyZpe2JhZCLYHImWJMI3dCln5CdIOgVWdoESJ5ppO3B+9ULTEmfZjEBW8r/nkK95rNYYXCgfPeXgPo6+5S+A5aoyaBSMdGLONTbIjQ8pHBiBtT8lTTh2c3sqIrcSDGf1IPppqHLHVCM4tsQ= 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=FJuZggmh; arc=none smtp.client-ip=209.85.219.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-yb1-f201.google.com with SMTP id 3f1490d57ef6-df7a6530373so128562276.0 for ; Wed, 05 Jun 2024 11:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610423; x=1718215223; 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=oWEvs7lXuHPW/wbGZW3HASpAVL3QgOZ/ef+Ervw8nvw=; b=FJuZggmhFGhWp10YbseBbhbNSwZbD3YkwUxXiS6vcF3km6ch/KL4ccGCubjjUswrvs stPWi6m+aTLRC39j/3ob86S2Z6NSr8O8AxWYWzc/hE+2uMm67w4Lmz1S94v/l/H2c1hJ O+dO/BeG+dPImMkDS26dKkcAxhVypHz9QHnNm3SysGqu+1oZzO8mtV+2ZAtcfMJ6UYcp ai+ktg2KHiTPkI3n1qzSaKTw4JfArzruUWmO+bX2v6Wv+JKurz/SBGIfcsiP8wS4dc4B B6pVh21yuxtzozIJA2Lvp6iwb6u37kIgRlnXtqQ/gmB7Q0nOc3TCGGSkWeK8EtBzAwJO uA/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610423; x=1718215223; 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=oWEvs7lXuHPW/wbGZW3HASpAVL3QgOZ/ef+Ervw8nvw=; b=KTo/i6gaSb3jWLUeln5Ey+3w2HXXeS4uYMD5RuYsUMVDNgqESamM0//4oJz7WcUKhd kT8dLbkLbd2qtIdDR+QNwOkIgT95ROz7HKp5M0HPn3bW8n3+Um9CmaWmMLymZnpxKpVD +l/7wa5TGZz8VPeUMBHm1xc/4f9lkkL8RKgodwsqH1Ixi80UWozVZN0gJ75mZn5uR9XU e6aK6sT44XydZj3rsc1BOI73svnGWkm7x/8WTprwA1JKskS3nMZSkBFqDDCUOTLrKqg5 NSY4F4JurZAq2FdOEDsx94N9wneEUS2GIJGlS5OxF0sRNA4TbE9oWOUhaaQOS03NIZaz tPRQ== X-Forwarded-Encrypted: i=1; AJvYcCVq8oqR6wNDQktj9eegchiIDGuksXjw+bZOaunHwRboLEYf7aTnE/LviyJMI2QU65CvfEWfW1ZMeRELWP5JoBMqPNOJ0pPu/l/GYIb2 X-Gm-Message-State: AOJu0Yy3b4L4XyvEj8xDchFJ80BdZwEA+NSGMtxpzDx57wMusU162noc aAOsfWjf6/eRi3/ZfvdnNQMS0EaBFNOqLqYLvwhCvmRMJboez6KbFO/4n1+6cumcXCD/LHsxfeO Md0YyVvehLw== 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-dfadec0b255mr68771276.5.1717610422643; Wed, 05 Jun 2024 11:00:22 -0700 (PDT) Date: Wed, 5 Jun 2024 17:59:49 +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-6-joychakr@google.com> Subject: [PATCH v1 05/17] misc: ds1682: 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/ds1682.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/misc/ds1682.c b/drivers/misc/ds1682.c index 5f8dcd0e3848..953341666ddb 100644 --- a/drivers/misc/ds1682.c +++ b/drivers/misc/ds1682.c @@ -198,26 +198,22 @@ static const struct bin_attribute ds1682_eeprom_attr = { .write = ds1682_eeprom_write, }; -static int ds1682_nvmem_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t ds1682_nvmem_read(void *priv, unsigned int offset, void *val, + size_t bytes) { struct i2c_client *client = priv; - int ret; - ret = i2c_smbus_read_i2c_block_data(client, DS1682_REG_EEPROM + offset, + return i2c_smbus_read_i2c_block_data(client, DS1682_REG_EEPROM + offset, bytes, val); - return ret < 0 ? ret : 0; } -static int ds1682_nvmem_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t ds1682_nvmem_write(void *priv, unsigned int offset, void *val, + size_t bytes) { struct i2c_client *client = priv; - int ret; - ret = i2c_smbus_write_i2c_block_data(client, DS1682_REG_EEPROM + offset, + return i2c_smbus_write_i2c_block_data(client, DS1682_REG_EEPROM + offset, bytes, val); - return ret < 0 ? ret : 0; } /* -- 2.45.1.467.gbab1589fc0-goog