Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp249560lqt; Thu, 6 Jun 2024 02:25:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWGf1YS+0/7JCHvBgrmlo/sYNAeul203GaJU90hqEvK8rbrPEEZzorkL9/bzQU+JKTb38qfora0jsjP7kg4VrjlC6ewWMIfDnyFfzldw== X-Google-Smtp-Source: AGHT+IHDWtAcWdXE9mmauLoLbHluAOvciYS/27K65mdEa8rbpdZBZ94wFcMwcaJa6DgBUHn6VpMD X-Received: by 2002:a17:906:f802:b0:a62:2eca:4f13 with SMTP id a640c23a62f3a-a699fcdfb9fmr315435066b.59.1717665933701; Thu, 06 Jun 2024 02:25:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717665933; cv=pass; d=google.com; s=arc-20160816; b=0Oq1IMpczitN+vCcBsYDMifryI7i7VuFaQtObWbLv/gVbSIq1bw0pvBMSmJ9T+8ThN SAHkkjOXLmkpMkrGPTFFA9rB8MnK4qNRhm9CeJG2ltmxKAyWz2OWE2yBcvh/EqxwIgZC bDLngb+O4vm/Z0qjf6fTq2Gb6ySgmadrQ47dAESPlHVfN/t7UIethfiHSi8Ym8OnK0jS sucM6gRC26kn5veOS0o0Q1cFK5MlMbcU30bXbcy6qyZe1SB77Dd0dnjYDieVduFaaV9N VbtZ5hkxdHztItNtP53CvcC+dcMJnQa8jwa4HCFEnLm6hHp8rBttqr3FsinTwJYATSC0 P7Ow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=oCgaL8o9gTqW3R6MkCs66+V6tGdqOhyMZityYxhrOKQ=; fh=dz75bsg+0gpRUJ56Bb6Y26qupslZC5wD4H7qD5c1MQE=; b=vg+quNOJpvOpinU5VmoBsS+z8mfhvlkq7ZkUw7ZgP8vpjTfYmIfb1r/KbToWfgga/z j72onwbR0pljeLKRRXyNmaQdRSVsaCyGThKtCYiQ+53jZzFQePq0UcHX5eYDQYIVYwbn bqEHA51hU3B8cS2aajPtKNeEUb71BgCAoSLF5p4LP19CcNZ+fp3JATpo+7InllFp2cM1 6wowlwMcqblaGgPlkN+mzUSJKmd9+kqKFoAFU9c5xzyBKn7AWr6j3jMHBIHN0Fkr+IEu OeH8RXrk1Y0/25eaabxcHJNmY4AT1Jsn00Az83eq/JZrGE2ZWR7OEQ75UrOi/x1c6djN lV8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=bfpZeOT2; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203986-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203986-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-a6c80727e40si48808866b.745.2024.06.06.02.25.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 02:25:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203986-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=bfpZeOT2; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203986-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203986-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 41C121F24F85 for ; Thu, 6 Jun 2024 09:25:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1649A13FD8A; Thu, 6 Jun 2024 09:24:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bfpZeOT2" Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 C626E13E8BC for ; Thu, 6 Jun 2024 09:24:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717665868; cv=none; b=WUmy6UJJtRoNbko6Bqdvme92sO9tQaYBaQeWDTdFn6meK/+k3HCvpl/3kv0xmYrfxCt4tONHTms9KH/ZsXoOSMTdZFnusKJ0vcUrg56mjQdXwAh03qlUHooxIG9PV5u7NK2XxhqanGk1RQUDsVyn+tlf9RxSb1SRPrSoF0yPXgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717665868; c=relaxed/simple; bh=udXsNUhcnZ8ynFTNJ+VRVp6bj42T4g0XRqCcuRb5JXc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=umvljUAhZ80iRoX4ABxKPT9R4+sJ2JxuKSX9yrHK5I49egrYYNDMXozPWyoa/cgxz98kLLiGO4imNgfyu5MxCdKZqd+xL1V8mas/RQJGAfqBGBPWz2csHUuKuXtRQcGyhCu/09F04YNCe1chh91Ujnc6cGsgBQ2twOh1tFKSp+A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=bfpZeOT2; arc=none smtp.client-ip=209.85.216.54 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=google.com Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2c21574d8ddso621606a91.0 for ; Thu, 06 Jun 2024 02:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717665866; x=1718270666; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oCgaL8o9gTqW3R6MkCs66+V6tGdqOhyMZityYxhrOKQ=; b=bfpZeOT2jsOO3ulGbxN5iU0WItcvHCC1Wn7N83jkTs0cI1lpe4yhWJzD2ssYEWJzi/ 0YT3EFkkfrqqgxKblh7U5CZMVkJZ+5Cc0DZm6fknSk8jtMGrOHNev83QLjft35fAeS7Z +WoslQTEVfQjvkQfwTc/PAawt3wWIWWNpdvOJt39kWGIp8LIqZVhnbc7e+IvYr3WvkHr lJ04buV0AbIEChXCvX/ISxcxdJftTVwtW0U2oFExRP3I7hgur46QN6MFnlWknLp0yr3V bWSgELUA3qy6CgcJ/UNDTB9R4rnyz8rrLDXZ7FLpfburz71zBFqV20TZEWSqvJ1Mq/EL 9THA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717665866; x=1718270666; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oCgaL8o9gTqW3R6MkCs66+V6tGdqOhyMZityYxhrOKQ=; b=MHrgFgojD8idbl5+07SP8c9Saa9wn1ls9EgRKFZXbqocVjAgqDVmaT7jJCSjevUOeG qBPO4rWuG550pmT8LfweEWBzNaezIaUZrpahjCmzN/A7YFCDXAL98XdBHJ3ZTXZGZ5sA CQ7p+jQl1gV1Yev6JYUwNIEVVjoY/47iZn0lNnWkL8fZQEzp48IykyUOjItMVV28RdX7 OTaRY+hl9Ckxm3OQ5Lu+DOk6IUkt/LmIkyOhpTJOa098DVysGewUonRd/uHhPoBYobqw 7GUFJtSndpy1mi1/SptC3hpZLYY596v/g95XFQt/O9CAcveaXwhE8A0X9ozttt8WV5xp q4rQ== X-Forwarded-Encrypted: i=1; AJvYcCUekrBlrwPr9hbKYbH8867bspZq6A5daMGkZnnckBcMsI/3Et3wGxRf6pr/Mlx+xQACG4qjC2IuJl5wrbQoQmrk6Cq3emCWYkNIF8ro X-Gm-Message-State: AOJu0YxRckHcg7c7abwPqVwcCcIT8JLlS2kLP3rizumuxdYJKipQD+x6 7N5qCXePd75epSsWKIv13lCPLvTr6MFbf24Z6lQb1EJ+UYhveiWxrrMJDrNtRPp6PNCb4MDaSzv f5pxzQUKfGH8t95jkvJRcRcB0toKchNreOTQu X-Received: by 2002:a17:90b:4ad0:b0:2c1:ad46:7133 with SMTP id 98e67ed59e1d1-2c27dafd1d8mr5026032a91.8.1717665865426; Thu, 06 Jun 2024 02:24:25 -0700 (PDT) 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> <20240605175953.2613260-6-joychakr@google.com> <20a9ea0b-74d0-47b2-8dc0-2b5e7d070d38@roeck-us.net> In-Reply-To: <20a9ea0b-74d0-47b2-8dc0-2b5e7d070d38@roeck-us.net> From: Joy Chakraborty Date: Thu, 6 Jun 2024 14:54:09 +0530 Message-ID: Subject: Re: [PATCH v1 05/17] misc: ds1682: Change nvmem reg_read/write return type To: Guenter Roeck Cc: Srinivas Kandagatla , Greg Kroah-Hartman , AngeloGioacchino Del Regno , Lars-Peter Clausen , Sakari Ailus , Bingbu Cao , Zhihao Cheng , Jerome Brunet , Martin Blumenstingl , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 6, 2024 at 2:48=E2=80=AFAM Guenter Roeck w= rote: > > On 6/5/24 10:59, Joy Chakraborty wrote: > > 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_a= ttr =3D { > > .write =3D ds1682_eeprom_write, > > }; > > > > -static int ds1682_nvmem_read(void *priv, unsigned int offset, void *va= l, > > - size_t bytes) > > +static ssize_t ds1682_nvmem_read(void *priv, unsigned int offset, void= *val, > > + size_t bytes) > > { > > struct i2c_client *client =3D priv; > > - int ret; > > > > - ret =3D 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 *v= al, > > - size_t bytes) > > +static ssize_t ds1682_nvmem_write(void *priv, unsigned int offset, voi= d *val, > > + size_t bytes) > > { > > struct i2c_client *client =3D priv; > > - int ret; > > > > - ret =3D 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); > > i2c_smbus_write_i2c_block_data() does not return the number of bytes writ= ten. > It returns either 0 or an error code. > Ack, I see only i2c_smbus_read_i2c_block_data() returns the number of bytes read . Will fix it next revision. > Guenter >