From patchwork Wed Jun 5 17:59:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944018 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kbfMriuF; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=Tfm7Fl/S; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvZxp2HY8z20KL for ; Thu, 6 Jun 2024 04:00:30 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=W90x8eSICvzGS6RVfwtnc/uGnzf8afyuD1/bHdaqwr4=; b=kbfMriuFXysNCZblfTfa1XJyxU ezP9qoX2Hd0lC9KkqupcTio5mjx7Xj9qLtw/DYhCCzZHZi3N0FFd9/dyNiwwJ5PvOXP1X30Qtb2IS lQEL1n0GqD+ZXA1wRvCHUCLustid2dFWk3eWzzpgM7A1jSGIivMQyXdxX21hd9rgLWy+4i14zbG2l nnj9AXEaV2ntvB1I8feQBBBsCM6L/QGIeu3/ISwHwNmChZQCmeXIJsvai+e7itomUE6qnL6QJCC3c 6hafqrMd48YdDQi3Z1x/N61XY+Jvg1YCrsj/XdoSfX+wHGtzPUk8BSe+NLm2zFO1gCW0R1rt0QRQf QQ8GejJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuvr-000000073GD-1RSl; Wed, 05 Jun 2024 18:00:19 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuvh-0000000738w-3z1F for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:00:15 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-df7a6530373so127537276.0 for ; Wed, 05 Jun 2024 11:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610405; x=1718215205; darn=lists.infradead.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=nEr10taYCu3WGRiwn+CGqfggqJNbp7A+We0V3ygommI=; b=Tfm7Fl/SzBvtHEu+ztBK+Ax8vvfRfVmwL6loBRTjvq+xNmyJsjTbsNEXf9cOflOQwY mzYv5GEvqlfcvO0x2t/iPgWlCdGxAElzOzI3OYgeGuPkN1LLzR+3+QnrwNMwVYHV+r7l DE1E+M5xXsjO70PKtlf1jUvg+aU/aaiL0qAUqobOPRdUQTxpBrus3daZNk2ULDrjin9m nWCbi1zhdvPv+U2fI/1i9kObsbZMN3zqb3QlzR8UVAHI/6Sen3I8E61ZbM8ut/OtTqB/ so55y4GI857AsqZHMTogbf1p4vfTPJPMcK+GJYXtX1gH3v5WDcm1bT3O84ppqlwMKiZy IesA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610405; x=1718215205; 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=nEr10taYCu3WGRiwn+CGqfggqJNbp7A+We0V3ygommI=; b=VB87kTfj5kyqHy0AkfIAOPS9O5zdCMR3C8ajETscM8/uQH2taaw1WtGBK5uvPrmpO2 Jt4RcAAmAnLKcoVq3uB5w6eNoK/QAjNh/xlxNKO6a+Q5h0SJHDiHLFh8UqykthyG9vuj k3EPXeA5LyeweeNLIaUkkDjrOOxFX61SFyhDE9Lu9xdYhvr0bhTfxsc2HQl3xvwXV+8s XasOMc4YCfdbXJvaEzYXmb8uwRAbmn1uvchfPONHW6d7sf5xzSRLd31mqjbr5XMAPIu8 EzEbWKu2FgjV+AK2IBXSOwOoJa7mPU+tdLEYtl1Z3F190NMLBn3zfSVdQP7uw59z1mwZ oBpw== X-Forwarded-Encrypted: i=1; AJvYcCUDPD2HjmlxaH/QjZaUxKjpOw/iWj3bmHfk6SOKg5l61whZ3A8eFejoqU4iY7fbB3wM/paBAttq3ry/bzbeHRBEZIfZTXc3nTaet0syJQ== X-Gm-Message-State: AOJu0Yz3b1B8Yk4W/6gxana8/qhwXF0Rt4DWqj5/XmmTJ0Xa2ygipGVg 2NYNo8YmsFpIXAnz/eYGuaZ1OajK6Mb6pRtovnNp9t5jDM1wqg/XduYlPkJ/jpOokLM/GOJVHOW CMM0zfh+7dQ== X-Google-Smtp-Source: AGHT+IEFfd1XOUpmBlCQ8OC96XaGHvsQJFoGDWo7KSg31aa/FmwG5qSwwUZMqSajPkXkOc1t6VuaS9UByNrZ0g== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a25:dfd5:0:b0:df4:eb0b:8fd with SMTP id 3f1490d57ef6-dfade9e0f4dmr76066276.2.1717610404805; Wed, 05 Jun 2024 11:00:04 -0700 (PDT) Date: Wed, 5 Jun 2024 17:59:45 +0000 In-Reply-To: <20240605175953.2613260-1-joychakr@google.com> 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-2-joychakr@google.com> Subject: [PATCH v1 01/17] hwmon: pmbus: adm1266: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110010_090250_AEC9196E X-CRM114-Status: GOOD ( 11.77 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/hwmon/pmbus/adm1266.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:b4a listed in] [list.dnswl.org] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/hwmon/pmbus/adm1266.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/pmbus/adm1266.c b/drivers/hwmon/pmbus/adm1266.c index 2c4d94cc8729..7eaab5a7b04c 100644 --- a/drivers/hwmon/pmbus/adm1266.c +++ b/drivers/hwmon/pmbus/adm1266.c @@ -375,7 +375,7 @@ static int adm1266_nvmem_read_blackbox(struct adm1266_data *data, u8 *read_buff) return 0; } -static int adm1266_nvmem_read(void *priv, unsigned int offset, void *val, size_t bytes) +static ssize_t adm1266_nvmem_read(void *priv, unsigned int offset, void *val, size_t bytes) { struct adm1266_data *data = priv; int ret; @@ -395,7 +395,7 @@ static int adm1266_nvmem_read(void *priv, unsigned int offset, void *val, size_t memcpy(val, data->dev_mem + offset, bytes); - return 0; + return bytes; } static int adm1266_config_nvmem(struct adm1266_data *data) From patchwork Wed Jun 5 17:59:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944022 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=LDO9CyNU; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=CYN4WXdk; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvZy40538z20KL for ; Thu, 6 Jun 2024 04:00:43 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=YK/lKUuYEnC9aStADkzPhn4SwxAZ4bXpjjF77w/ViWc=; b=LDO9CyNUIKXzlhmf+V1qcNB7ij Ilv/NyOw6aGe7m5S0n2PaIwo5SGv8s7FdhE0KAZYLOu5KwEClE1101ZRvzQJjqycjGAw0Nzm0e7vy Z8dYH8L2DhHUD1dYBmr9eRBoHxTarj0Zi+cb4grFM00PA8qWkyeQziR4iAGL6AkKmPSHAVUfN4u8e UU764NwT3wLgkClUu2/SQ1cdc5y5rjQogi3cnRGcqKD54zZQn/7r2PpqCe6xDPJ39GNOw18bp4i4X if+bKXuM+ayD48ghZZ/gTPtW+Z+dCmdyfE9FkUALULlGVWAEodIT4OCbcCTT9LK2UcjD4kTzh+qH3 rleW0Xew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuw1-000000073Om-1DEi; Wed, 05 Jun 2024 18:00:29 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuvm-000000073At-3n3z for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:00:17 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-627e6fe0303so278457b3.2 for ; Wed, 05 Jun 2024 11:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610409; x=1718215209; darn=lists.infradead.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=fOg+UnJ80V7MsfirTppZcqaQfW4UzyZaf6xSdj4zJek=; b=CYN4WXdksiWsFe0Xt0EmOQkJ6hKZPJW6wU913/6LgpvSNOi4CtnN9lftC7feBoHj4/ +bE/FzAZ86EcJS808FiqDR/Y8Q2lJvLir/smaeVC8eMBNie3h5CKLfqL/8wwAslGG2Kn gj4rOz3wUQZHRL4IprtZKIeYE4wlb+qDPoZ8PC0aV7aOdrYy5uPqL5WANrqNYR+GdQ6l 5xjVeDd3vJmpfuMKRKVTyiKrbNp429qknLzVsufQAygTGt2mSa15q0YOzJLExecF1GP5 mjRzQaoKuNJkvE92ERm8zVLzO/qMbc08nTk9vPjWa9djEj1sOcbQi5ug1zmH9WfL20Fq 5/8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610409; x=1718215209; 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=fOg+UnJ80V7MsfirTppZcqaQfW4UzyZaf6xSdj4zJek=; b=SpD/m7hxYG5AxFHnI1Wq/UCDhcblGvcLcboccCBLRvUjUfxvBdvfRZFzHNeZH8Qx+B 6e580I/1417cABsXoZPqf6WNoUR35uHtxM4ils4XPcM5FFzvo0l9MsZyLO5Tc2qpxadl 2sAR26IOkxU7r4otbrKmmLipKDrPAt97MLDfDlUH91pZn75wt+XetLIiRAIh4uP9JdUI n2b1rFmBMN/3B1CkoB3gO174mzgBQXGXOJ3UTugmgeDX/5SuD7C10KZDzp/euaxMm1VE OTLgmcoxZxMYaHNhghT6gr1sAGppjEKP+cro5kZSughpU61sUG0VWJXH9kK9U8UN733g tTHQ== X-Forwarded-Encrypted: i=1; AJvYcCXCpi9Lw0oB3P6ch1h9yBjPRZ0G30PvSeK7xvfJOxVjQkO88GCMUa6vvOrnQ2KQEatXcxy3yUoSx8qmdG3OE50cv06qAF0KFap7mPCCuA== X-Gm-Message-State: AOJu0Yz7+sLX2fmZ2B9PFUZ8PqlAShBPC9N2+0IXGQxeEhKKHgKz/6Xl aBaIsXF9PA794Aa86FkhC9X1tDVPMJNTO8ZIf02ZEIiuODEMyuotRB4kTWGuuXjj/P27HqaqwoS J3ED9sCu9/g== X-Google-Smtp-Source: AGHT+IGVqeHwMyqXKI282yIc4vrmNhlrddNc8SUJnwKBYMg45bAMjkiEv9ztSUrQcKvlvHzhm96dBXxGRdgPkg== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:6902:b12:b0:dfa:7282:d6d4 with SMTP id 3f1490d57ef6-dfacac47b9amr605485276.6.1717610409394; Wed, 05 Jun 2024 11:00:09 -0700 (PDT) Date: Wed, 5 Jun 2024 17:59:46 +0000 In-Reply-To: <20240605175953.2613260-1-joychakr@google.com> 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-3-joychakr@google.com> Subject: [PATCH v1 02/17] media: i2c: ov2740: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110015_000589_BBF0BF06 X-CRM114-Status: GOOD ( 11.30 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/media/i2c/ov2740.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1149 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/media/i2c/ov2740.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c index c48dbcde9877..0101ab55a5ef 100644 --- a/drivers/media/i2c/ov2740.c +++ b/drivers/media/i2c/ov2740.c @@ -1212,8 +1212,8 @@ static void ov2740_remove(struct i2c_client *client) pm_runtime_disable(&client->dev); } -static int ov2740_nvmem_read(void *priv, unsigned int off, void *val, - size_t count) +static ssize_t ov2740_nvmem_read(void *priv, unsigned int off, void *val, + size_t count) { struct nvm_data *nvm = priv; struct device *dev = regmap_get_device(nvm->regmap); @@ -1241,7 +1241,7 @@ static int ov2740_nvmem_read(void *priv, unsigned int off, void *val, pm_runtime_put(dev); exit: v4l2_subdev_unlock_state(sd_state); - return ret; + return ret < 0 ? ret : count; } static int ov2740_register_nvmem(struct i2c_client *client, From patchwork Wed Jun 5 17:59:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944024 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ZOpyjri7; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=1UL4KDKP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvZy71R1Sz20KL for ; Thu, 6 Jun 2024 04:00:47 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=9dMs9Q71rYOg2i/GzbJInU1ylrhrPk+uUEhO+kc/M+A=; b=ZOpyjri75uxT1fsg7wSYephPhI IZoBeDh207a+prsWJ7wcWMMQgOomIhsSy6aCYb6zM5j75a50Xdu9NrUCqF+XhIV4w89D6+toGeAhn g4mcsovsdawwbViN10oaceXOjUsx9wu4wOqgaoQ2gi42BK8fe4UCGF/zBcI5wu5upFv7jSIE3ZTso h02H9SgbzA7GzzJV6Vvhg7crb1ZTuA/yOtKlpNQu8H5CGzgmZ65ZjWzz/800lGyXRhGctTGxh1JaF tHXCS8Y2qBaZp0554UjqinSnw2E1U2QHd5wJ5WxqvMGMmsSbsmOklCZ7qNNAGBFGdAB1+UiLTN1xh gxxE07pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuw6-000000073TN-46W0; Wed, 05 Jun 2024 18:00:35 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuvp-000000073Cr-3ylu for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:00:19 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-62a0eb1c809so264887b3.2 for ; Wed, 05 Jun 2024 11:00:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610414; x=1718215214; darn=lists.infradead.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=qvmsbFq1f0xb8qTUeLHIrwaOpt4YNpx3HYdX4+QrPhA=; b=1UL4KDKPz8BjQ2nQUK1wAI9AVEkK5QoOHEH1zd+mFQDxnQtU+Wo5+9+nBBscBO0tE0 KRtD8BT6UO2wZU0gnRr5WKqI1Ktq6rhrFrQG17fkzufK4IlUL5zu2diNsQ70sqHY+44s ZeQE2oCW+AFnfffOOhkZEJJQ5P8bdQoEGcdhYXkL93xik0IaCY9YGniEuY7Vpxv4xqTM 1gd8iJW8rylEY7Nw8PDxrsaw2lZXLuGWx4yXo8Kz2YZEeq5VeD4CThxud/5W+Exrt5/O IlSsQvNa5Q57iUYtx07OacZiAB2SDkeYv5TvteEJtLR4M0zov49A8NIm9LX5/F1LBg2p vbTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610414; x=1718215214; 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=qvmsbFq1f0xb8qTUeLHIrwaOpt4YNpx3HYdX4+QrPhA=; b=pLqQRKjISoEX2VdRSy/mEoHtX/B51U9kryRG/+BisTGMdHnCn4iIHigdk+EOCfb45i frqDmVX7xcwICGyGDUYxJnT4FRvvRx4ywwj53fwy7qaoR7oUnA6fdmdzdFwklKyt2OyP xK+FhrBIKpSpfIlgKK9baQ1PuUAiOP3/Er7MBzjhTQppZmOJ5bUWCWDRPPzlXHqIePnm u6uqXmKIOMSGopRJfA+rQMlxoggeZVFizAdLh5Zp68YyvjYyHBUVSHi/igEEz4Y8abtz +vp4EVgUsCb4+iDOPVWXAy+0amvJdKBfsyzwfWvZGFtw7mwv2mSAmjyKbhqBMALW1HWk rY4Q== X-Forwarded-Encrypted: i=1; AJvYcCXbV6tG8+y2gm2RNoBbrgZf6i/gp3FRysHaZHSB3S9S7MzX3aWcfpsSzepo1T6N8ksjefdN9v10sA2YClJJYCVEEYaeym0mI66TieiZdg== X-Gm-Message-State: AOJu0Yzs/5c1X7IgEwZ0DeCaViw7hehLiM3lKuV80AParp80ybQZufHd aZFW49nwoojA1ndf+nHOSEpO5yynI8lWMEnGWwI2GDrme/bUAC7Igl5z4pol4FWimrNT07/ftF4 tN1C8ATpcbw== X-Google-Smtp-Source: AGHT+IHixjuOYQ1InGCAjmo87JHH7BxdpNaY95UBwdRBHB8eZTSP6/tJXCeai8kdlzm5GsjEUY/q6O3hk54taA== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:6688:b0:622:cd7d:fec4 with SMTP id 00721157ae682-62cbb5e6bc6mr8437267b3.9.1717610413829; Wed, 05 Jun 2024 11:00:13 -0700 (PDT) Date: Wed, 5 Jun 2024 17:59:47 +0000 In-Reply-To: <20240605175953.2613260-1-joychakr@google.com> 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-4-joychakr@google.com> Subject: [PATCH v1 03/17] media: i2c: video-i2c: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110018_021349_17975DB8 X-CRM114-Status: GOOD ( 11.12 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/media/i2c/video-i2c.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1149 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/media/i2c/video-i2c.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c index 56dbe07a1c99..2bfc221b5104 100644 --- a/drivers/media/i2c/video-i2c.c +++ b/drivers/media/i2c/video-i2c.c @@ -151,12 +151,15 @@ struct video_i2c_chip { int (*hwmon_init)(struct video_i2c_data *data); }; -static int mlx90640_nvram_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t mlx90640_nvram_read(void *priv, unsigned int offset, void *val, + size_t bytes) { struct video_i2c_data *data = priv; + int ret; + + ret = regmap_bulk_read(data->regmap, MLX90640_EEPROM_START_ADDR + offset, val, bytes); - return regmap_bulk_read(data->regmap, MLX90640_EEPROM_START_ADDR + offset, val, bytes); + return ret < 0 ? ret : bytes; } static struct nvmem_config mlx90640_nvram_config = { From patchwork Wed Jun 5 17:59:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944100 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=icTrOpnC; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=3izzRDs3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvcJz0tSLz20Wh for ; Thu, 6 Jun 2024 05:02:08 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=D/HsoI4hNKUI0RE5WtYVW15jh3S+Ct/IzRZdH15rFqk=; b=icTrOpnCiQVPxd2fTEjEnlFzLG XLH0q19Ssih7Bqz75bfrQG87/UWZa/VCRocRurjhLUFUrHXTLd5ejCpSW880jnqkE9a2TNguIz/mX hrUYI87kciSpRKEk+FLdhz9jiNy4k82papdRt5tumtPdPJ8vEBjc3BYiknySYE3h8zemSaQrbD8AK ZEAf89dTDEDkeg2CGHROICtDl3a/b71PlA+O4TEbwGkJLDTQ1UqGczZYMlVAOhEYzU4J91gMkQyQd zrOpTloaEVxWDcUPbqTILqxZ618dOiE1CObbF6YFY90d6NIk9KFyO+T4DAF6XB2teU04BN4y1WC38 65mGu66g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEvtT-00000007FXD-1v3N; Wed, 05 Jun 2024 19:01:55 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuvu-000000073Fa-1UCj for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:00:25 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-df7a6530373so128328276.0 for ; Wed, 05 Jun 2024 11:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610418; x=1718215218; darn=lists.infradead.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=AwIs39A3C8kh3vVRuRyRYkps3QbjGarBaeH82L3DU0g=; b=3izzRDs3YSqxJaztguej5MpeKR/z+qM9sPEGdEwMav04okB5J/1iZSYdj0cCQZpQXF tmQgyUIZx+FVI44l70AS/B4iUYaQTtb8FQjP9uz5PuKbFkGft5O2jz6qb5CxDyHLn64g JfN+8/L4Ju7Q7gl4AK8LlGe035qqaAJwcuuHrYROUAVguTScxtptbBGYU1MtD88YTvYf evHFcHGgIv0GTkKVgETbeZSa04BhoAMmXPU1KcdeXCN4Na7EcmkZ8XacylS9r20mWw94 PMcqXwUTDmF56atof7hL949YYHM1hYysUmnv+lH3jGWueQMW/zneCnaBpZp5ybcvrgeb E0gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610418; x=1718215218; 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=AwIs39A3C8kh3vVRuRyRYkps3QbjGarBaeH82L3DU0g=; b=IIwBuNfuOwhASm3QOytqG1NTyuOSGypcfX7wTUiE8hTfQOR8t0FadxlWJ/TJYTKBIu EQQtrWFkQFPKVeagP4LZBFcts5Z45Jl/K1NG31VA4NAl8mSqOzhn3Cv3sDbxZaCgHFom iCduN9oWq8csgr5dogWPeyR2WVa6nW47z2beFaJSJZu8EHLPsa3CLa6RqV0XpPBJrjts swGFQhjFHycmL+gca1o3g1IP75L3GxFNCXaKsH6ReP/0kEhUKWLa6zVoIxnpwMISPEhn DPl9dmVUlLqylWosCckP3tPkQWs+KimwdckVYsTpP0FRrRRByZpAoZ9g3fuswBbMZ4B3 YzeA== X-Forwarded-Encrypted: i=1; AJvYcCWjVLl7oSQLc0dp/63pIVEa4I83I+sdTUKJPdYph6GxfRbXWHEyNrM23yw2JXk/y4UVEg2y3MBrcGZNEqtptEhvcVOuj4W5WbpDiWhmIA== X-Gm-Message-State: AOJu0YzEZLrsbrkEl8xaoR+rc4HwUMtVLcwunYEy6KCWw9dubdNK3Oq8 R0ZYaGCjJeVTzXfjzniyNCI5ZM/7lA/gVP16w7YPWPezpoHOK2QnhDrWPx6OK+bgCWeThMjXbr2 rvEJdHSaElg== X-Google-Smtp-Source: AGHT+IF67RE9Tjmuj/kq/k/X6dA78e699FHOj3MI1LHmpXg9uh50LZwtSgAXRWUPUOYrgrIfYkhy+wDlS5BIsw== 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-dfadec0b255mr68711276.5.1717610418012; Wed, 05 Jun 2024 11:00:18 -0700 (PDT) Date: Wed, 5 Jun 2024 17:59:48 +0000 In-Reply-To: <20240605175953.2613260-1-joychakr@google.com> 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-5-joychakr@google.com> Subject: [PATCH v1 04/17] iio: pressure: bmp280: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110022_583855_92F6E6F7 X-CRM114-Status: GOOD ( 10.46 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/iio/pressure/bmp280-core.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:b4a listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/iio/pressure/bmp280-core.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c index 09f53d987c7d..8d5aeabfa297 100644 --- a/drivers/iio/pressure/bmp280-core.c +++ b/drivers/iio/pressure/bmp280-core.c @@ -1465,10 +1465,11 @@ static const int bmp580_odr_table[][2] = { static const int bmp580_nvmem_addrs[] = { 0x20, 0x21, 0x22 }; -static int bmp580_nvmem_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t bmp580_nvmem_read(void *priv, unsigned int offset, void *val, + size_t bytes) { struct bmp280_data *data = priv; + size_t bytes_read = bytes; u16 *dst = val; int ret, addr; @@ -1518,13 +1519,14 @@ static int bmp580_nvmem_read(void *priv, unsigned int offset, void *val, mutex_unlock(&data->lock); pm_runtime_mark_last_busy(data->dev); pm_runtime_put_autosuspend(data->dev); - return ret; + return ret < 0 ? ret : bytes_read; } -static int bmp580_nvmem_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t bmp580_nvmem_write(void *priv, unsigned int offset, void *val, + size_t bytes) { struct bmp280_data *data = priv; + size_t bytes_written = bytes; u16 *buf = val; int ret, addr; @@ -1582,7 +1584,7 @@ static int bmp580_nvmem_write(void *priv, unsigned int offset, void *val, mutex_unlock(&data->lock); pm_runtime_mark_last_busy(data->dev); pm_runtime_put_autosuspend(data->dev); - return ret; + return ret < 0 ? ret : bytes_written; } static int bmp580_preinit(struct bmp280_data *data) From patchwork Wed Jun 5 17:59:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944028 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kVrxPEF+; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=LXVFdLSN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvZyQ17Skz20KL for ; Thu, 6 Jun 2024 04:01:02 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=VfU8CZchW081lFYNYSmpEXpxciBRhftW5eoI4/u0ozU=; b=kVrxPEF++t020dV2QE9B+UIq2l 7zmakCvwpNYo7/q2pSZDkFywYuJY90qPbsKSQxCs2C2pC66242aZz6NP7lK6FG4ho7A02YMaODgkP 2YxDXuzH3YXN9Prt/JGAjThtJGBAajOxWeK/LJqOr/qiuoZfqGKXJEm9+/GmvCD7LARu4V6K43Rhl T30Xl0t3gtFFUocfcOn2kCR28oWoj+VvDmAu5+pdyao+gh4elAgImDFcNqZAmmDBdBhur4YCxKkCE UtRNZ+5tmULGWUPKsjL0jhCGITbuQVt4Nf3mRT57ocL+PrCAjoAGDi4U4otdRqmWnAiOsDH9J0fTt ZonuIy8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuwN-000000073ij-3Iw3; Wed, 05 Jun 2024 18:00:51 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuvz-000000073Jh-0sHf for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:00:32 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-dc691f1f83aso23619276.1 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=lists.infradead.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=LXVFdLSNn5f8aX1v/sXHtqs3bcIUwvw60RsKzj2iM9bZnhkzjxQOH5vgGrJ1kw5r3V ftJBu0wjezQSsANOg4d1VJbOwxj/nyHX7LDpKUatbQtQvj35QeFIqVmnkQqR5Aedl14e l0rS2s9l+AHuoCEknZK8h/tHw3o/6i1/qdna4Q0bRTpMPyw53nfCCcEXYqVFtOi5D+qZ I7O3KmJCxEL5eZixpzDCUcz9HSSLx4G4qpp7Thme1YNwexIPCXi2tHrMTWYfOybefIpe Ioq1DrJyIdpb8ihs74NCQ3ogFIBf4E6jDROdkzfjtvy+/p2lGFEeT4upAnCNHmn/eV/s ot3g== 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=wnOqku3mZmij9oJQEo0qMa8l6siTUTgxiXuTaUZJkfqeb/f/6n2aqRKGEe99QT+0AI sNZ/dtDZqjh0vx2gnRe+O1TX67vJOoWFoBLRpCD/OROM3XO5AkTR7tvWqfqn/6BaTMgW ekUm1jcT311XCqB8XTRep77meR/oPAwPMo1JEW+Dw2C5yrFHfFV1sOkKWnOANpebJKx0 upc4A9iIcEN8vdaN0B5QNlljFwZFJjV9c1QPVd1WKWKj8C/9fHx34qndNjq0Nh4Bqa7y /4qUSHtyv6awS2dbWLaFp3TjmsEA0CPmUn9YEuuwpJaf4FcR8x9jD1WRkh9LjMWTUZ86 vSKg== X-Forwarded-Encrypted: i=1; AJvYcCVq36eBoW+YRyHa6TyE2cHpu9CxatVrHZmZPUaMjs5Z7y9H6PMWZsavlRoB9VPCQw3bSBQCn0l5MQnzXUzFtAPRGLhV5QhK51K/LmEgJg== X-Gm-Message-State: AOJu0Yw9fz7kYNMREeKyr68iLkV/g74JqoxqHUa9ycp/qn0sKn6ldivu 9KtNVJbDe4Pr7RpzzjWKughLhL43v05pur9hhCj+hfRTCTw0jZ9+FoD53U08VFZFhsC6M6HBc+d JjW0+F3zisw== X-Google-Smtp-Source: AGHT+IHzBpKnrggHmMHMkvKX90wRDGnyxC/rya4wNnolxBy/S7eZxADMs2JOhL4gs65LRvS4Cl380vcS0L4//g== 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> 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110027_533365_406F6301 X-CRM114-Status: GOOD ( 10.47 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:b49 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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; } /* 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: 1944101 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=LqAj3VTz; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=eHoQbCRQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvcJz0nlxz20KL for ; Thu, 6 Jun 2024 05:02:08 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=HZrBYfJCeiop7lJvi7/qlvNeGjZsi4rJdyFUp/sJl9E=; b=LqAj3VTztdLin1ywVF2aXEeUzf eP02fQ7ozExLkBO1xgU1cuYU3cMWNh9AwI5xBvWw7sb+d9HKCP/rCuLDd0n7CN+Ft45ZRje9HJl0k pV8aJl0E0USUNvVW6gBMFcY26R8uoCeYPr86FP8KbyqhV6oelKbGFVZNgggoawiYkZD9SR42Q/FsI 1ZsVmlnUrJKzIExUBIedT6fC528kSU9Prn4VeA5Jy9ZDkI89FxcVKrrOZ6ELNyZ3bFmVv+mJC1qP0 ImWtZZmil1/FcwOb7EojTnY3Ijs9PVbkFXMpHaHJJ++XtvkFTNM9IWnmAoE6HtAta/6PW8X5J93j4 uTNlfhOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEvtX-00000007FZI-2uXR; Wed, 05 Jun 2024 19:01:59 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuw3-000000073Ml-1X1s for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:00:37 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-62a089511f9so15304297b3.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=lists.infradead.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=eHoQbCRQWdzbk7jqAn75VRv068J3wp+Cl8xeWBjZ18byVpf9+X4lgl0/CMmIrR/Gzv GoJl66vo4YXkPAJ9xRm0DFLd8XcY3R8EihQo+kYvUafcWsKPJSlcwt08gXi5dPcTDAq9 NRKcsgt4PLDOqfXZqZMjvR/8a9xUQmbykuPQAF7YNBjfI7U9rWywpho1DjlVS7FZMBrK rk1YUhXEFqyCM6sYe3RTlWixUA2WUeOzvYTfDRCeY7lLtbahDuSTuKs8xoDPIY2A3rmF RPzOmWkhjG//s97r5GdU/FzAUQkncWD+GH6nfdN+YYe2xs/3ew6I1/WcUTJyUHPE0wCQ ysYQ== 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=a5sIOTHhNOlbOI9kzqV0+K5Nk7tAe/ln9rtLcDToho0/5El+GR+latg21b8ISdIVQb VrqI1SuZMjbi6D2otohOBK2Zvo2mUk41CByOfsthpCxMZwlUCFVxc4aHO3FBZX3KrG/a JzlsOl3b8SrHXvIAnU9BF9TNk2/XlFwN+Lv7GPztR5n341juyIZMrUniwZzFH6wc0X7X R+Z7W6BK2gbG1V22OgPr23zOAv62ocF7TpYr1EEdbTLIVO0KvjDxP3y0tzVCYm2lENCq T5T2rwJHCU3pzNPX/Il9tg1Y+yj2RlidC0SGN5c2fvo3BdpQq+psQNoH7Hiq2Ab2SHSJ 9f8Q== X-Forwarded-Encrypted: i=1; AJvYcCW5e4ohohUEkfQQyGMVoS31+HYYyGHWI6Wk48xpTuO2h+iB7oobcCzbnF/f4553gHmBIx/17s1Cyilif34HOGroGsSlYeWo2W5pbg7qIg== X-Gm-Message-State: AOJu0YxhloeBA+KTs7ArAWtZSTxtPGMd5dSf0eO1RkDfJ2dur4lGelsC 5AGjt+1XKRxEy6V4uMOZ65FuAa37NsZGMt2+ONfK+VfYW6aNP++5eXEZMg2+ril6eP0PnMDafos Ot/B7dnOUsA== 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> 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110031_947161_2262928C X-CRM114-Status: GOOD ( 10.92 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1149 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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, From patchwork Wed Jun 5 17:59:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944102 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=iOmrq96N; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=ckwPFo3b; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvcK91FQtz20KL for ; Thu, 6 Jun 2024 05:02:21 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MoOiEXm5a/tBM6X7/AzNu9/9K/1c5ydy8+tB2N6Tro8=; b=iOmrq96NeieZGRapi0MPEijCSV JR6PoWB7wmDvTwVQ8pBQ7xJbksAnJzRldP7tEmkNhCNTQUx+iO2WNQ/Ggf5Yzj3yE/N2D7o3i05FP L9wkFKQTA2YD2Q9ABW0esGrEmC18eg9+AWU1ieJuOwv03i/Wci7hDSTRSWQCfDaBndrAM+kJE7S1R T2zn7iLcAju8PxotDpKWa6S1XQcnGX5N6GMlHoGWa3kBrI/WTEwgPPBWzXyg4Re/43mCxzKStI1Ve sujZv6Ur2ubcMXW4QmsCNfd3Ay74xZU8/nhO/Akg6l3oEpGbWk59CxTv9MzK4k0ZJD3yi9rgErGrP DEKLf9RQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEvti-00000007Fiu-49aF; Wed, 05 Jun 2024 19:02:10 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuw7-000000073QK-1TOw for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:00:47 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-62a3dec382eso603277b3.1 for ; Wed, 05 Jun 2024 11:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610430; x=1718215230; darn=lists.infradead.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=GabZAVwK9FSl0VODpa0rRnhc7Hb5WIAFsUpyNY/Jkgw=; b=ckwPFo3b9FzZ80AXhPlbZl9Sp8r43TS+dCRvhO72dZkNabZYg/mR+slPHeMij7v64P gm7DBIUCb0VUA07LPR0c7q5xiOTg99kHOtsolNDGvqaNtSUeoYeLmOm0mHZKlwyAYKK0 YpL0Kb/tYlzvP9+tknUPPJoLieCXOxQ5T8GqhhGSSpFUxV9/NLQstOqTs/UbUhH+fo0B vzfwPS5udHr1YQLaojwb96qidYiTc7EBR5Ly1GyBb3UgEhkbwXYuhvwKEt8NrzDujxeb bKDXcC3SV98mPeXU3HRwcwo8Tjwuvsp7/CSwJGm2Bawq2OolT7NVN9O4Xwyo5Lv0x8un v/Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610430; x=1718215230; 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=GabZAVwK9FSl0VODpa0rRnhc7Hb5WIAFsUpyNY/Jkgw=; b=XQT8XmO/1u+3OhvrQx2iS2m9jN90IhgS+8pIQNEjPOzqfrqDY5eRzVYzi6ZhDO5O9t bd3JaaXvrMGxUv2Kc9yHX1bzWktLj52ddta2cmInuocpXyetkXtroDD4vUBJXjUVzxnD tEy52FFvXjz/xgMA/KPTo3ccL5D8Q4bThRlVl+gQiu1BNGbzNnT5jxXi7simbf7XGInY ONtl/S1UzGdLv6/C1xs9vjuFsCqg6MLwLMUzpM5Xfaooh7SGf897O4k9AIU0rHCcPR+z Ok8pzgebPU+hmfK17ZOSqSXvhfq80p1V8LnO5muxdO75+Xg502WPVOghzQFgbkEB0hyo +57w== X-Forwarded-Encrypted: i=1; AJvYcCVH2XkgpYGi69HTKWAukSQX8W0VfuUETiQKgF3SDNZfCcNfSkxf5QcediHbQg+0t+64PNUbHEQoWiUs3MD/jxtY3W8Z1gz2I0uGhwzqfA== X-Gm-Message-State: AOJu0YyPilMElpVbNfdrQiSIytyqKLgNtIzooYM1UWXVLHVBY+zw6LT9 yWGTtzXSZo/t3KqFUCrEw7lbvYzsNC6zbPKhaFvBo+UldVnqsirq3ueGOHrjmrEN4fL3fHbAhFk kNx6ofMIWkg== X-Google-Smtp-Source: AGHT+IEja+GLVOpS7V2U0r8IR9Z9ZB6nAf9rPU6225JSB7wTRYk1qUU4QFIkeBtYF/8VHx1IHDowrDp0WPzcZg== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a0d:d952:0:b0:627:de82:8077 with SMTP id 00721157ae682-62cc709af05mr798057b3.2.1717610430440; Wed, 05 Jun 2024 11:00:30 -0700 (PDT) Date: Wed, 5 Jun 2024 17:59:51 +0000 In-Reply-To: <20240605175953.2613260-1-joychakr@google.com> 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-8-joychakr@google.com> Subject: [PATCH v1 07/17] misc: eeprom: at25: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110037_420338_963A7CD0 X-CRM114-Status: GOOD ( 12.80 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/misc/eeprom/at25.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1149 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/misc/eeprom/at25.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c index 595ceb9a7126..73d60f80aea8 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c @@ -74,8 +74,8 @@ struct at25_data { #define io_limit PAGE_SIZE /* bytes */ -static int at25_ee_read(void *priv, unsigned int offset, - void *val, size_t count) +static ssize_t at25_ee_read(void *priv, unsigned int offset, + void *val, size_t count) { struct at25_data *at25 = priv; char *buf = val; @@ -147,7 +147,7 @@ static int at25_ee_read(void *priv, unsigned int offset, dev_dbg(&at25->spi->dev, "read %zu bytes at %d\n", count, offset); - return 0; + return count; } /* Read extra registers as ID or serial number */ @@ -195,10 +195,11 @@ static struct attribute *sernum_attrs[] = { }; ATTRIBUTE_GROUPS(sernum); -static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count) +static ssize_t at25_ee_write(void *priv, unsigned int off, void *val, size_t count) { struct at25_data *at25 = priv; size_t maxsz = spi_max_transfer_size(at25->spi); + size_t bytes_written = count; const char *buf = val; int status = 0; unsigned buf_size; @@ -313,7 +314,7 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count) mutex_unlock(&at25->lock); kfree(bounce); - return status; + return status < 0 ? status : bytes_written; } /*-------------------------------------------------------------------------*/ From patchwork Wed Jun 5 17:59:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944145 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=o/wWL7mV; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=G2z68Q42; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vvdzf0GR5z20Tb for ; Thu, 6 Jun 2024 06:17:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=5UT8WgvsPoW2AtNnCv+Th4BShg3/dvBd+PIcTR/tQcM=; b=o/wWL7mVY8i4I5ycqJJLOmkJiW NyVaOcF4C3pN524YVR6uighI3iIDiYLLldfK9ZeQxn9RBa5xGXYL+xFF7NGuWbpzmVpnkPqIwEYWv y8lhHnB3GdI8Spc0xNsMztlTHdVYpQQ5b+I2s0E0m2Q1zM5Qzhvq35McpZxv0AqTbEwQapYExe8mt JOmq2YsY/49Y1xm2kUDp0JVto8qyNQNNxM63br6qlo5xWvfMwaZL6M+ni6k5L408KolUUNpvnK6J8 SxBssFwc6PfqvSC68su0qh6PgnqjNYh1P3X/AF8RfH5Jp8ky5R604x04/UsrcwOzHfcnwlABKniIv XbWvk6rg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEx43-00000007Qn9-1Bpk; Wed, 05 Jun 2024 20:16:55 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuwB-000000073Tl-3RE1 for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:01:05 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-62a2aec8521so607577b3.0 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=lists.infradead.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=G2z68Q42h8BopQasNC59Hs1iU6alvuTCNS3++OdmKiQ5yn8O3op6CCl2OMR44KEs3h tqXBYH3WeAjYKGLPhr0uuEuEsCOaRxv5R74eUo3eF4kZTZlggp+gsYsL2FJf2atqLRI8 wSpwd9nDpECCC9+s+cbRMCa4afFaxTd0Cn00gsyketdA5vKiH8P8Efxo/+LBtpnrRTX7 cco5CJRd9j2SDjg5tse/3onRoO5soomEeS0lXJ0RErL9Xl5ioyFWURmOHEqBK3mUFtkX 9V7k+lpdhW2OYZ8HOrxuy+Tyc4jAgwhZsxlwR58fJCbUcR3H2WHOxA/LilsKzzmW2SL4 JIXg== 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=DT2OgH1HuUrOvIEds5ZYDUiOSesJkwAwH7m3LH7SkoKu92ERPDNV025i8JhCumlX3P IJ7R9DDb5E8UvtFTU28hTJbtLhCG9OCIUe+4U+q9NVHh/CgFBrfcEeGfErSOnxn6l3uN OILmovKryWSpviBVzd1Ley6w4GwcDQlzA2F+HJWu/3dbcJ21AOR4Quazt3fT3mu9cEyY 0IGqsx4IqeDaPzJhBN4y6/QaUQzYu9Dp/3D8xD7ywhuCMhcCuFmn8MMYknydqwsA7Vuk oSyr/mI8PN8nmDY/imEAUascGviioHDSucoU3PKuYo246G/sa8YkeVz6gYNa8TM2OSd/ 9XNA== X-Forwarded-Encrypted: i=1; AJvYcCUMP42X5LSiO7FJqGkKG42P/TPznFyMHZaEKs695rkoKntQAzPnZhHVJv/DHwW2ozU2uNKWSHSwx17gG0H6fUp4SOa4pHsllUFluSRgow== X-Gm-Message-State: AOJu0YxjBQz5REEh8yICRlX0Fjdh50Migtqj4IPVm+9coWeM7pJVl6lB X52GEIO0FSEA1T7ptVadKO+IS1325YgYWA0RIo6bpo9sFBOzPL1aRZJiOhXYDxZv9cyXptOzOzk wrdUykbWNrA== X-Google-Smtp-Source: AGHT+IFNKfAUW4OMaL9qXpdep3tJtwg2SPr15+NfVtMPZB9WLEiwmeB7gCF1Z3uW4GFYC8/zL1lL4yiz6W2izA== 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> 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110040_756433_2742FFC1 X-CRM114-Status: GOOD ( 11.07 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1149 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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) From patchwork Wed Jun 5 17:59:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944103 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ieRyElQ3; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=VLzluuJE; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=bcCU/reJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvcKD5DDmz20KL for ; Thu, 6 Jun 2024 05:02:24 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=mk6EfNl5x/n2d8xJG8kYA7MO7EDVoSlWVwtBM3d+Z6M=; b=ieRyElQ3cq3NZCn0CeDMbsMShQ f4PWvrTz17s8R8aJmyMHDNXtQuVehmlFRlCdx316lL5V40m7DNG1hsv9iKolldSZ6DdVrOVPBwlcF w2V8Vqg5JAlzCzdM7XALJ/eMjHPA6QMS2FcNoal8PsgInETuR+KTn0hNQbU5r4PppXlaO3r2jwWTX yq0vTYitAd5uMeALS0emgvyaSHkkz0cHSEUVFEGVcH5rwqIqSMct65D8wanPtznCAy6KKrHxAJU1h 2kv3T1PmUGY2La9NbC7nlfHoRbs/X+QUYX6RNXTzqWrOK/MrEu8zkBX3SM+YYzvasZMrFO9VxBKVw VXBA98UA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEvtm-00000007Fl6-0Fu0; Wed, 05 Jun 2024 19:02:14 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuwJ-000000073f8-1gV4 for linux-mtd@bombadil.infradead.org; Wed, 05 Jun 2024 18:00:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Cc:To:From:Subject: Message-ID:References:Mime-Version:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=+5/Bg969zZ0eVFu5myprHh5fQqxMXbek8nDgGOBzWoA=; b=VLzluuJEeo/tB9p1CTA5zX8gOE b6lIriWFJ7enBMxl9VXvo+640l62U6sax8zaQmSBgQXshZU5SyWuLx31clryf+nwCEEb1VuyhJHlL tQ88MEtmafvh7DdZFpRClA16jvTUzkImtpaXbJ9Acj7dBgZsHSVKm7DIFUvlJ7MH7aWzfWr2Vvhcs 0QHGNTDAQXe/ELwWWSgWTFGQsDKrkqzbFrmETvMThDU5GUWgYfwTuQXqcfHhtZ346uJ56SBedfH5u AF6qbF9i2/GIl9p7rBjQoV7igxD8iL/ARzJzhda74eFSmZASf6Bi0+lB2y1YcneJdTHD9fq0hT3XK ArPp3Nug==; Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuwD-0000000FoyH-15u7 for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:00:45 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-62a50486746so206447b3.3 for ; Wed, 05 Jun 2024 11:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610439; x=1718215239; darn=lists.infradead.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=+5/Bg969zZ0eVFu5myprHh5fQqxMXbek8nDgGOBzWoA=; b=bcCU/reJJJM+TC4H2ziQ8KexXzhsQCx7/TuSb/bHcaZnipid7WvoVrT+OuFsDdO82s 7R8L/eOFV4kSlL5+yblrZ+kW4JAj9RDeK9/lhkTFEFSLXT62tlUfdG2S0gwx0OB1o0Qd rajIr2tl13gAgJ8f2lvq6GCwYaSe2kVIu2hG0WLR0Em/0CrtO7VIlGucFL2+fDHeF9RG lgQvsfJVdT1TVTRJQWYxehd43RIbbWT/TxM7MFijzb/LNqHkDgQvNBzwaGJ/9qqPHYkk O3jfb/yFpv+dZSXpuFkQfU9KMYrC8RUOdf7UDfiMQvW6CabBDxkt9o2d6SG3wwi0Yuee fAzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610439; x=1718215239; 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=+5/Bg969zZ0eVFu5myprHh5fQqxMXbek8nDgGOBzWoA=; b=HQ6AN21hofl2Rty02tPqPS7ZsZK3AJmOOWQA8wQnLsdhGVOQimLXduAW2tPbFuiaxE 0fjO0sVbt0ouw5yuU1ZRLxrCAL/x94IHAsfqIkmVHBh7jKq6fVTmpsgl5Zfa8wwPPoWs XNkFEuQlVf6EsDB1IK4JoSGSqUeXZvvo8rFedScImoRd7VypwdZTLGTT+Nm5D6DR17/E ULlsTGylW0cUAKPUbRkcXcTz7Liv9JlWR4OWmDaULekIXZQLKeZbqA0MFrC+UuKTNq6x 5ozk4EfQppFeS0t7cX/0FwLgD7XzcJd1UVBhZO7biN1iA3nzgYotaU+RyxNETdvxFy24 55mA== X-Forwarded-Encrypted: i=1; AJvYcCUol10kkwvNvn9q95QKPTnLuqcCkYG/+j22FOzLIQgU779Rf3GkHiKr0GEuO66+BTPhe2wjcy++pkvFd5KRGSUeiF8+VZrjpszt8L6NJw== X-Gm-Message-State: AOJu0YyOMsJLuD17FfgyF/+8AG7NxpsTHHR0IFtE0l3wI6oEsNeQLAD/ 9LYwEbDBXqpgltyrixOzbihi2DIO7OZxY9LRpdOOB2GgAK70bRVEss7Ar4GAN3YUpdsuN0bbgCX uexBht4xLPA== X-Google-Smtp-Source: AGHT+IFfzGEzBdG0mJIzkY83NzFi7HVUzu/maRQ4zPj2TdB+TSZFtwNCtZCm0+GEQSlNaviP1mxKnEiXfVn+VQ== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:d90:b0:62c:efc:38b7 with SMTP id 00721157ae682-62cbb4a22a0mr7561267b3.1.1717610438615; Wed, 05 Jun 2024 11:00:38 -0700 (PDT) Date: Wed, 5 Jun 2024 17:59:53 +0000 In-Reply-To: <20240605175953.2613260-1-joychakr@google.com> 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-10-joychakr@google.com> Subject: [PATCH v1 09/17] misc: mchp_pci1xxxx: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_190041_383120_CC2EF928 X-CRM114-Status: UNSURE ( 9.94 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- .../misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1149 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- .../misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c index 16695cb5e69c..817382c342d3 100644 --- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c +++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c @@ -117,8 +117,8 @@ static bool is_eeprom_responsive(struct pci1xxxx_otp_eeprom_device *priv) return true; } -static int pci1xxxx_eeprom_read(void *priv_t, unsigned int off, - void *buf_t, size_t count) +static ssize_t pci1xxxx_eeprom_read(void *priv_t, unsigned int off, + void *buf_t, size_t count) { struct pci1xxxx_otp_eeprom_device *priv = priv_t; void __iomem *rb = priv->reg_base; @@ -159,8 +159,8 @@ static int pci1xxxx_eeprom_read(void *priv_t, unsigned int off, return ret; } -static int pci1xxxx_eeprom_write(void *priv_t, unsigned int off, - void *value_t, size_t count) +static ssize_t pci1xxxx_eeprom_write(void *priv_t, unsigned int off, + void *value_t, size_t count) { struct pci1xxxx_otp_eeprom_device *priv = priv_t; void __iomem *rb = priv->reg_base; @@ -214,8 +214,8 @@ static void otp_device_set_address(struct pci1xxxx_otp_eeprom_device *priv, writew(hi, priv->reg_base + MMAP_OTP_OFFSET(OTP_ADDR_HIGH_OFFSET)); } -static int pci1xxxx_otp_read(void *priv_t, unsigned int off, - void *buf_t, size_t count) +static ssize_t pci1xxxx_otp_read(void *priv_t, unsigned int off, + void *buf_t, size_t count) { struct pci1xxxx_otp_eeprom_device *priv = priv_t; void __iomem *rb = priv->reg_base; @@ -264,8 +264,8 @@ static int pci1xxxx_otp_read(void *priv_t, unsigned int off, return ret; } -static int pci1xxxx_otp_write(void *priv_t, unsigned int off, - void *value_t, size_t count) +static ssize_t pci1xxxx_otp_write(void *priv_t, unsigned int off, + void *value_t, size_t count) { struct pci1xxxx_otp_eeprom_device *priv = priv_t; void __iomem *rb = priv->reg_base; From patchwork Wed Jun 5 18:02:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944046 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=vEJQBc3f; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=2DWnL00H; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vvb0j1rJGz20KL for ; Thu, 6 Jun 2024 04:03:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: Mime-Version:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=5+SqiQq1JmU55Qqsf59HJfoC1FZkggQ6xe04cJ/1XYM=; b=vEJ QBc3f2vKkqjd/PHHk9RRS4Oh+ZCZJmfjtWLh10tBPTvm6cb+4IpynZTzjHAkbK/USfYF1JbanTpyt 6P3PhMP1G7qwrxkPCxssuUNXq34MvaY+l03OerbkJWVLP6v1OFu9PKleCQd2QxMzYR7Wb9mXQHDUk TF7gH4Nhj98SdhU88ClCvzO+TN3CYDIGwB7E0YEfm0xTgCLVknNHS3nw2pN1sbarBiOpTJwfsPJ8g 5p4srL0VkmDSCw+94zq+nKFykLaeChqU6dNXfVdghLH013cbhdN0ga+04V8fscEpzMI/jlLj0kOMR 6Q+6aOZePUmmoDfNaQHOgB4BA2HDHvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyJ-000000074Vj-14D6; Wed, 05 Jun 2024 18:02:51 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyF-000000074TM-45Eg for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:02:49 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-627f43bec13so708287b3.0 for ; Wed, 05 Jun 2024 11:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610564; x=1718215364; darn=lists.infradead.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=y5YxZkBMx7xM0lBc97o2/iv7RwAsHr+ZFIuj4hushzk=; b=2DWnL00H9LXKeklLar1PcxZ2u0vpYz3P4MbVLjma0TJEIMD9qWQNK5eGDqWFPM2P4k 6fv2LI0pK1EPH/m1+q8ic6riVdoXIHi7LENLW8g8NKz3vyskowYfUATtQe3VclNjz0np tiIV6o3qlYC1MJz0jfXyXuVTjhiF+QRQzC4TDo0CTDY8O7b7JjGVyDXcAaVlDpYALyT1 /baZZpqk4dlkXWJ6NveUFMn/zDFer7re2jJXZl9eRh7RoOcty7H+T7HTVKiiiIWJfEot mSbS8p7wAKeH2CjPmhjJI4RF+S/9VLQpFolJRRsyUqTztEhBPe0JHpoC0+XAVIIhcz5N io0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610564; x=1718215364; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=y5YxZkBMx7xM0lBc97o2/iv7RwAsHr+ZFIuj4hushzk=; b=FU7xh3Di4EGyV4srgK0jNFAB36MfHpo73Ay8T9SVeWa6vVCB/FnuamAdov2hqMbgSO Eug8zihqXiEiDo1wOGeA+p5FjhXkItjFi6o1JvUuj3oMkp/maZ2HRqDCu0L/BTVnipqk q/UdMO48JUODB94EKnXjtM2R0xDK/Dg4YhqOfutuAjSDL0n/gCUeHwzmJqKY+f82Gnqn smzjNrfltD8fVP6N1v8YZMOyEtSszMyASCQRdmpwJFn88qua59W3FxdhCjYklLioMouR 2lgz3f/iB7tIaA5GHv44e6hVjeZy+7OKP5RW5mfYGEO5oO0GuVPIMj+GcmjwotxW8TIE zUTQ== X-Forwarded-Encrypted: i=1; AJvYcCXQYC5nRXhDZVx1ePKWuGlbPz8ijSuOjkOqiSqRVwtC1jMngB31wuN+kx/Tk5gC7lh2xFWsepJNaBGcgxmu6doVY1DOtCLSv2oDff43MA== X-Gm-Message-State: AOJu0YzcoNO1oEmcf53wt3GXoDpFW62p8WCDhAKRqfvf5TCKNWmATKwN 8kd/oaG0C5UYmTW9l6K5WU46oWh5845rwFsp/CtM3Sste8W9p7+GH0QgZzEnP8EFPPsbCkNvPs8 t0EeUm6Re7A== X-Google-Smtp-Source: AGHT+IGCU+GmK3Rf3XT5eiVn8GBJTqffr6kRhdYR5C7W1ubGEWJe6ysf+n1fV0SHLE+oXrcbvgWtj6KwbrbfFQ== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:884:b0:61d:3304:c25e with SMTP id 00721157ae682-62cbb5b3bc3mr8573737b3.7.1717610564108; Wed, 05 Jun 2024 11:02:44 -0700 (PDT) Date: Wed, 5 Jun 2024 18:02:31 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605180238.2617808-1-joychakr@google.com> Subject: [PATCH v1 10/17] mtd: core: 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 , kernel test robot X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110248_032693_63531418 X-CRM114-Status: GOOD ( 10.48 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406050200.8BOdZUla-lkp@intel.com/ Signed-off-by: Joy Chakraborty --- drivers/mtd/m [...] Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1149 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406050200.8BOdZUla-lkp@intel.com/ Signed-off-by: Joy Chakraborty --- drivers/mtd/mtdcore.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 724f917f91ba..b13752ec2f1c 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -530,8 +530,8 @@ int mtd_pairing_groups(struct mtd_info *mtd) } EXPORT_SYMBOL_GPL(mtd_pairing_groups); -static int mtd_nvmem_reg_read(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t mtd_nvmem_reg_read(void *priv, unsigned int offset, + void *val, size_t bytes) { struct mtd_info *mtd = priv; size_t retlen; @@ -541,7 +541,7 @@ static int mtd_nvmem_reg_read(void *priv, unsigned int offset, if (err && err != -EUCLEAN) return err; - return retlen == bytes ? 0 : -EIO; + return retlen; } static int mtd_nvmem_add(struct mtd_info *mtd) @@ -919,8 +919,8 @@ static struct nvmem_device *mtd_otp_nvmem_register(struct mtd_info *mtd, return nvmem; } -static int mtd_nvmem_user_otp_reg_read(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t mtd_nvmem_user_otp_reg_read(void *priv, unsigned int offset, + void *val, size_t bytes) { struct mtd_info *mtd = priv; size_t retlen; @@ -930,11 +930,11 @@ static int mtd_nvmem_user_otp_reg_read(void *priv, unsigned int offset, if (ret) return ret; - return retlen == bytes ? 0 : -EIO; + return retlen; } -static int mtd_nvmem_fact_otp_reg_read(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t mtd_nvmem_fact_otp_reg_read(void *priv, unsigned int offset, + void *val, size_t bytes) { struct mtd_info *mtd = priv; size_t retlen; @@ -944,7 +944,7 @@ static int mtd_nvmem_fact_otp_reg_read(void *priv, unsigned int offset, if (ret) return ret; - return retlen == bytes ? 0 : -EIO; + return retlen; } static int mtd_otp_nvmem_add(struct mtd_info *mtd) From patchwork Wed Jun 5 18:02:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944050 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=jSWy8uB4; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=IR/DeYKN; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vvb0q25Fcz20WK for ; Thu, 6 Jun 2024 04:03:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=DJ3/HzMA90mX7GPJ5KHEIb79PvSkJPd/UcF7SWiMC+E=; b=jSWy8uB4V5ZNY+3B7KZTiZE9js E9v0zOclr0xxh1iTgcu9VlGpB/bpyCrx+WLgbR6i0eQAK68hIhdJhWgayZVla5HowAF53JffbCu5M z7OSXZU1PgsC2ezyaGpndKpyC7VwC6QY2Tp8XpHmzqOYdXHwr/qi7NcxHCuLHEhdTtz7V74YMa135 Wm5TO3fil+AJdFsvLe9eO47TDYd8oSHDNe3XVSLNpXC4YLXRaSXHVQHeGD4y7uSl4YPnXHmnZr6qS brPhxTf4/pAg8Itj/41fr0XLTV/HywapShafGWdU/uDOybfhqXaX1froh5ROEJXhwbkJSXEC/qzaE qk7vO4PA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyO-000000074ZN-0CIh; Wed, 05 Jun 2024 18:02:56 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyK-000000074VO-2SNs for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:02:54 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-629638f1cb0so235947b3.3 for ; Wed, 05 Jun 2024 11:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610569; x=1718215369; darn=lists.infradead.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=IUTCTG4PiwJpsjy0QKETkEiNDEwH04EYXsIQhajeZMg=; b=IR/DeYKNMovsS1s2UDxRYLH6q9DJ71xQWy94cfrvIGmI1nreETvgX2vD5YFJseh6Ln CSY10mgNWg4jNFuZWvy1Vrlseii3iG/SPeoRgqZJ1cYtNLM4jxj0GnTKTurTf4JBcd62 QopZOZk72Ffdl8P2CUTcxgO/V3mpXjdDpNIg7ymZdXfypf/lfwAajpnchNaVonsc0T3L 2gd7X/0d8l80WH04zVQHA6LKQOVGMxg1f+XllghN+GYxe3NaE1VCmbUJUtZVVY4bpqlS QJY57rAYkbMDJxpiBz7C/Su8aIGT1a58sFj8lEwtS+k71guvv48lmVaF61hmugppvqdP twnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610569; x=1718215369; 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=IUTCTG4PiwJpsjy0QKETkEiNDEwH04EYXsIQhajeZMg=; b=aV0kPRxh1Cuk3lSYz1sbAuNa0iVPDv1ht0bkZHG5faCQEVT9wJ5GRCXhjh8e4r6VcL X0IpxH8S4IblB77DBiWA2da/uqkZ4AwXnlm8RyKf0TqXEZKhZmFt9kE6oVlJ0qF14ogO V+y4N016fcPf3S1ffPN1kUDdT+IQ3gijQfoY8A+pNiTbnx5pyyekN5xbi1ZT2YiK3+hv FAUGUxqvlO/uVRQgbIg7mCK2FHpzbnc0Ao9Oc85ijr3o5rnekwC2JLe4w8cYSdTX6AMN +T9ZzM6QlgRMF9f3xTos8rJFNRdO/GYLU2YoDJ/Q2nccAqwoizqF3T9V/PYZM6xYPGwb hseA== X-Forwarded-Encrypted: i=1; AJvYcCUMqo2gsxu8Vnfsr8/q1SC0Eebmvj0fRFM40sBU3wPFOi7hCHpiHAxGcgkcK/Fb8lBhoCIhQZDdycKaitekygh/e8loe8PIC9dWHd9koQ== X-Gm-Message-State: AOJu0YyRzcdRCn3LRkIttXBURA0znt4QLp6YXzDk4tt1DyssfcIjDb0s LXFre91vxVkloKqewS+AsqCjflibRGkqmoHmAKuJIdeY/RZ62xK/A5CvVU2QNeGSQrpcq8goc6F 9rrvpsrICbg== X-Google-Smtp-Source: AGHT+IGRE1l9odt4GG6RaI8M/uHdLkQEjh5Taz0VKgQ269YOTeE9TiCNJPVhuqv1Ry405YEIQ6hIdx0yWPVe/Q== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a81:4c07:0:b0:62a:415b:a137 with SMTP id 00721157ae682-62cbb4a2295mr5047937b3.1.1717610568813; Wed, 05 Jun 2024 11:02:48 -0700 (PDT) Date: Wed, 5 Jun 2024 18:02:32 +0000 In-Reply-To: <20240605180238.2617808-1-joychakr@google.com> Mime-Version: 1.0 References: <20240605180238.2617808-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605180238.2617808-2-joychakr@google.com> Subject: [PATCH v1 11/17] mtd: ubi: nvmem: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110252_675892_3C65036C X-CRM114-Status: GOOD ( 11.43 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/mtd/ubi/nvmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:114a listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/mtd/ubi/nvmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/ubi/nvmem.c b/drivers/mtd/ubi/nvmem.c index 8aeb9c428e51..eab14821343d 100644 --- a/drivers/mtd/ubi/nvmem.c +++ b/drivers/mtd/ubi/nvmem.c @@ -20,8 +20,8 @@ struct ubi_nvmem { struct list_head list; }; -static int ubi_nvmem_reg_read(void *priv, unsigned int from, - void *val, size_t bytes) +static ssize_t ubi_nvmem_reg_read(void *priv, unsigned int from, + void *val, size_t bytes) { size_t to_read, bytes_left = bytes; struct ubi_nvmem *unv = priv; @@ -55,7 +55,7 @@ static int ubi_nvmem_reg_read(void *priv, unsigned int from, if (err) return err; - return bytes_left == 0 ? 0 : -EIO; + return bytes - bytes_left; } static int ubi_nvmem_add(struct ubi_volume_info *vi) From patchwork Wed Jun 5 18:02:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944053 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=TBVwcpRv; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=Yjbi3QJZ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vvb105sfnz20KL for ; Thu, 6 Jun 2024 04:03:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=utEbZ85CUvtUwAwcrmshZ9UDUyzIulNHACba3acDnlQ=; b=TBVwcpRvsOpNFmCSPKxxeXtP29 sIxtlfOkfjhNCmUTcIHE7MwIdaVon6E5e9tv4SwxUI2mZFtu9D4xD92WMRdCdnoOmDMa3oAtmgMcm UYtKxZsjQY5YL7/LPSGdNVh8aIKGrT6gVDJdTioK+QiCpaJRSbNuClgeSn3XLp5uw7ExoOcmJjqbz O+7Jrd6VOL5tMN+LpNiz+KNvF1dUuSMIiDo+ayRunXSz/XH84xMTwSSlGsJVEqGOAWpgoj86JVU5D 2nBgm84RWD/9ZHU/n7uZ9bbPWP5sJo4/U0HunXS6AfyWSyG1yyzNtNiRga0GOZLnkjNVSllq85QY4 3qE+NI7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyY-000000074i1-0K4V; Wed, 05 Jun 2024 18:03:06 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyP-000000074Xh-1omR for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:02:59 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-627e9a500faso436207b3.1 for ; Wed, 05 Jun 2024 11:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610573; x=1718215373; darn=lists.infradead.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=qDI8h7ZoQYy75CqD6I2McYIto2hpIA5emU6fq1I3LPI=; b=Yjbi3QJZibdkUbW2N3vMMC1ImMtHZv/d3JfO3j+oCvyP/qglVa+uAZWcBkmHlryH5c KcPmcdbGEVxC6SMPM8PA9mpTSlW37t/Mxb3injMfRd2pJ1QFf7DmQgv+k2GJBDrk7dAp tQw4HQpa5I9SYXAptjJtuOdl0I+0Dn0HqaX5jPuS8L9xKI69cWuL7awMsweA/9k6yg3Q AsINBnzLKdg9r+nXdzwMCBdTaSVlgaHRZUx5IMhCE8KXHfKxppzjn/CDJksoCUA3JaPf If1lkhy6BHRL794wjNU/VZghIWrg9TfOXsS6xZqJcNfrcVChYeG7jMnVNmJGHk5YH5EW q3XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610573; x=1718215373; 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=qDI8h7ZoQYy75CqD6I2McYIto2hpIA5emU6fq1I3LPI=; b=hJmfr02WVa9kvCX9FILpFz22KYcfPcqI0u7k6s3zfH5/F5OWhSiaZCmebTXX/PuVkF lLaTt/NGNvQQxNcsuOJJmsQSQfQOiYJi4o+NSj9Jsu3qJkJUnEfhunLaGWSIZ3w35yOG 76s8dcLt61MwreravgnmmK2S3BtBaFvANMv6d7bH3DbRr2rouI108L7bNi8fDaL3WHuk INDdHJ1DQrkCYVj6FE+u2gPDkox12TxbBy8AMlVpHD7e4W3hjEpqldzqPqD4/KHmU+2M rihzN6BfrPZnj4JE4OqHpyhl4UqDszy7YwB04YE0MA8Ui/31yYFrrdilDUUOueTnjX1J ChVg== X-Forwarded-Encrypted: i=1; AJvYcCVhjfLgIKwpysRlabL0ImWwSYHtJ6MSWs+gznmrnoJKdWd96eqvDihCDMFA28OSiP7fhprJ6GOGOJ++AvA9WQMX8HbkwNWn7nJD5iIxOQ== X-Gm-Message-State: AOJu0YySxY5SMJUFIMustpznpFbTJYOYpqb9mz3k74Vbbu1NqylczLtP /tkZt2hg/78u60O7uYqfSfsyiGzsoiiHGZ7y7DHNW+z2EzSSmPlB/71MLrkSWoYxCCEVAzK+skO XAGuzlhp1Hg== X-Google-Smtp-Source: AGHT+IHsHtY+bAgPNOkcmVi64EeRKQimO371NMHALyHppPPqEXYX97pSerbED4x3JFp6tor3148MLJe9OAqS8w== 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-62cbb596fc6mr8780427b3.6.1717610573043; Wed, 05 Jun 2024 11:02:53 -0700 (PDT) Date: Wed, 5 Jun 2024 18:02:33 +0000 In-Reply-To: <20240605180238.2617808-1-joychakr@google.com> Mime-Version: 1.0 References: <20240605180238.2617808-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605180238.2617808-3-joychakr@google.com> Subject: [PATCH v1 12/17] soc: atmel: sfr: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110257_605133_D8B2185E X-CRM114-Status: GOOD ( 10.79 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/soc/atmel/sfr.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1149 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/soc/atmel/sfr.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/soc/atmel/sfr.c b/drivers/soc/atmel/sfr.c index cc94ca1b494c..c1c8e59cf6fc 100644 --- a/drivers/soc/atmel/sfr.c +++ b/drivers/soc/atmel/sfr.c @@ -20,13 +20,16 @@ struct atmel_sfr_priv { struct regmap *regmap; }; -static int atmel_sfr_read(void *context, unsigned int offset, - void *buf, size_t bytes) +static ssize_t atmel_sfr_read(void *context, unsigned int offset, + void *buf, size_t bytes) { struct atmel_sfr_priv *priv = context; + int ret; + + ret = regmap_bulk_read(priv->regmap, SFR_SN0 + offset, + buf, bytes / 4); - return regmap_bulk_read(priv->regmap, SFR_SN0 + offset, - buf, bytes / 4); + return ret < 0 ? ret : bytes; } static struct nvmem_config atmel_sfr_nvmem_config = { From patchwork Wed Jun 5 18:02:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944056 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=2C66uli/; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=p2xkmw5M; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vvb1804Nnz20Wr for ; Thu, 6 Jun 2024 04:03:24 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Pv4H7BEJn/NoEBaMav3joB1jomg4rUVlYA3mLLjwi2w=; b=2C66uli/P7SjpcyJfFOJm6se+B ntv9Tuc5ayk/C1EMB6r28NeUh8NZAXvxOvziS94nF+h06pfBnBBsCQ/NwrYl2qHmHzHOtH3ibFDM7 01NUA4GfCx46pf7uRHaIIt5TchRCbx2F85z0D2kFYW3Mal7f2qLwVgE+LfuC/RrGtCEKVmAyvv9DA ljVaOUthuFU3xUDJd5pHFiUbqZISN7r1Nr5cu5fg9rIk+zx6fHRKuDtyOdFiN00LIB6xDRONILKBo hLgZOfH0vsVo2KQ9xQMDgePQkEaBVRnU4SHr4jEhfllzR+SoDLr4F5zeGo1ray2YQ21dbL27Hc1Ue yXChn5mA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyd-000000074nF-22iz; Wed, 05 Jun 2024 18:03:11 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyS-000000074b0-2s51 for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:03:03 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-62a08273919so357597b3.1 for ; Wed, 05 Jun 2024 11:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610577; x=1718215377; darn=lists.infradead.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=gIyLXo+tPpGJoYrLFVnPX7LJcwSjEvXHtDXEdVowSIA=; b=p2xkmw5M7ZnarbMsm/DgN+4xO3Z6ud47ahYIkPvnbNR3VuSosCOc4J2nOpFkQKFqpK OsqDlYqYMi379ocBtS/ZDcudAhqf8HR0vKpOJqndoLdUScAGp90XDVA9WXIGSCSCshFR 4YsULTBV36ZS46oo2iKS5RfNggB5ZxYrcdyL/SYYrnYTFXQ9SSQVyz2s+IQHv+/wWvfK eLNyao/AAfTW3sp3d1YruNCWDF6EE4rtkVtPRNSDidWBcaJ6DptsYrzOlVQYctvWsET4 N7pPiMM0DT+cKcpMQ0SvbZut5QdvvKzcv7a1eI+7+U6CTOoBejgE1IPy3zq1gOoByWzS FQ6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610577; x=1718215377; 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=gIyLXo+tPpGJoYrLFVnPX7LJcwSjEvXHtDXEdVowSIA=; b=QqCs0+3KijOv4TnP4x5VGsFzCE0MCET+x57wZgs7UwiHcWeGcbZtm8V8edNIIR+dpH O6Acunx4YM9F07xWnnrC/z+2QXbTbNt1zdlavmYDmsQK5LIU3oKR8tS6Gcq6lZL/1Qs4 bZDqVJZVnyW6V976ZSug5U9934QHLyJ11IEjAQQo2cq4q7v5ntyZ705mZpuDkdFZdyTF JBlOIFgQ1ALLS5V15KNECJ8OkMcl8VDEM5BZMrfleDAQEWdA07x4hw+u8SHrTypUrCWT AS9HwlrxOoRvfAzksn3hvST/f+NFhxaSd1hhRIrICQ8FArGJAIm5BOUoigu8nJ8vb5mN mXCw== X-Forwarded-Encrypted: i=1; AJvYcCUs8s9eIgHCDGnlq7SrI1LNrZYY+9AIBSbMwGczPYwptKksWbrGSfYKHoC20mgKOMaAX13/Fu2fX9on8srZWRgEW7vJ28kM5s11Z+N4Uw== X-Gm-Message-State: AOJu0YxVVY3RkCkThA5b8Jvk1kgamZT84oi5CykWyO2Xt57OaHiCHQZW SysqBsiHQSGkcAALhGowdpN0BQ6uHbbyB8o+bI24Ew9YJ8/RwP+5HhNKBX/jLpJhgaXLfXhCK/I hCpBp15Y50A== X-Google-Smtp-Source: AGHT+IHG2azfatKIs/LKs8bXyfwjNeJAhdZhoJHXxOf8ZfbWIWN9yiXy7wSmGDJ/xHP8XZ6qdqs5ZKpzypDE7g== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:887:b0:62c:35fd:678b with SMTP id 00721157ae682-62cbb5ab5a2mr4622397b3.8.1717610577229; Wed, 05 Jun 2024 11:02:57 -0700 (PDT) Date: Wed, 5 Jun 2024 18:02:34 +0000 In-Reply-To: <20240605180238.2617808-1-joychakr@google.com> Mime-Version: 1.0 References: <20240605180238.2617808-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605180238.2617808-4-joychakr@google.com> Subject: [PATCH v1 13/17] w1: slaves: w1_ds250x: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110300_830290_73339B40 X-CRM114-Status: GOOD ( 11.81 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/w1/slaves/w1_ds250x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:114a listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/w1/slaves/w1_ds250x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/w1/slaves/w1_ds250x.c b/drivers/w1/slaves/w1_ds250x.c index cb426f7dd23d..369de01cd84b 100644 --- a/drivers/w1/slaves/w1_ds250x.c +++ b/drivers/w1/slaves/w1_ds250x.c @@ -137,7 +137,7 @@ static int w1_ds2505_read_page(struct w1_slave *sl, int pageno) return ret; } -static int w1_nvmem_read(void *priv, unsigned int off, void *buf, size_t count) +static ssize_t w1_nvmem_read(void *priv, unsigned int off, void *buf, size_t count) { struct w1_slave *sl = priv; struct w1_eprom_data *data = sl->family_data; @@ -159,7 +159,7 @@ static int w1_nvmem_read(void *priv, unsigned int off, void *buf, size_t count) } while (i < OFF2PG(off + count)); memcpy(buf, &data->eprom[off], count); - return 0; + return count; } static int w1_eprom_add_slave(struct w1_slave *sl) From patchwork Wed Jun 5 18:02:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944105 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=JRsI2e5Q; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=scMguZFm; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vvcf56kDqz20KL for ; Thu, 6 Jun 2024 05:17:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=pOKOjL2rEC3MakOnFXZsqip8JfTeqWSId4bXnb/lVGg=; b=JRsI2e5QbY9PjBE+tRZo8oKwWC T5vsv5MQJMnlqkmAhlcil0RgjUo/Dby1Y5HyuTYXV+SaHuYohlhRbXXAkj7DMfElVFp5Ky6c+ZWxP xneN5DaZa5RTJW9P2aN37dIP+1RS2klaxD4pkKTRiXM/qIafSiGpTgrldH9cqJhAgqTPYPJyv1siL lzJQ5J14Kcad3rSB5WVgijljU6beowzooTUvX1wApaiVdU7yxg38eRBadSWlPNuKo4qqnjm9Bu1FS 6bnknPE6xZPHzt5U5YbeMGxi6wuROX4EfdidBChvPmWM035GCv3H6QevmLRnJg82odY+7BxVlp3br V8Oh8F1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEw7y-00000007HnO-0rfO; Wed, 05 Jun 2024 19:16:54 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyX-000000074f2-4Ay3 for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:03:09 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-62a088faef7so15665577b3.0 for ; Wed, 05 Jun 2024 11:03:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610581; x=1718215381; darn=lists.infradead.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=xwrLVVIieFUQPopwc+1tOr/or/db/Iy6oXeR6vbSkEA=; b=scMguZFm0aMMHS77WfvCXkcABWDTksqWeawQVarsK5Y7tACgww38kpHFcxINrnFldF NV0o1RAO6oQRNbpJjh6GjdjuTACgWWWFmFF2ADhuSrgzXgJK36MxIDoBZhLjr9GdORqC wJBANp58TGyw60qhdK/F4pQAU9SkN3kqZu1bz6Q3r5CXSDdV/4ndttZIHaNWSeUr2TCT gALZt1SWiQcqW17zaJUG9kicJRawSl9XIpgGVo9UQDZmvVNbpABkxM1qzkdiwo/a89Ac VD8MXc5iE5S+yOH+GUwnOE88WqWyl1M2BDryMVqcc+sicpo9qfhIhRvUQjPQhOgoTI7u 2KdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610581; x=1718215381; 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=xwrLVVIieFUQPopwc+1tOr/or/db/Iy6oXeR6vbSkEA=; b=lk1OCJDpoQsq7HtiBiRG4GsEEzcRt+0wZJ0mrOCqy0MtlklgZckj1rMZuV7hHJiU6R Ff84FlxjSXEl6PTFY3MiXBxrLRSBu3XN/DTbFpw/p0GLbxQI2wVCWt2zjxQzvN+V+m1F 5FRocLx+s1I1Vx8EjhQW4O9ApZsG86Asq/Lmg0I/x2ymcw5rBztOsnAz/VFUmAUoZ7YX 9qqv2r8dFGWg1qyEq/k2g51Q/SvSEDxQ3sBBAvnszQQWvfhbgMvLTKohN4K2QzIIAU+s 9sFcCogRLVmwg/4Ekj9A3YBItMeY0dbydLh/hboeCUpFDQR+rYsxGCu0BGZ1wWcvHw9b kuew== X-Forwarded-Encrypted: i=1; AJvYcCWAm0Hs0W4pXNptVn2+BbTzR9uLW02qNFu5GjL+MXLXZtN6wPPZqtAjrjLeUB2Wssad3XLObMgr/v69JdnycyTEWI1mc9YUwjpsp7tWZA== X-Gm-Message-State: AOJu0YykI/AzApXYBAXPaLFBAYjkJqP/ruJ5Go2KO+dD/eSlhot6YZWp gwpTjNSqC3KfLS0ws2XoA7gcSXWA/Xt4G0UJx9OelWEo0XL2dJSjehlREv15LYr3NeI8DY0zMcC U7T5QC7UWyg== X-Google-Smtp-Source: AGHT+IE9F8AaFWy+zkoE1AAtvE0JQ7XHHDVuIM2gnYtU9d2txGGQvOGhBI3kC4/nhW85Sx5cKDFxLERd+BeUJQ== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:6902:110c:b0:df7:9274:34e1 with SMTP id 3f1490d57ef6-dfadeb57766mr87616276.4.1717610581556; Wed, 05 Jun 2024 11:03:01 -0700 (PDT) Date: Wed, 5 Jun 2024 18:02:35 +0000 In-Reply-To: <20240605180238.2617808-1-joychakr@google.com> Mime-Version: 1.0 References: <20240605180238.2617808-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605180238.2617808-5-joychakr@google.com> Subject: [PATCH v1 14/17] thunderbolt: switch: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110306_227567_B753329B X-CRM114-Status: GOOD ( 10.42 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/thunderbolt/switch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:114a listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/thunderbolt/switch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index 326433df5880..35424a65cd3a 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -301,7 +301,7 @@ int tb_switch_nvm_read(struct tb_switch *sw, unsigned int address, void *buf, return dma_port_flash_read(sw->dma_port, address, buf, size); } -static int nvm_read(void *priv, unsigned int offset, void *val, size_t bytes) +static ssize_t nvm_read(void *priv, unsigned int offset, void *val, size_t bytes) { struct tb_nvm *nvm = priv; struct tb_switch *sw = tb_to_switch(nvm->dev); @@ -321,10 +321,10 @@ static int nvm_read(void *priv, unsigned int offset, void *val, size_t bytes) pm_runtime_mark_last_busy(&sw->dev); pm_runtime_put_autosuspend(&sw->dev); - return ret; + return ret < 0 ? ret : bytes; } -static int nvm_write(void *priv, unsigned int offset, void *val, size_t bytes) +static ssize_t nvm_write(void *priv, unsigned int offset, void *val, size_t bytes) { struct tb_nvm *nvm = priv; struct tb_switch *sw = tb_to_switch(nvm->dev); @@ -342,7 +342,7 @@ static int nvm_write(void *priv, unsigned int offset, void *val, size_t bytes) ret = tb_nvm_write_buf(nvm, offset, val, bytes); mutex_unlock(&sw->tb->lock); - return ret; + return ret < 0 ? ret : bytes; } static int tb_switch_nvm_add(struct tb_switch *sw) From patchwork Wed Jun 5 18:02:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944106 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=EALhRjyn; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=QdT70hC9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vvcf73tr9z20KL for ; Thu, 6 Jun 2024 05:17:03 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=zArnD/KlElgdoM+gXIBetFFfJtap2fXJLoPN8AmHGP4=; b=EALhRjynOgKj6TNNcsHdh5Y2uw 3VC+PQKToCm7c7B1u8EEGuLI93YeKxwrKMCqGAkAQ8TPJtO3CGCmYkQUeycOZMVqGTUoOMfOF8mRv OEwM5/CPnLQf+AiesnAkPbW4Yzi5J/9zZehD2g8J7BuXNnraOlH3jJdQdlkqbzyshkp+f25zUcbZr U+Wtwpx+AdGg7iEYprluTf5MzemQSvYsQs1dO4ECJETBqaQ98bIn+GSyJ3jNpyMN/PnHvag8Xk05J qe8J3gMVw1PnqfIgjODqEu0MyRO6ZIIlS7xSQ3DO37JNgeP0SUbFg6sUqvjV6q5QbV1Gp9giUGtFQ 9/SI7eAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEw80-00000007Hou-1xGY; Wed, 05 Jun 2024 19:16:56 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyc-000000074jG-0X6O for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:03:15 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-62777fe7b86so409327b3.1 for ; Wed, 05 Jun 2024 11:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610586; x=1718215386; darn=lists.infradead.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=7kj3F75/M4iGlFf64jdDqM9oitcQAChmy+MmDZHUpac=; b=QdT70hC9B4OEr0yZtMB9/JpMfhx7qf7flao6qt2Rq1vbFNwTCpegwWZ7Bia2AV4t4X Yk+kY/EgGltDH1Gk9UUtCbUQlI0GP/Hda5jdXPgNzA/km81F1/RuU+1AhjcHf6Z1evl2 T1tRtd1sk3VVmLV97bjciCkDCrX6/w8fKfrhF8ZSt+HjWxWMPi81MmyjGgd3sjzxhiN9 xKTvzNGDpbQaqGdbCk6qKzaEp1URO9ZSwfqKiZ+AGC8HXKsk+xFxbCmBWmHyF0c6HFwZ aunSeopQW+GktzuGHuztVtqpTlfifVcJknpWtBXlvgPua6mR/+1OP0g5d3qIhCv2NE4i 8BKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610586; x=1718215386; 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=7kj3F75/M4iGlFf64jdDqM9oitcQAChmy+MmDZHUpac=; b=d9ay8mQXszx3QGCDdooaOUAkIw+NlM3O8KceiwoPVdI8UPmNIAVkt/R7b95OrbFvle RZ9m3bqzA0CMdfnJ/FZKVuu6jSNL44qqn4LFiSGm5XG5WaXCJ+hwuxXBbMNydkDKqEK3 SWzApcEbs8a/8cRuvUBNFc63wP5L6V9R7Yt0iVNvieippOu5r07Z4MzyQ1WcaUjiiwBv PKv05YdlkfHyA2fYByTfCmhUx+a3Q5NGX9o5ZFgpDx55nlQFsGM3jDbkbJPgcJ7cMyEV cVaEHZlWKAbbjjTIUoFDwgj34+nzue3URYE+2CsmsIQ1+sQjKFAY2dK67D1rx49vbjvF dJmw== X-Forwarded-Encrypted: i=1; AJvYcCUUxNLyUNBvNMbJMTgYrEptlB8eJDZzT3lYTKcWG95KJSTo4i75aJItfbwqaHEj2jIYRLKzYs8Qj8fJEa/aZXZR1g+wML7hlM53IPUqtg== X-Gm-Message-State: AOJu0YzvVMs650DZlm2wfaVWSeTv7Qi68WIPpdA1KWluR6vwSBZ5AlUy +ph4Rd5GpR8qvjkVPIGd6SPUcByBpJiDN318sOEmQmWI0NDiouuMriLtg5u4qRgkYEZetUrZKvX rMHcqOyoWkQ== X-Google-Smtp-Source: AGHT+IG6CBdANF91FP38CmQTKr/LfgQsOsOD0b5R4Rhez9xhC1dP1JVIrpq0leEJ+8nApvlRDSurrJhIyku1Vw== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:c93:b0:61b:ec24:a014 with SMTP id 00721157ae682-62cbb309e5bmr5896267b3.0.1717610585878; Wed, 05 Jun 2024 11:03:05 -0700 (PDT) Date: Wed, 5 Jun 2024 18:02:36 +0000 In-Reply-To: <20240605180238.2617808-1-joychakr@google.com> Mime-Version: 1.0 References: <20240605180238.2617808-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605180238.2617808-6-joychakr@google.com> Subject: [PATCH v1 15/17] thunderbolt: retimer: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_110310_355421_311E8163 X-CRM114-Status: GOOD ( 10.42 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/thunderbolt/retimer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:114a listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/thunderbolt/retimer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c index 6eaaa5074ce8..fa52ea11ec28 100644 --- a/drivers/thunderbolt/retimer.c +++ b/drivers/thunderbolt/retimer.c @@ -32,7 +32,7 @@ int tb_retimer_nvm_read(struct tb_retimer *rt, unsigned int address, void *buf, return usb4_port_retimer_nvm_read(rt->port, rt->index, address, buf, size); } -static int nvm_read(void *priv, unsigned int offset, void *val, size_t bytes) +static ssize_t nvm_read(void *priv, unsigned int offset, void *val, size_t bytes) { struct tb_nvm *nvm = priv; struct tb_retimer *rt = tb_to_retimer(nvm->dev); @@ -52,10 +52,10 @@ static int nvm_read(void *priv, unsigned int offset, void *val, size_t bytes) pm_runtime_mark_last_busy(&rt->dev); pm_runtime_put_autosuspend(&rt->dev); - return ret; + return ret < 0 ? ret : bytes; } -static int nvm_write(void *priv, unsigned int offset, void *val, size_t bytes) +static ssize_t nvm_write(void *priv, unsigned int offset, void *val, size_t bytes) { struct tb_nvm *nvm = priv; struct tb_retimer *rt = tb_to_retimer(nvm->dev); @@ -67,7 +67,7 @@ static int nvm_write(void *priv, unsigned int offset, void *val, size_t bytes) ret = tb_nvm_write_buf(nvm, offset, val, bytes); mutex_unlock(&rt->tb->lock); - return ret; + return ret < 0 ? ret : bytes; } static int tb_retimer_nvm_add(struct tb_retimer *rt) From patchwork Wed Jun 5 18:02:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944107 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=BWpvT1sw; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=4VxQrumr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvcfF0BQ1z20KL for ; Thu, 6 Jun 2024 05:17:09 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=T7aUmiarQFGEYNwYbafflSgTIA79xEo2JrLF8UBRqes=; b=BWpvT1swTUxvAp019RpdoB6QT2 vtqm9gWco0IHXdJNDpqV4DLa9HwNwk79B9A8huGbQjpweR5sE5daOueRce5Ekkmjutq5wiZzb7Jdh ietyA568UaOggU36JSCLpLcOeT/GNTVqD5VBJ7HCIGCcBiZ0URyxBUizehk7mgTjvctBOl/Rjavio XvsKz1iaELmGYRsNFity1Vy/gm4BXzLLDzvp5a4wfDdT9fPGGyRFMXXeVWGYZ/54FlWJpFQKBXmgd E6q166KqNKQllc1ENHCuCJ/ixLvEsxnUvortkNMkAWC6yPvIisgH7gQStDXwNzjipEv0ZKg+JcFsz xi1rkCiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEw82-00000007Hqo-3Z3d; Wed, 05 Jun 2024 19:16:58 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyg-000000074nL-2VC2 for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:03:19 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-62c7a4f8cd6so745107b3.0 for ; Wed, 05 Jun 2024 11:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610590; x=1718215390; darn=lists.infradead.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=LqJdwI0kfu08l8zta4NZb2Dhq8rse0Xjye+A2f9mH7A=; b=4VxQrumrJ1mKCsy33vQUWuhkVGTGf5Eb/hWWkDMXaG224lH91aZFOV+hFSKK4v0Zqr qLGhn8S5T6d7N4qSbx0Ly3IDVxPVXAxIe9vxSWHa+hzAmCvTdJAtPtHo4lnz1mfKbGY7 rCaNqxknmwPWzxAXrvhdMeHD1u4WQMli5rSWu3bohXaefp31AIrYDD2Tm26TnimHmQBH xWcc6QT8zhBG6ZJzbIEGPOvwkqnDS2nkAHOrAJwFaHES8Ti3C+iP0MQlD2qya1yQpdp9 GSvYZpvYUFyslKyiPjWXjS3NT4MOh11ysGpvoVGdI3CZBRyYEduzehPErSdMEn4WCdTJ gcWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610590; x=1718215390; 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=LqJdwI0kfu08l8zta4NZb2Dhq8rse0Xjye+A2f9mH7A=; b=ralXeZqPbCrkpaM/kMOF2jwj59xmeIB3RhWLrO/yXLj6IIqeLSQLHwO3MQcUW3PzyR OKt809DPJ4ZBpOkW7fcxd/TZu45MC91F8OLQd/oqKA+xMM/7EYY8iWsPvG4PUiJcwwEd KSRDfPrRf4EftHxfwOyyhCQXASPVL92Kan2vUX/hqO8HOkP5Us7zBxferdAcB3FXBUTC 6wOo9VgqkOH2dtpr+u1a47RuaEHBLOkCRMwxBFNIHHHAMFffpA4NZKQ5olFpHlstnBhS SZgAHBCxlI1NVZbSn7BXEdI199SyCs2JtnJ6qWO9HCXnvpngi1PXIT8WfpnfdLYMluVf CsVQ== X-Forwarded-Encrypted: i=1; AJvYcCWG4gOp/cIMvXlifQW0sn9EcsJDfAuwHFluXg4NJNYOrDyRx34SZVCQoL4rCHozf9QTkG8M50v8gDQBwAqs9qNXqYhjT8eMUza8nkJhKg== X-Gm-Message-State: AOJu0YwDvnbn1TUiU9DoX+viY8Y4ORpkBbxbn6KWIFejAYQSmrlZbosV rRXXcGIc24dL2BaheJsn6NeH7cD2LnQv4rOlmTojUuxb1xOLlcZD1Rcq+wVsqG3DIl+GNXzwkYU fvDiIFjwNkg== X-Google-Smtp-Source: AGHT+IFarMTHRQyaGAXOhvjvZC3Ev9S2zTS3Kvs5hpqZrMnxro2/BzrazXCSnRirdCi4qPaGa/c0QONTMKwCWA== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a25:d608:0:b0:df7:d31b:7a29 with SMTP id 3f1490d57ef6-dfacad1dc1amr763889276.12.1717610590398; Wed, 05 Jun 2024 11:03:10 -0700 (PDT) Date: Wed, 5 Jun 2024 18:02:37 +0000 In-Reply-To: <20240605180238.2617808-1-joychakr@google.com> Mime-Version: 1.0 References: <20240605180238.2617808-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605180238.2617808-7-joychakr@google.com> Subject: [PATCH v1 16/17] soc: tegra: fuse: 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 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/soc/tegra/fuse/fuse-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:114a listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty --- drivers/soc/tegra/fuse/fuse-tegra.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c index b6bfd6729df3..1b067dd8a585 100644 --- a/drivers/soc/tegra/fuse/fuse-tegra.c +++ b/drivers/soc/tegra/fuse/fuse-tegra.c @@ -96,8 +96,8 @@ static const struct of_device_id tegra_fuse_match[] = { { /* sentinel */ } }; -static int tegra_fuse_read(void *priv, unsigned int offset, void *value, - size_t bytes) +static ssize_t tegra_fuse_read(void *priv, unsigned int offset, void *value, + size_t bytes) { unsigned int count = bytes / 4, i; struct tegra_fuse *fuse = priv; @@ -106,7 +106,7 @@ static int tegra_fuse_read(void *priv, unsigned int offset, void *value, for (i = 0; i < count; i++) buffer[i] = fuse->read(fuse, offset + i * 4); - return 0; + return bytes; } static void tegra_fuse_restore(void *base) From patchwork Wed Jun 5 18:02:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 1944108 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; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=fX03QUAG; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=pWaNZe3+; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20230601 header.b=o+oXf16q; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VvcfK2vtWz20KL for ; Thu, 6 Jun 2024 05:17:13 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=bo2BS9zFIVRraJq1tCLOagKZBKmaglE09jNXKLnLo2c=; b=fX03QUAG/8zGhzjcWVYRm3TFZG JWHXZKgMyFzPwjoAiLncopHADmkU3Bhip2awXk/y0R8UtcBvHJlqTFgn7mqrwsnJDAjcnDyAPlfAr PHznIu8fUCwey82BYRuf4Zda8OR3MV1y6x8iVCvdn51I2bUKNsC7Q9LAJi96xB1QC8lT+soz7uJ25 oz62hNpuX3/NnaPRFu9+UBif4DB95ATaDJuzr999Qw8MOGKvCELyg1hrsWtAnHLAnA0FYah+hzlDe lPBdZwI+5FDO95kIKAghxNHH6ni1l/xs7D9I5qKQgYuY1HSiiVcxq8r03tGy/9li8n/gJitbbgB5v RPFd8X+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEw85-00000007Hsr-0CLj; Wed, 05 Jun 2024 19:17:01 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyq-000000074yD-0f8k for linux-mtd@bombadil.infradead.org; Wed, 05 Jun 2024 18:03:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Cc:To:From:Subject: Message-ID:References:Mime-Version:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=agXJIWYTnSYKDeBOgiAFCjfM9OsVVF8iSwjgRkAIvFU=; b=pWaNZe3+dkauyD68uDyGQNVwT/ hTzueo48LIX6usI7RJxQY1g9FP1P32C8o4oSMvp+VNJOarhBN0WObl+giqwY06FP3qrK4Ud9dP6bR FBSx7KmOlG1fJgOqeS5b6LuK0F9nO52GYOjat27rkpP6gTckkSf8gIpzfB0qaWPD9Do10MBxJ2kA7 VHfMJM3wr+E43Q8M/ZbZJh766X9jWn+j/z9EoLiXqDQf+ub7nGwb2OIEYul/+o42xP8tm+SYcemBh wxtSWPxz4g6Mkcy4g1YWjyqP5bRf93UUyVqVkNw1a4NLMxi8+i4iDGRnl6ok2bxuKAueyf2mzMiJu rorFsZ6g==; Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEuyl-0000000FpKe-1keu for linux-mtd@lists.infradead.org; Wed, 05 Jun 2024 18:03:22 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-627f20cff42so607157b3.0 for ; Wed, 05 Jun 2024 11:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610595; x=1718215395; darn=lists.infradead.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=agXJIWYTnSYKDeBOgiAFCjfM9OsVVF8iSwjgRkAIvFU=; b=o+oXf16q5a9br0W1n3EIarlsQMN5PFs60/utEkF3ezBXSevYOAoT378ntQCfXtB4Wu aVytufdyXHZgcj/u1p88aErqiojJQaicTYawfh6awHaMwENyhdLmjzYXDWSpNFVEmaT9 g+xlZD+vtSEk6P3kxF+PSUttssAROT4tKNRpwm//gFZyWCCGq+fV3JDuBt6KdPBjO/wC r+UMxVm1ibOZ8bty8L/CRm904egbejigP6d5GUaIOFTxYZeakzkjABzr9tnhGyRXjKtJ FjKwDrNyU0IA0dAmNLQyDx8CfciMd65Kfe6ruZTPBmrA7h52BlJtxyF6sYNa4PJTWnDA qyNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610595; x=1718215395; 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=agXJIWYTnSYKDeBOgiAFCjfM9OsVVF8iSwjgRkAIvFU=; b=S4goNplGfl0n6vUvRDWlmnmnjGRlVJ+nnzu5Ci54GcWWyxuGgyt32sh6v8Nb+TBByf hEEF+rUeGQaO698J4EyvDRAkzLJ1gLDCN//PAsCEO0hGuWk37/d+KjnCwF/z0vH+zl5r ILWjZM3K7rvxy4Rn0ZWO5gtpPB3lHsJK1CcaRtcWVUzDS6ozapkyVFBCRvvgec8MPkY1 I2U6UhCywBAtgnRUZblMsIWEm0Y1C+LleckgtM6HDVHVP/hZi35PBw1U8Ssd1fj2n25g Yoo6kpzxEIaHAi+Pn43qxnOJXofivf56m4ly3ouVIqpyMVnJCp6DwCRshZSeESiIjXak j52A== X-Forwarded-Encrypted: i=1; AJvYcCUo5Z9rlfnwWPECE5HRZGnHf1bmJuUYyM2dBzFMIT7YztC3CZyejhQlHmaPXhlENhYEmaLkHfg5vOEHEnTWonvxFcdjBmxdR/+JHjkC1A== X-Gm-Message-State: AOJu0Yw0l01hrdJlXedZZJGYJ41WL4e+z0XOvpEag1pMIYEazOYjn9vm cTS1fcKpspFqrtLzSCF2xuzNUWx/DWhDApw10akClFec3rsCU5+9vaNUnVgGomZlzxfNAUEK2U2 rHWazVzMzVA== X-Google-Smtp-Source: AGHT+IGibORXxKbpFL3XsRdYQmgXN/UUhng7olRjU4TOyjRaG1lHR7Rr+GK+/ZroyCG11D91URPzRvzxS4UOFw== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:388:b0:61b:e519:4d93 with SMTP id 00721157ae682-62cbb5b4538mr8976767b3.8.1717610595275; Wed, 05 Jun 2024 11:03:15 -0700 (PDT) Date: Wed, 5 Jun 2024 18:02:38 +0000 In-Reply-To: <20240605180238.2617808-1-joychakr@google.com> Mime-Version: 1.0 References: <20240605180238.2617808-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605180238.2617808-8-joychakr@google.com> Subject: [PATCH v1 17/17] rtc: 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 , kernel test robot X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_190320_625280_7D26E11B X-CRM114-Status: GOOD ( 18.71 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Change nvmem read/write function definition return type to ssize_t, which is inturn used by devm_rtc_nvmem_register() Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406050200.8BOdZUla-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202406050356.LGDJ3PPU-lk [...] Content analysis details: (-7.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1149 listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM welcome-list -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Change nvmem read/write function definition return type to ssize_t, which is inturn used by devm_rtc_nvmem_register() Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202406050200.8BOdZUla-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202406050356.LGDJ3PPU-lkp@intel.com/ Signed-off-by: Joy Chakraborty --- drivers/rtc/rtc-abx80x.c | 15 ++++++++------- drivers/rtc/rtc-cmos.c | 8 ++++---- drivers/rtc/rtc-ds1305.c | 18 ++++++++++++------ drivers/rtc/rtc-ds1307.c | 22 +++++++++++++-------- drivers/rtc/rtc-ds1343.c | 18 ++++++++++++------ drivers/rtc/rtc-ds1511.c | 12 ++++++------ drivers/rtc/rtc-ds1553.c | 14 ++++++++------ drivers/rtc/rtc-ds1685.c | 14 ++++++++------ drivers/rtc/rtc-ds1742.c | 14 ++++++++------ drivers/rtc/rtc-ds3232.c | 22 +++++++++++++-------- drivers/rtc/rtc-isl12026.c | 12 ++++++------ drivers/rtc/rtc-isl1208.c | 8 ++++---- drivers/rtc/rtc-m48t59.c | 12 ++++++------ drivers/rtc/rtc-m48t86.c | 12 ++++++------ drivers/rtc/rtc-max31335.c | 18 ++++++++++++------ drivers/rtc/rtc-meson.c | 18 ++++++++++++------ drivers/rtc/rtc-omap.c | 12 ++++++------ drivers/rtc/rtc-pcf2127.c | 20 +++++++++++-------- drivers/rtc/rtc-pcf85063.c | 20 +++++++++++++------ drivers/rtc/rtc-pcf85363.c | 39 +++++++++++++++++++++++--------------- drivers/rtc/rtc-rp5c01.c | 14 ++++++++------ drivers/rtc/rtc-rv3028.c | 32 +++++++++++++++++++------------ drivers/rtc/rtc-rv3029c2.c | 20 +++++++++++++------ drivers/rtc/rtc-rv3032.c | 24 +++++++++++++++-------- drivers/rtc/rtc-rv8803.c | 16 ++++++++++------ drivers/rtc/rtc-rx8581.c | 39 +++++++++++++++++++++++--------------- drivers/rtc/rtc-stk17ta8.c | 14 ++++++++------ drivers/rtc/rtc-sun6i.c | 8 ++++---- drivers/rtc/rtc-ti-k3.c | 16 ++++++++++------ drivers/rtc/rtc-twl.c | 20 +++++++++++++------ 30 files changed, 324 insertions(+), 207 deletions(-) diff --git a/drivers/rtc/rtc-abx80x.c b/drivers/rtc/rtc-abx80x.c index fde2b8054c2e..415a575c904b 100644 --- a/drivers/rtc/rtc-abx80x.c +++ b/drivers/rtc/rtc-abx80x.c @@ -685,10 +685,11 @@ static int abx80x_setup_watchdog(struct abx80x_priv *priv) } #endif -static int abx80x_nvmem_xfer(struct abx80x_priv *priv, unsigned int offset, - void *val, size_t bytes, bool write) +static ssize_t abx80x_nvmem_xfer(struct abx80x_priv *priv, unsigned int offset, + void *val, size_t bytes, bool write) { int ret; + size_t byte_count = bytes; while (bytes) { u8 extram, reg, len, lower, upper; @@ -719,17 +720,17 @@ static int abx80x_nvmem_xfer(struct abx80x_priv *priv, unsigned int offset, bytes -= len; } - return 0; + return byte_count; } -static int abx80x_nvmem_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t abx80x_nvmem_read(void *priv, unsigned int offset, void *val, + size_t bytes) { return abx80x_nvmem_xfer(priv, offset, val, bytes, false); } -static int abx80x_nvmem_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t abx80x_nvmem_write(void *priv, unsigned int offset, void *val, + size_t bytes) { return abx80x_nvmem_xfer(priv, offset, val, bytes, true); } diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c index 7d99cd2c37a0..eb8e6947a7e3 100644 --- a/drivers/rtc/rtc-cmos.c +++ b/drivers/rtc/rtc-cmos.c @@ -639,8 +639,8 @@ static const struct rtc_class_ops cmos_rtc_ops = { #define NVRAM_OFFSET (RTC_REG_D + 1) -static int cmos_nvram_read(void *priv, unsigned int off, void *val, - size_t count) +static ssize_t cmos_nvram_read(void *priv, unsigned int off, void *val, + size_t count) { unsigned char *buf = val; int retval; @@ -660,8 +660,8 @@ static int cmos_nvram_read(void *priv, unsigned int off, void *val, return retval; } -static int cmos_nvram_write(void *priv, unsigned int off, void *val, - size_t count) +static ssize_t cmos_nvram_write(void *priv, unsigned int off, void *val, + size_t count) { struct cmos_rtc *cmos = priv; unsigned char *buf = val; diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index d4de401548b4..d59798c93dd8 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c @@ -504,34 +504,40 @@ static void msg_init(struct spi_message *m, struct spi_transfer *x, spi_message_add_tail(x, m); } -static int ds1305_nvram_read(void *priv, unsigned int off, void *buf, - size_t count) +static ssize_t ds1305_nvram_read(void *priv, unsigned int off, void *buf, + size_t count) { struct ds1305 *ds1305 = priv; struct spi_device *spi = ds1305->spi; u8 addr; struct spi_message m; struct spi_transfer x[2]; + int ret; addr = DS1305_NVRAM + off; msg_init(&m, x, &addr, count, NULL, buf); - return spi_sync(spi, &m); + ret = spi_sync(spi, &m); + + return ret < 0 ? ret : count; } -static int ds1305_nvram_write(void *priv, unsigned int off, void *buf, - size_t count) +static ssize_t ds1305_nvram_write(void *priv, unsigned int off, void *buf, + size_t count) { struct ds1305 *ds1305 = priv; struct spi_device *spi = ds1305->spi; u8 addr; struct spi_message m; struct spi_transfer x[2]; + int ret; addr = (DS1305_WRITE | DS1305_NVRAM) + off; msg_init(&m, x, &addr, count, buf, NULL); - return spi_sync(spi, &m); + ret = spi_sync(spi, &m); + + return ret < 0 ? ret : count; } /*----------------------------------------------------------------------*/ diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index 506b7d1c2397..179bb3b930d9 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -1254,24 +1254,30 @@ static int ds1307_add_frequency_test(struct ds1307 *ds1307) /*----------------------------------------------------------------------*/ -static int ds1307_nvram_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t ds1307_nvram_read(void *priv, unsigned int offset, void *val, + size_t bytes) { struct ds1307 *ds1307 = priv; const struct chip_desc *chip = &chips[ds1307->type]; + int ret; - return regmap_bulk_read(ds1307->regmap, chip->nvram_offset + offset, - val, bytes); + ret = regmap_bulk_read(ds1307->regmap, chip->nvram_offset + offset, + val, bytes); + + return ret < 0 ? ret : bytes; } -static int ds1307_nvram_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t ds1307_nvram_write(void *priv, unsigned int offset, void *val, + size_t bytes) { struct ds1307 *ds1307 = priv; const struct chip_desc *chip = &chips[ds1307->type]; + int ret; + + ret = regmap_bulk_write(ds1307->regmap, chip->nvram_offset + offset, + val, bytes); - return regmap_bulk_write(ds1307->regmap, chip->nvram_offset + offset, - val, bytes); + return ret < 0 ? ret : bytes; } /*----------------------------------------------------------------------*/ diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c index ed5a6ba89a3e..910ee0a0320c 100644 --- a/drivers/rtc/rtc-ds1343.c +++ b/drivers/rtc/rtc-ds1343.c @@ -123,20 +123,26 @@ static ssize_t ds1343_store_glitchfilter(struct device *dev, static DEVICE_ATTR(glitch_filter, S_IRUGO | S_IWUSR, ds1343_show_glitchfilter, ds1343_store_glitchfilter); -static int ds1343_nvram_write(void *priv, unsigned int off, void *val, - size_t bytes) +static ssize_t ds1343_nvram_write(void *priv, unsigned int off, void *val, + size_t bytes) { struct ds1343_priv *ds1343 = priv; + int ret; - return regmap_bulk_write(ds1343->map, DS1343_NVRAM + off, val, bytes); + ret = regmap_bulk_write(ds1343->map, DS1343_NVRAM + off, val, bytes); + + return ret < 0 ? ret : bytes; } -static int ds1343_nvram_read(void *priv, unsigned int off, void *val, - size_t bytes) +static ssize_t ds1343_nvram_read(void *priv, unsigned int off, void *val, + size_t bytes) { struct ds1343_priv *ds1343 = priv; + int ret; + + ret = regmap_bulk_read(ds1343->map, DS1343_NVRAM + off, val, bytes); - return regmap_bulk_read(ds1343->map, DS1343_NVRAM + off, val, bytes); + return ret < 0 ? ret : bytes; } static ssize_t ds1343_show_tricklecharger(struct device *dev, diff --git a/drivers/rtc/rtc-ds1511.c b/drivers/rtc/rtc-ds1511.c index 8b087d9556be..87128130e106 100644 --- a/drivers/rtc/rtc-ds1511.c +++ b/drivers/rtc/rtc-ds1511.c @@ -245,8 +245,8 @@ static const struct rtc_class_ops ds1511_rtc_ops = { .alarm_irq_enable = ds1511_rtc_alarm_irq_enable, }; -static int ds1511_nvram_read(void *priv, unsigned int pos, void *buf, - size_t size) +static ssize_t ds1511_nvram_read(void *priv, unsigned int pos, void *buf, + size_t size) { int i; @@ -254,11 +254,11 @@ static int ds1511_nvram_read(void *priv, unsigned int pos, void *buf, for (i = 0; i < size; i++) *(char *)buf++ = rtc_read(DS1511_RAMDATA); - return 0; + return size; } -static int ds1511_nvram_write(void *priv, unsigned int pos, void *buf, - size_t size) +static ssize_t ds1511_nvram_write(void *priv, unsigned int pos, void *buf, + size_t size) { int i; @@ -266,7 +266,7 @@ static int ds1511_nvram_write(void *priv, unsigned int pos, void *buf, for (i = 0; i < size; i++) rtc_write(*(char *)buf++, DS1511_RAMDATA); - return 0; + return size; } static int ds1511_rtc_probe(struct platform_device *pdev) diff --git a/drivers/rtc/rtc-ds1553.c b/drivers/rtc/rtc-ds1553.c index dbff5b621ef5..ac4304ec21fa 100644 --- a/drivers/rtc/rtc-ds1553.c +++ b/drivers/rtc/rtc-ds1553.c @@ -221,30 +221,32 @@ static const struct rtc_class_ops ds1553_rtc_ops = { .alarm_irq_enable = ds1553_rtc_alarm_irq_enable, }; -static int ds1553_nvram_read(void *priv, unsigned int pos, void *val, - size_t bytes) +static ssize_t ds1553_nvram_read(void *priv, unsigned int pos, void *val, + size_t bytes) { struct platform_device *pdev = priv; struct rtc_plat_data *pdata = platform_get_drvdata(pdev); void __iomem *ioaddr = pdata->ioaddr; + size_t bytes_read = bytes; u8 *buf = val; for (; bytes; bytes--) *buf++ = readb(ioaddr + pos++); - return 0; + return bytes_read; } -static int ds1553_nvram_write(void *priv, unsigned int pos, void *val, - size_t bytes) +static ssize_t ds1553_nvram_write(void *priv, unsigned int pos, void *val, + size_t bytes) { struct platform_device *pdev = priv; struct rtc_plat_data *pdata = platform_get_drvdata(pdev); void __iomem *ioaddr = pdata->ioaddr; + size_t bytes_written = bytes; u8 *buf = val; for (; bytes; bytes--) writeb(*buf++, ioaddr + pos++); - return 0; + return bytes_written; } static int ds1553_rtc_probe(struct platform_device *pdev) diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c index 04dbf35cf3b7..0f113cff4b69 100644 --- a/drivers/rtc/rtc-ds1685.c +++ b/drivers/rtc/rtc-ds1685.c @@ -837,11 +837,12 @@ ds1685_rtc_ops = { }; /* ----------------------------------------------------------------------- */ -static int ds1685_nvram_read(void *priv, unsigned int pos, void *val, - size_t size) +static ssize_t ds1685_nvram_read(void *priv, unsigned int pos, void *val, + size_t size) { struct ds1685_priv *rtc = priv; struct mutex *rtc_mutex = &rtc->dev->ops_lock; + size_t size_read = size; ssize_t count; u8 *buf = val; int err; @@ -901,14 +902,15 @@ static int ds1685_nvram_read(void *priv, unsigned int pos, void *val, #endif /* !CONFIG_RTC_DRV_DS1689 */ mutex_unlock(rtc_mutex); - return 0; + return size_read; } -static int ds1685_nvram_write(void *priv, unsigned int pos, void *val, - size_t size) +static ssize_t ds1685_nvram_write(void *priv, unsigned int pos, void *val, + size_t size) { struct ds1685_priv *rtc = priv; struct mutex *rtc_mutex = &rtc->dev->ops_lock; + size_t size_written = size; ssize_t count; u8 *buf = val; int err; @@ -968,7 +970,7 @@ static int ds1685_nvram_write(void *priv, unsigned int pos, void *val, #endif /* !CONFIG_RTC_DRV_DS1689 */ mutex_unlock(rtc_mutex); - return 0; + return size_written; } /* ----------------------------------------------------------------------- */ diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c index 6ae8b9a294fe..cdc3159dd69a 100644 --- a/drivers/rtc/rtc-ds1742.c +++ b/drivers/rtc/rtc-ds1742.c @@ -114,28 +114,30 @@ static const struct rtc_class_ops ds1742_rtc_ops = { .set_time = ds1742_rtc_set_time, }; -static int ds1742_nvram_read(void *priv, unsigned int pos, void *val, - size_t bytes) +static ssize_t ds1742_nvram_read(void *priv, unsigned int pos, void *val, + size_t bytes) { struct rtc_plat_data *pdata = priv; void __iomem *ioaddr = pdata->ioaddr_nvram; + ssize_t bytes_read = bytes; u8 *buf = val; for (; bytes; bytes--) *buf++ = readb(ioaddr + pos++); - return 0; + return bytes_read; } -static int ds1742_nvram_write(void *priv, unsigned int pos, void *val, - size_t bytes) +static ssize_t ds1742_nvram_write(void *priv, unsigned int pos, void *val, + size_t bytes) { struct rtc_plat_data *pdata = priv; void __iomem *ioaddr = pdata->ioaddr_nvram; + ssize_t bytes_written = bytes; u8 *buf = val; for (; bytes; bytes--) writeb(*buf++, ioaddr + pos++); - return 0; + return bytes_written; } static int ds1742_rtc_probe(struct platform_device *pdev) diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c index 1485a6ae51e6..0ea97da761b6 100644 --- a/drivers/rtc/rtc-ds3232.c +++ b/drivers/rtc/rtc-ds3232.c @@ -460,22 +460,28 @@ static const struct rtc_class_ops ds3232_rtc_ops = { .alarm_irq_enable = ds3232_alarm_irq_enable, }; -static int ds3232_nvmem_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t ds3232_nvmem_read(void *priv, unsigned int offset, void *val, + size_t bytes) { struct regmap *ds3232_regmap = (struct regmap *)priv; + int ret; - return regmap_bulk_read(ds3232_regmap, DS3232_REG_SRAM_START + offset, - val, bytes); + ret = regmap_bulk_read(ds3232_regmap, DS3232_REG_SRAM_START + offset, + val, bytes); + + return ret < 0 ? ret : bytes; } -static int ds3232_nvmem_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t ds3232_nvmem_write(void *priv, unsigned int offset, void *val, + size_t bytes) { struct regmap *ds3232_regmap = (struct regmap *)priv; + int ret; + + ret = regmap_bulk_write(ds3232_regmap, DS3232_REG_SRAM_START + offset, + val, bytes); - return regmap_bulk_write(ds3232_regmap, DS3232_REG_SRAM_START + offset, - val, bytes); + return ret < 0 ? ret : bytes; } static int ds3232_probe(struct device *dev, struct regmap *regmap, int irq, diff --git a/drivers/rtc/rtc-isl12026.c b/drivers/rtc/rtc-isl12026.c index 2aabb9151d4c..0368cf3c95cd 100644 --- a/drivers/rtc/rtc-isl12026.c +++ b/drivers/rtc/rtc-isl12026.c @@ -274,8 +274,8 @@ static const struct rtc_class_ops isl12026_rtc_ops = { .set_time = isl12026_rtc_set_time, }; -static int isl12026_nvm_read(void *p, unsigned int offset, - void *val, size_t bytes) +static ssize_t isl12026_nvm_read(void *p, unsigned int offset, + void *val, size_t bytes) { struct isl12026 *priv = p; int ret; @@ -315,11 +315,11 @@ static int isl12026_nvm_read(void *p, unsigned int offset, return ret < 0 ? ret : -EIO; } - return 0; + return bytes; } -static int isl12026_nvm_write(void *p, unsigned int offset, - void *val, size_t bytes) +static ssize_t isl12026_nvm_write(void *p, unsigned int offset, + void *val, size_t bytes) { struct isl12026 *priv = p; int ret; @@ -372,7 +372,7 @@ static int isl12026_nvm_write(void *p, unsigned int offset, mutex_unlock(&priv->rtc->ops_lock); - return ret; + return ret < 0 ? ret : num_written; } static void isl12026_force_power_modes(struct i2c_client *client) diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c index e50c23ee1646..3523c18f4034 100644 --- a/drivers/rtc/rtc-isl1208.c +++ b/drivers/rtc/rtc-isl1208.c @@ -770,8 +770,8 @@ static const struct attribute_group isl1219_rtc_sysfs_files = { .attrs = isl1219_rtc_attrs, }; -static int isl1208_nvmem_read(void *priv, unsigned int off, void *buf, - size_t count) +static ssize_t isl1208_nvmem_read(void *priv, unsigned int off, void *buf, + size_t count) { struct isl1208_state *isl1208 = priv; struct i2c_client *client = to_i2c_client(isl1208->rtc->dev.parent); @@ -785,8 +785,8 @@ static int isl1208_nvmem_read(void *priv, unsigned int off, void *buf, return ret == 0 ? count : ret; } -static int isl1208_nvmem_write(void *priv, unsigned int off, void *buf, - size_t count) +static ssize_t isl1208_nvmem_write(void *priv, unsigned int off, void *buf, + size_t count) { struct isl1208_state *isl1208 = priv; struct i2c_client *client = to_i2c_client(isl1208->rtc->dev.parent); diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c index f0f6b9b6daec..53e21878effc 100644 --- a/drivers/rtc/rtc-m48t59.c +++ b/drivers/rtc/rtc-m48t59.c @@ -313,8 +313,8 @@ static const struct rtc_class_ops m48t59_rtc_ops = { .alarm_irq_enable = m48t59_rtc_alarm_irq_enable, }; -static int m48t59_nvram_read(void *priv, unsigned int offset, void *val, - size_t size) +static ssize_t m48t59_nvram_read(void *priv, unsigned int offset, void *val, + size_t size) { struct platform_device *pdev = priv; struct device *dev = &pdev->dev; @@ -331,11 +331,11 @@ static int m48t59_nvram_read(void *priv, unsigned int offset, void *val, spin_unlock_irqrestore(&m48t59->lock, flags); - return 0; + return cnt; } -static int m48t59_nvram_write(void *priv, unsigned int offset, void *val, - size_t size) +static ssize_t m48t59_nvram_write(void *priv, unsigned int offset, void *val, + size_t size) { struct platform_device *pdev = priv; struct device *dev = &pdev->dev; @@ -352,7 +352,7 @@ static int m48t59_nvram_write(void *priv, unsigned int offset, void *val, spin_unlock_irqrestore(&m48t59->lock, flags); - return 0; + return cnt; } static int m48t59_rtc_probe(struct platform_device *pdev) diff --git a/drivers/rtc/rtc-m48t86.c b/drivers/rtc/rtc-m48t86.c index dd4a62e2d39c..c10829617d2e 100644 --- a/drivers/rtc/rtc-m48t86.c +++ b/drivers/rtc/rtc-m48t86.c @@ -161,8 +161,8 @@ static const struct rtc_class_ops m48t86_rtc_ops = { .proc = m48t86_rtc_proc, }; -static int m48t86_nvram_read(void *priv, unsigned int off, void *buf, - size_t count) +static ssize_t m48t86_nvram_read(void *priv, unsigned int off, void *buf, + size_t count) { struct device *dev = priv; unsigned int i; @@ -170,11 +170,11 @@ static int m48t86_nvram_read(void *priv, unsigned int off, void *buf, for (i = 0; i < count; i++) ((u8 *)buf)[i] = m48t86_readb(dev, M48T86_NVRAM(off + i)); - return 0; + return count; } -static int m48t86_nvram_write(void *priv, unsigned int off, void *buf, - size_t count) +static ssize_t m48t86_nvram_write(void *priv, unsigned int off, void *buf, + size_t count) { struct device *dev = priv; unsigned int i; @@ -182,7 +182,7 @@ static int m48t86_nvram_write(void *priv, unsigned int off, void *buf, for (i = 0; i < count; i++) m48t86_writeb(dev, ((u8 *)buf)[i], M48T86_NVRAM(off + i)); - return 0; + return count; } /* diff --git a/drivers/rtc/rtc-max31335.c b/drivers/rtc/rtc-max31335.c index a2441e5c2c74..03f29ed19e58 100644 --- a/drivers/rtc/rtc-max31335.c +++ b/drivers/rtc/rtc-max31335.c @@ -496,22 +496,28 @@ static struct clk_init_data max31335_clk_init = { .ops = &max31335_clkout_ops, }; -static int max31335_nvmem_reg_read(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t max31335_nvmem_reg_read(void *priv, unsigned int offset, + void *val, size_t bytes) { struct max31335_data *max31335 = priv; unsigned int reg = MAX31335_TS0_SEC_1_128 + offset; + int ret; + + ret = regmap_bulk_read(max31335->regmap, reg, val, bytes); - return regmap_bulk_read(max31335->regmap, reg, val, bytes); + return ret < 0 ? ret : bytes; } -static int max31335_nvmem_reg_write(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t max31335_nvmem_reg_write(void *priv, unsigned int offset, + void *val, size_t bytes) { struct max31335_data *max31335 = priv; unsigned int reg = MAX31335_TS0_SEC_1_128 + offset; + int ret; + + ret = regmap_bulk_write(max31335->regmap, reg, val, bytes); - return regmap_bulk_write(max31335->regmap, reg, val, bytes); + return ret < 0 ? ret : bytes; } static struct nvmem_config max31335_nvmem_cfg = { diff --git a/drivers/rtc/rtc-meson.c b/drivers/rtc/rtc-meson.c index db1d626edca5..0e4d05a4c68d 100644 --- a/drivers/rtc/rtc-meson.c +++ b/drivers/rtc/rtc-meson.c @@ -255,28 +255,34 @@ static const struct rtc_class_ops meson_rtc_ops = { /* NVMEM interface layer functions */ -static int meson_rtc_regmem_read(void *context, unsigned int offset, - void *buf, size_t bytes) +static ssize_t meson_rtc_regmem_read(void *context, unsigned int offset, + void *buf, size_t bytes) { struct meson_rtc *rtc = context; unsigned int read_offset, read_size; + int ret; read_offset = RTC_REGMEM_0 + (offset / 4); read_size = bytes / 4; - return regmap_bulk_read(rtc->serial, read_offset, buf, read_size); + ret = regmap_bulk_read(rtc->serial, read_offset, buf, read_size); + + return ret < 0 ? ret : bytes; } -static int meson_rtc_regmem_write(void *context, unsigned int offset, - void *buf, size_t bytes) +static ssize_t meson_rtc_regmem_write(void *context, unsigned int offset, + void *buf, size_t bytes) { struct meson_rtc *rtc = context; unsigned int write_offset, write_size; + int ret; write_offset = RTC_REGMEM_0 + (offset / 4); write_size = bytes / 4; - return regmap_bulk_write(rtc->serial, write_offset, buf, write_size); + ret = regmap_bulk_write(rtc->serial, write_offset, buf, write_size); + + return ret < 0 ? ret : bytes; } static int meson_rtc_probe(struct platform_device *pdev) diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index c6155c48a4ac..81cad3c3690b 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -685,8 +685,8 @@ static struct pinctrl_desc rtc_pinctrl_desc = { .owner = THIS_MODULE, }; -static int omap_rtc_scratch_read(void *priv, unsigned int offset, void *_val, - size_t bytes) +static ssize_t omap_rtc_scratch_read(void *priv, unsigned int offset, void *_val, + size_t bytes) { struct omap_rtc *rtc = priv; u32 *val = _val; @@ -696,11 +696,11 @@ static int omap_rtc_scratch_read(void *priv, unsigned int offset, void *_val, val[i] = rtc_readl(rtc, OMAP_RTC_SCRATCH0_REG + offset + (i * 4)); - return 0; + return bytes; } -static int omap_rtc_scratch_write(void *priv, unsigned int offset, void *_val, - size_t bytes) +static ssize_t omap_rtc_scratch_write(void *priv, unsigned int offset, void *_val, + size_t bytes) { struct omap_rtc *rtc = priv; u32 *val = _val; @@ -712,7 +712,7 @@ static int omap_rtc_scratch_write(void *priv, unsigned int offset, void *_val, OMAP_RTC_SCRATCH0_REG + offset + (i * 4), val[i]); rtc->type->lock(rtc); - return 0; + return bytes; } static struct nvmem_config omap_rtc_nvmem_config = { diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc/rtc-pcf2127.c index 9c04c4e1a49c..0303cf51fb3e 100644 --- a/drivers/rtc/rtc-pcf2127.c +++ b/drivers/rtc/rtc-pcf2127.c @@ -361,8 +361,8 @@ static int pcf2127_rtc_ioctl(struct device *dev, } } -static int pcf2127_nvmem_read(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t pcf2127_nvmem_read(void *priv, unsigned int offset, + void *val, size_t bytes) { struct pcf2127 *pcf2127 = priv; int ret; @@ -373,12 +373,14 @@ static int pcf2127_nvmem_read(void *priv, unsigned int offset, if (ret) return ret; - return regmap_bulk_read(pcf2127->regmap, PCF2127_REG_RAM_RD_CMD, - val, bytes); + ret = regmap_bulk_read(pcf2127->regmap, PCF2127_REG_RAM_RD_CMD, + val, bytes); + + return ret < 0 ? ret : bytes; } -static int pcf2127_nvmem_write(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t pcf2127_nvmem_write(void *priv, unsigned int offset, + void *val, size_t bytes) { struct pcf2127 *pcf2127 = priv; int ret; @@ -389,8 +391,10 @@ static int pcf2127_nvmem_write(void *priv, unsigned int offset, if (ret) return ret; - return regmap_bulk_write(pcf2127->regmap, PCF2127_REG_RAM_WRT_CMD, - val, bytes); + ret = regmap_bulk_write(pcf2127->regmap, PCF2127_REG_RAM_WRT_CMD, + val, bytes); + + return ret < 0 ? ret : bytes; } /* watchdog driver */ diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c index fdbc07f14036..bccb55b4985c 100644 --- a/drivers/rtc/rtc-pcf85063.c +++ b/drivers/rtc/rtc-pcf85063.c @@ -319,16 +319,24 @@ static const struct rtc_class_ops pcf85063_rtc_ops = { .ioctl = pcf85063_ioctl, }; -static int pcf85063_nvmem_read(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t pcf85063_nvmem_read(void *priv, unsigned int offset, + void *val, size_t bytes) { - return regmap_read(priv, PCF85063_REG_RAM, val); + int ret; + + ret = regmap_read(priv, PCF85063_REG_RAM, val); + + return ret < 0 ? ret : bytes; } -static int pcf85063_nvmem_write(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t pcf85063_nvmem_write(void *priv, unsigned int offset, + void *val, size_t bytes) { - return regmap_write(priv, PCF85063_REG_RAM, *(u8 *)val); + int ret; + + ret = regmap_write(priv, PCF85063_REG_RAM, *(u8 *)val); + + return ret < 0 ? ret : bytes; } static int pcf85063_load_capacitance(struct pcf85063 *pcf85063, diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c index 540042b9eec8..3ad91f2ee417 100644 --- a/drivers/rtc/rtc-pcf85363.c +++ b/drivers/rtc/rtc-pcf85363.c @@ -319,26 +319,32 @@ static const struct rtc_class_ops rtc_ops = { .alarm_irq_enable = pcf85363_rtc_alarm_irq_enable, }; -static int pcf85363_nvram_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t pcf85363_nvram_read(void *priv, unsigned int offset, void *val, + size_t bytes) { struct pcf85363 *pcf85363 = priv; + int ret; - return regmap_bulk_read(pcf85363->regmap, CTRL_RAM + offset, - val, bytes); + ret = regmap_bulk_read(pcf85363->regmap, CTRL_RAM + offset, + val, bytes); + + return ret < 0 ? ret : bytes; } -static int pcf85363_nvram_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t pcf85363_nvram_write(void *priv, unsigned int offset, void *val, + size_t bytes) { struct pcf85363 *pcf85363 = priv; + int ret; - return regmap_bulk_write(pcf85363->regmap, CTRL_RAM + offset, - val, bytes); + ret = regmap_bulk_write(pcf85363->regmap, CTRL_RAM + offset, + val, bytes); + + return ret < 0 ? ret : bytes; } -static int pcf85x63_nvram_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t pcf85x63_nvram_read(void *priv, unsigned int offset, void *val, + size_t bytes) { struct pcf85363 *pcf85363 = priv; unsigned int tmp_val; @@ -347,18 +353,21 @@ static int pcf85x63_nvram_read(void *priv, unsigned int offset, void *val, ret = regmap_read(pcf85363->regmap, CTRL_RAMBYTE, &tmp_val); (*(unsigned char *) val) = (unsigned char) tmp_val; - return ret; + return ret < 0 ? ret : bytes; } -static int pcf85x63_nvram_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t pcf85x63_nvram_write(void *priv, unsigned int offset, void *val, + size_t bytes) { struct pcf85363 *pcf85363 = priv; unsigned char tmp_val; + int ret; tmp_val = *((unsigned char *)val); - return regmap_write(pcf85363->regmap, CTRL_RAMBYTE, - (unsigned int)tmp_val); + ret = regmap_write(pcf85363->regmap, CTRL_RAMBYTE, + (unsigned int)tmp_val); + + return ret < 0 ? ret : bytes; } static const struct pcf85x63_config pcf_85263_config = { diff --git a/drivers/rtc/rtc-rp5c01.c b/drivers/rtc/rtc-rp5c01.c index 44afa6d996e7..156f9086caab 100644 --- a/drivers/rtc/rtc-rp5c01.c +++ b/drivers/rtc/rtc-rp5c01.c @@ -160,10 +160,11 @@ static const struct rtc_class_ops rp5c01_rtc_ops = { * byte is stored in BLOCK10, the low nibble in BLOCK11. */ -static int rp5c01_nvram_read(void *_priv, unsigned int pos, void *val, - size_t bytes) +static ssize_t rp5c01_nvram_read(void *_priv, unsigned int pos, void *val, + size_t bytes) { struct rp5c01_priv *priv = _priv; + size_t bytes_read = bytes; u8 *buf = val; spin_lock_irq(&priv->lock); @@ -185,13 +186,14 @@ static int rp5c01_nvram_read(void *_priv, unsigned int pos, void *val, } spin_unlock_irq(&priv->lock); - return 0; + return bytes_read; } -static int rp5c01_nvram_write(void *_priv, unsigned int pos, void *val, - size_t bytes) +static ssize_t rp5c01_nvram_write(void *_priv, unsigned int pos, void *val, + size_t bytes) { struct rp5c01_priv *priv = _priv; + size_t bytes_written = bytes; u8 *buf = val; spin_lock_irq(&priv->lock); @@ -212,7 +214,7 @@ static int rp5c01_nvram_write(void *_priv, unsigned int pos, void *val, } spin_unlock_irq(&priv->lock); - return 0; + return bytes_written; } static int __init rp5c01_rtc_probe(struct platform_device *dev) diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c index 2f001c59c61d..3e2c6497f4d7 100644 --- a/drivers/rtc/rtc-rv3028.c +++ b/drivers/rtc/rtc-rv3028.c @@ -600,20 +600,28 @@ static int rv3028_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) } } -static int rv3028_nvram_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t rv3028_nvram_write(void *priv, unsigned int offset, void *val, + size_t bytes) { - return regmap_bulk_write(priv, RV3028_RAM1 + offset, val, bytes); + int ret; + + ret = regmap_bulk_write(priv, RV3028_RAM1 + offset, val, bytes); + + return ret < 0 ? ret : bytes; } -static int rv3028_nvram_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t rv3028_nvram_read(void *priv, unsigned int offset, void *val, + size_t bytes) { - return regmap_bulk_read(priv, RV3028_RAM1 + offset, val, bytes); + int ret; + + ret = regmap_bulk_read(priv, RV3028_RAM1 + offset, val, bytes); + + return ret < 0 ? ret : bytes; } -static int rv3028_eeprom_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t rv3028_eeprom_write(void *priv, unsigned int offset, void *val, + size_t bytes) { struct rv3028_data *rv3028 = priv; u32 status, eerd; @@ -655,11 +663,11 @@ static int rv3028_eeprom_write(void *priv, unsigned int offset, void *val, restore_eerd: rv3028_exit_eerd(rv3028, eerd); - return ret; + return ret < 0 ? ret : bytes; } -static int rv3028_eeprom_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t rv3028_eeprom_read(void *priv, unsigned int offset, void *val, + size_t bytes) { struct rv3028_data *rv3028 = priv; u32 status, eerd, data; @@ -700,7 +708,7 @@ static int rv3028_eeprom_read(void *priv, unsigned int offset, void *val, restore_eerd: rv3028_exit_eerd(rv3028, eerd); - return ret; + return ret < 0 ? ret : bytes; } #ifdef CONFIG_COMMON_CLK diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c index 4a81feeb00ff..63466d76eaa1 100644 --- a/drivers/rtc/rtc-rv3029c2.c +++ b/drivers/rtc/rtc-rv3029c2.c @@ -472,16 +472,24 @@ static int rv3029_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) } } -static int rv3029_nvram_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t rv3029_nvram_write(void *priv, unsigned int offset, void *val, + size_t bytes) { - return regmap_bulk_write(priv, RV3029_RAM_PAGE + offset, val, bytes); + int ret; + + ret = regmap_bulk_write(priv, RV3029_RAM_PAGE + offset, val, bytes); + + return ret < 0 ? ret : bytes; } -static int rv3029_nvram_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t rv3029_nvram_read(void *priv, unsigned int offset, void *val, + size_t bytes) { - return regmap_bulk_read(priv, RV3029_RAM_PAGE + offset, val, bytes); + int ret; + + ret = regmap_bulk_read(priv, RV3029_RAM_PAGE + offset, val, bytes); + + return ret < 0 ? ret : bytes; } static const struct rv3029_trickle_tab_elem { diff --git a/drivers/rtc/rtc-rv3032.c b/drivers/rtc/rtc-rv3032.c index 35b2e36b426a..179ea03725c1 100644 --- a/drivers/rtc/rtc-rv3032.c +++ b/drivers/rtc/rtc-rv3032.c @@ -484,17 +484,25 @@ static int rv3032_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) } } -static int rv3032_nvram_write(void *priv, unsigned int offset, void *val, size_t bytes) +static ssize_t rv3032_nvram_write(void *priv, unsigned int offset, void *val, size_t bytes) { - return regmap_bulk_write(priv, RV3032_RAM1 + offset, val, bytes); + int ret; + + ret = regmap_bulk_write(priv, RV3032_RAM1 + offset, val, bytes); + + return ret < 0 ? ret : bytes; } -static int rv3032_nvram_read(void *priv, unsigned int offset, void *val, size_t bytes) +static ssize_t rv3032_nvram_read(void *priv, unsigned int offset, void *val, size_t bytes) { - return regmap_bulk_read(priv, RV3032_RAM1 + offset, val, bytes); + int ret; + + ret = regmap_bulk_read(priv, RV3032_RAM1 + offset, val, bytes); + + return ret < 0 ? ret : bytes; } -static int rv3032_eeprom_write(void *priv, unsigned int offset, void *val, size_t bytes) +static ssize_t rv3032_eeprom_write(void *priv, unsigned int offset, void *val, size_t bytes) { struct rv3032_data *rv3032 = priv; u32 status, eerd; @@ -532,10 +540,10 @@ static int rv3032_eeprom_write(void *priv, unsigned int offset, void *val, size_ exit_eerd: rv3032_exit_eerd(rv3032, eerd); - return ret; + return ret < 0 ? ret : bytes; } -static int rv3032_eeprom_read(void *priv, unsigned int offset, void *val, size_t bytes) +static ssize_t rv3032_eeprom_read(void *priv, unsigned int offset, void *val, size_t bytes) { struct rv3032_data *rv3032 = priv; u32 status, eerd, data; @@ -572,7 +580,7 @@ static int rv3032_eeprom_read(void *priv, unsigned int offset, void *val, size_t exit_eerd: rv3032_exit_eerd(rv3032, eerd); - return ret; + return ret < 0 ? ret : bytes; } static int rv3032_trickle_charger_setup(struct device *dev, struct rv3032_data *rv3032) diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c index 1327251e527c..a6b02b78b0e6 100644 --- a/drivers/rtc/rtc-rv8803.c +++ b/drivers/rtc/rtc-rv8803.c @@ -536,14 +536,18 @@ static int rv8803_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) } } -static int rv8803_nvram_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t rv8803_nvram_write(void *priv, unsigned int offset, void *val, + size_t bytes) { - return rv8803_write_reg(priv, RV8803_RAM, *(u8 *)val); + int ret; + + ret = rv8803_write_reg(priv, RV8803_RAM, *(u8 *)val); + + return ret < 0 ? ret : bytes; } -static int rv8803_nvram_read(void *priv, unsigned int offset, - void *val, size_t bytes) +static ssize_t rv8803_nvram_read(void *priv, unsigned int offset, + void *val, size_t bytes) { int ret; @@ -553,7 +557,7 @@ static int rv8803_nvram_read(void *priv, unsigned int offset, *(u8 *)val = ret; - return 0; + return ret < 0 ? ret : bytes; } static const struct rtc_class_ops rv8803_rtc_ops = { diff --git a/drivers/rtc/rtc-rx8581.c b/drivers/rtc/rtc-rx8581.c index 48efd61a114d..e0d49c2861f2 100644 --- a/drivers/rtc/rtc-rx8581.c +++ b/drivers/rtc/rtc-rx8581.c @@ -187,26 +187,32 @@ static const struct rtc_class_ops rx8581_rtc_ops = { .set_time = rx8581_rtc_set_time, }; -static int rx8571_nvram_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t rx8571_nvram_read(void *priv, unsigned int offset, void *val, + size_t bytes) { struct rx8581 *rx8581 = priv; + int ret; - return regmap_bulk_read(rx8581->regmap, RX8571_USER_RAM + offset, - val, bytes); + ret = regmap_bulk_read(rx8581->regmap, RX8571_USER_RAM + offset, + val, bytes); + + return ret < 0 ? ret : bytes; } -static int rx8571_nvram_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t rx8571_nvram_write(void *priv, unsigned int offset, void *val, + size_t bytes) { struct rx8581 *rx8581 = priv; + int ret; - return regmap_bulk_write(rx8581->regmap, RX8571_USER_RAM + offset, - val, bytes); + ret = regmap_bulk_write(rx8581->regmap, RX8571_USER_RAM + offset, + val, bytes); + + return ret < 0 ? ret : bytes; } -static int rx85x1_nvram_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t rx85x1_nvram_read(void *priv, unsigned int offset, void *val, + size_t bytes) { struct rx8581 *rx8581 = priv; unsigned int tmp_val; @@ -215,18 +221,21 @@ static int rx85x1_nvram_read(void *priv, unsigned int offset, void *val, ret = regmap_read(rx8581->regmap, RX8581_REG_RAM, &tmp_val); (*(unsigned char *)val) = (unsigned char) tmp_val; - return ret; + return ret < 0 ? ret : bytes; } -static int rx85x1_nvram_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t rx85x1_nvram_write(void *priv, unsigned int offset, void *val, + size_t bytes) { struct rx8581 *rx8581 = priv; unsigned char tmp_val; + int ret; tmp_val = *((unsigned char *)val); - return regmap_write(rx8581->regmap, RX8581_REG_RAM, - (unsigned int)tmp_val); + ret = regmap_write(rx8581->regmap, RX8581_REG_RAM, + (unsigned int)tmp_val); + + return ret < 0 ? ret : bytes; } static const struct rx85x1_config rx8581_config = { diff --git a/drivers/rtc/rtc-stk17ta8.c b/drivers/rtc/rtc-stk17ta8.c index 7cb6be1b7815..85d811b68a9b 100644 --- a/drivers/rtc/rtc-stk17ta8.c +++ b/drivers/rtc/rtc-stk17ta8.c @@ -230,28 +230,30 @@ static const struct rtc_class_ops stk17ta8_rtc_ops = { .alarm_irq_enable = stk17ta8_rtc_alarm_irq_enable, }; -static int stk17ta8_nvram_read(void *priv, unsigned int pos, void *val, - size_t bytes) +static ssize_t stk17ta8_nvram_read(void *priv, unsigned int pos, void *val, + size_t bytes) { struct rtc_plat_data *pdata = priv; void __iomem *ioaddr = pdata->ioaddr; + size_t bytes_read = bytes; u8 *buf = val; for (; bytes; bytes--) *buf++ = readb(ioaddr + pos++); - return 0; + return bytes_read; } -static int stk17ta8_nvram_write(void *priv, unsigned int pos, void *val, - size_t bytes) +static ssize_t stk17ta8_nvram_write(void *priv, unsigned int pos, void *val, + size_t bytes) { struct rtc_plat_data *pdata = priv; void __iomem *ioaddr = pdata->ioaddr; + size_t bytes_written = bytes; u8 *buf = val; for (; bytes; bytes--) writeb(*buf++, ioaddr + pos++); - return 0; + return bytes_written; } static int stk17ta8_rtc_probe(struct platform_device *pdev) diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index 8e0c66906103..62fda0f86364 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -675,7 +675,7 @@ static const struct rtc_class_ops sun6i_rtc_ops = { .alarm_irq_enable = sun6i_rtc_alarm_irq_enable }; -static int sun6i_rtc_nvmem_read(void *priv, unsigned int offset, void *_val, size_t bytes) +static ssize_t sun6i_rtc_nvmem_read(void *priv, unsigned int offset, void *_val, size_t bytes) { struct sun6i_rtc_dev *chip = priv; u32 *val = _val; @@ -684,10 +684,10 @@ static int sun6i_rtc_nvmem_read(void *priv, unsigned int offset, void *_val, siz for (i = 0; i < bytes / 4; ++i) val[i] = readl(chip->base + SUN6I_GP_DATA + offset + 4 * i); - return 0; + return bytes; } -static int sun6i_rtc_nvmem_write(void *priv, unsigned int offset, void *_val, size_t bytes) +static ssize_t sun6i_rtc_nvmem_write(void *priv, unsigned int offset, void *_val, size_t bytes) { struct sun6i_rtc_dev *chip = priv; u32 *val = _val; @@ -696,7 +696,7 @@ static int sun6i_rtc_nvmem_write(void *priv, unsigned int offset, void *_val, si for (i = 0; i < bytes / 4; ++i) writel(val[i], chip->base + SUN6I_GP_DATA + offset + 4 * i); - return 0; + return bytes; } static struct nvmem_config sun6i_rtc_nvmem_cfg = { diff --git a/drivers/rtc/rtc-ti-k3.c b/drivers/rtc/rtc-ti-k3.c index ec759d8f7023..9a1097fcdad6 100644 --- a/drivers/rtc/rtc-ti-k3.c +++ b/drivers/rtc/rtc-ti-k3.c @@ -483,16 +483,19 @@ static const struct rtc_class_ops ti_k3_rtc_ops = { .alarm_irq_enable = ti_k3_rtc_alarm_irq_enable, }; -static int ti_k3_rtc_scratch_read(void *priv_data, unsigned int offset, - void *val, size_t bytes) +static ssize_t ti_k3_rtc_scratch_read(void *priv_data, unsigned int offset, + void *val, size_t bytes) { struct ti_k3_rtc *priv = (struct ti_k3_rtc *)priv_data; + int ret; + + ret = regmap_bulk_read(priv->regmap, REG_K3RTC_SCRATCH0 + offset, val, bytes / 4); - return regmap_bulk_read(priv->regmap, REG_K3RTC_SCRATCH0 + offset, val, bytes / 4); + return ret < 0 ? ret : bytes; } -static int ti_k3_rtc_scratch_write(void *priv_data, unsigned int offset, - void *val, size_t bytes) +static ssize_t ti_k3_rtc_scratch_write(void *priv_data, unsigned int offset, + void *val, size_t bytes) { struct ti_k3_rtc *priv = (struct ti_k3_rtc *)priv_data; int ret; @@ -501,7 +504,8 @@ static int ti_k3_rtc_scratch_write(void *priv_data, unsigned int offset, if (ret) return ret; - return k3rtc_fence(priv); + ret = k3rtc_fence(priv); + return ret < 0 ? ret : bytes; } static struct nvmem_config ti_k3_rtc_nvmem_config = { diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c index 13f8ce08243c..b770a5cc1aad 100644 --- a/drivers/rtc/rtc-twl.c +++ b/drivers/rtc/rtc-twl.c @@ -487,16 +487,24 @@ static const struct rtc_class_ops twl_rtc_ops = { .alarm_irq_enable = twl_rtc_alarm_irq_enable, }; -static int twl_nvram_read(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t twl_nvram_read(void *priv, unsigned int offset, void *val, + size_t bytes) { - return twl_i2c_read((long)priv, val, offset, bytes); + int ret; + + ret = twl_i2c_read((long)priv, val, offset, bytes); + + return ret < 0 ? ret : bytes; } -static int twl_nvram_write(void *priv, unsigned int offset, void *val, - size_t bytes) +static ssize_t twl_nvram_write(void *priv, unsigned int offset, void *val, + size_t bytes) { - return twl_i2c_write((long)priv, val, offset, bytes); + int ret; + + ret = twl_i2c_write((long)priv, val, offset, bytes); + + return ret < 0 ? ret : bytes; } /*----------------------------------------------------------------------*/