Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp566449lqr; Wed, 5 Jun 2024 14:18:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXu0X8rFtxCBh5ZyrCQskdaUqw0BE1JuXKGLshHhTlqWn44LkKiLL9QKGF7to9oN1QCy3HIDamleZM6uAOwOSVqfYFL/Hhgy/OZCX0KKg== X-Google-Smtp-Source: AGHT+IGql7grjPkcbQ1mDe/JERKQEMutwRcEL0SO/+u26Z0XWbWZev00vKqVo185HrjH3qdtud8O X-Received: by 2002:a17:90a:e289:b0:2c2:3f34:e4eb with SMTP id 98e67ed59e1d1-2c27db5a583mr4376291a91.36.1717622331249; Wed, 05 Jun 2024 14:18:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717622331; cv=pass; d=google.com; s=arc-20160816; b=Ka/CsRuSPhnD+cEGu6a2rA1NbHr1NJaf7U6kfo1V5NUDWtoNFvkzMZeYmT2sO5N47Z lCe21LAWGCFIBPJWDApbAVcCB1T6c6gcni1jEUDRtGX5aMF4a/JPa8xM0+J5jkQkUgSO +smP2VwJwTiQTBhhWmgd/mYn7G9ifWe8vynFUiMzXX3iyIniWxl3qMgE9zn57fsB8z8A V4YOIjPO4rYVLsAxL+tNEcoL+z0lckEkPG2mocoWvpSL+mZfC7nzAZghTid6pq0BC/eZ /QQVwPZ/F8BS5iFQa5LGZkaTqh8HbmxFDjSExKuswrEuLaHBTfZXkcLc6Ne3fSnNXOxI D5rQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=0TC939jtnzolf29JXwiWps/F6ODviUjUE8F+jRVq7Bg=; fh=+m3CHmWbA6BTVQTjncPC7+PX829ysenZJfj85tL45ok=; b=J31+N76guBYL7MGb50uBSZw+CBipFRZ+kv9fk1Ijp80XKuQhG74BCrzIU23rxCC36i qoJOxKL6LdAc3fWuF4LfH/PJOv1CwZMmxKyRLGPnaayXqX059GZpAodN/XOjsE+lriK+ K72iRsNEBCjnGP3+xE2UbO+8TbPvZrk0L7oX/7WraSF1JTioaKndWLmNfP/6Catc4CFN NKFJeqvQRENgPKEhPiR+r7IUyPkkdO7Ew4c67zO3oScBPpWTHpbf1AOPk2pPd9BXCQNc dqgcKRp0PxuVnRRdlFrVWYjC4CYHS7bC56mkS5652jWvORQ1LciVtH57nBNRhFujJyKa aB0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=GLgiqi07; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-203244-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203244-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c29c48c1f7si28241a91.151.2024.06.05.14.18.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:18:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203244-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=@gmail.com header.s=20230601 header.b=GLgiqi07; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-203244-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203244-linux.lists.archive=gmail.com@vger.kernel.org" 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 99F0A287D2C for ; Wed, 5 Jun 2024 21:18:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B9C315FA7F; Wed, 5 Jun 2024 21:18:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GLgiqi07" Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (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 7A267139D00; Wed, 5 Jun 2024 21:18:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717622299; cv=none; b=W4UvSV5m27FoYrKIOiQREGRD+6K84SYjXQdecd04lSddfIBpcdQ7uSXsII5sQAg12DFBv7lzag8/VXdtK+NI0LqVDNgMRlPxEvNKxRaZ1z69hyjZ5Dxdpq5LLVHXSCileU0F/U5TnigH5+qfcpz71iqXceJlzeTpuPdAkMcyYHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717622299; c=relaxed/simple; bh=PohwR8Nc3tGOVCXQrntYVzc2LTggmjtaIiB8D9Q5S7s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TQ7VQMakft3o3AbqD86dxq0A4qnhci5vSTVCQnjJeeKUJSL7mxq1Qi8KVt/NiGvNXpy/odkKmAvQWKTQBg/GK+Oqhziz6aqn1Dy3mqCE/BldorLJUk+IRXz40aOPYlxXfatPDj086lkMPx9/1t075zPrmMgZjpcV6c/WYlv27+M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GLgiqi07; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-2c2999f969aso266485a91.0; Wed, 05 Jun 2024 14:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717622297; x=1718227097; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=0TC939jtnzolf29JXwiWps/F6ODviUjUE8F+jRVq7Bg=; b=GLgiqi07/MSvYFoKe5KyxJxMatiS1/XeL76Z7KKKezOVeDU/i2VvuSrv7mzgPl1IO5 deG6KP5QB98PuJT1BAkTafqfCaBXt3am507pLu94RKnI2hHNeroLDgKLEhoC9BX+YJcd AlRpacHW5ypLuEqCEYgOYclRprrWXvyok15E925V0dIeKfIACny9WD9eo5qYzioQsHOL GzYDG72r7Jc7wQYXUeOv6tNOhZtbiiRjrMRyAo6Oi9Zrfj8Lhu5jMFTREbQa/P+xQp5m 6uJSph+i5hJtC6Mqz9IElUhFF8Tet7PQAq99mz/qP8aVe3dIxVqmXvTHQhHqHFL82A55 4lyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717622297; x=1718227097; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0TC939jtnzolf29JXwiWps/F6ODviUjUE8F+jRVq7Bg=; b=qZjWlTohkHpmrBF0IZ+X/1fVS22ndZMYxArbgmk2UqsOStJpaopZtXBTv3YmB1l/32 0Fldm+JqDBpGUQc1xt9WVIA4DfZzdB0V9gTgLlbiWvvLDCivxmxds4TLNzvNIKRCMC+n o9yCiOPlTQdmThUgsNID/R5ENq/8VWbNKUNaTAoTnLaP2NHnelpolYyErVf5YrtdZ2Hy 02ORb1Of/ZT5+2lrBkcz20ArHvk8djQZ6atud9LmXm5XO6N2tu9W+xjhqH+9G1ZU9BIh dEaLN2AobV5xI+m+/uLsNEx4uiDKE+96P2Xea2Aehi2jEltHFtrr110VSL3HZIGHy9O5 8lIA== X-Forwarded-Encrypted: i=1; AJvYcCXRkSyAKPE04VLOJhBa+6LzeY3GciE7YlBVAVhKbRsV0Fi05nzjAEVzLcMkOxoi92mFdMqVWlq/iVcP7337RmbFp0+HELZUkiL+k4ZwNzlKKPexWnoGHD4CcOunyN7/ZPpcANjW93JUddPKmCxq1AedamZuNnkj0wiPR0yQuWxEjryjEJlexlXdpkJJYCcCaWEZmL1OAKC8Zpbn+YdJQ7hwl+SGY3k+XbgmgWtgNp13/dky8uXEG87KHBBZRrrqCWrzXBwFKdKdwpKsHm+9z188R8s4eFmvZyqwfn9H/7y3oPpv1UauCdfKon4Y2R5WiXa9Bm3zejRnT/AkzS7zD4rYQ/hzH5niD6OXGX9DYVM= X-Gm-Message-State: AOJu0Yxirisr15ZoGrB2T5y4nuVkxatPNwNa67ptWz2rfpUGyThCC70K 5hovAv51BZSKoNYGnixOFPo6WsddGoJO1WB/kU+0m0HSGN0gk17K X-Received: by 2002:a17:90b:128e:b0:2c2:8d2c:8292 with SMTP id 98e67ed59e1d1-2c28d2c8317mr2042051a91.48.1717622296577; Wed, 05 Jun 2024 14:18:16 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c28066d59fsm1922215a91.24.2024.06.05.14.18.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Jun 2024 14:18:15 -0700 (PDT) Sender: Guenter Roeck Message-ID: <20a9ea0b-74d0-47b2-8dc0-2b5e7d070d38@roeck-us.net> Date: Wed, 5 Jun 2024 14:18:13 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 05/17] misc: ds1682: Change nvmem reg_read/write return type To: Joy Chakraborty , 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 References: <20240605175953.2613260-1-joychakr@google.com> <20240605175953.2613260-6-joychakr@google.com> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/s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qMSA43VKQ7ZCeTQJ4TC8kjqtcbw41SjkjrcTG wF52zFO4bOWyovVAPncvV9eGA/vtnd3xEZXQiSt91kBSqK28yjxAqK/c3G6i7IX2rg6pzgqh hiH3/1qM2M/LSuqAv0Rwrt/k+pZXE+B4Ud42hwmMr0TfhNxG+X7YKvjKC+SjPjqp0CaztQ0H nsDLSLElVROxCd9m8CAUuHplgmR3seYCOrT4jriMFBtKNPtj2EE4DNV4s7k0Zy+6iRQ8G8ng QjsSqYJx8iAR8JRB7Gm2rQOMv8lSRdjva++GT0VLXtHULdlzg8VjDnFZ3lfz5PWEOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <20240605175953.2613260-6-joychakr@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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_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); i2c_smbus_write_i2c_block_data() does not return the number of bytes written. It returns either 0 or an error code. Guenter