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: 802446 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B01E613C909 for ; Wed, 5 Jun 2024 18:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610408; cv=none; b=iPplZXqSXBeIBBRVfNNfmXrcWfen+/pccr86PJV7krJSsPusVPV9MDmoaYTEr9QdDaxR4fhjINj/otROl8RBytxwFyBElh+ye8W/1/an1ho1ZK0g7T65ZxL0r9Lxi47XG0Dw2IFe+kcZrizs0SLLnUMwBgO3e63ik0eBc+Kh6Ao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610408; c=relaxed/simple; bh=ipr39Oe7qflzshs+uqKeD5dsLOI2DywzVbGtmwc3XF4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=E+0xhSJhAm5jne4V28BN0rvSsUB92dGok4K7tP47bc9+1ZieBfGoLOnS0G/0jBVS4UUcolTPJ9gOdI44NYutfIMFRmPKHPGWK27ndw4GcDy4dxKryurOTGabj7GPpFl0Tsm+qS2Mcg8cnyS2hxfv5PJ37j1lhZqre/T/kC3U+4w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=J4iEbje9; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="J4iEbje9" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-df7a6530373so127534276.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=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=nEr10taYCu3WGRiwn+CGqfggqJNbp7A+We0V3ygommI=; b=J4iEbje95ninWiXtqqt5T/9d9/rhCySu+uRgj5M+PAahakXxAmJMwbOM3Vl+q9ipwO cR2XMTaT3Cl6rtmhHcCzhm9ADVnFZb1p7yDmg+5o5KLMVVkrKunBBEwcfC6DifTaKXZY +22DMkjtteZbmFu3YZvAFV37gq3FnCxnNGemPsZXaxgCOZFtLwTgb/ySUoNoxgKThXqI /j358DaGUSozaVs/XrXx5gTTjXCJvJ2f3lRsZKCCy3KtAdh0gF3OvCEX+ecoMyu8HbjC QoZmOUWx+hkMmSCw6alLz9KvgAyuX7At1Lbtv2yzZUUbf2fKO7pPiVpatVP+Lflv7Hil VtlQ== 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=jsY0fbVjunMPT/2DqMY0OjkWP8ot8MiKL4wRROfCeJjUjRk79wOJTlmkAMmhrJZ34g Fy9rKwcSbukR6NpmX8rsLRzImHxrfMgHwffapIS9ZSEAW2oaJtggF18WAUYtTKMeKP+w kcuWCc40DYBRb1aKkBZiOo483DPRTQboUcOpCW/B5MK1HjlHx+7O+MjepclkUiAFjPRh sXWTIhpVR15HmALVBcaSr8ChibQKlpZpOSY6LzJ5kkz6Dt1yfJukCfKCL3cakuNg3lRx Bnezk/7+rdEd5c8l8C2k38nYVw370vSgoDdXeaQUPhzLqN64dv+mFpZjAglXtd81RfLq yRjQ== X-Forwarded-Encrypted: i=1; AJvYcCVY7pCnEh7xzGOVGrAdsP+55uPDbEQNxEkdLZ01ttqQu6jnvh0hrUXIYxgWq2U4DagI15q/Bhg9yHWCGXM3hTxvdEgPpkFboz1rNA== X-Gm-Message-State: AOJu0YzxIaKK378RaSPvEehQIJYRHARb1UQZEPN2IXlRj/OCS3ahyLgc KNihsC5+5GkEM2yOgME6sI7uFQzqk3jEMZjvcKBk2lWFQMe/wnuudspksxmTMvp5ZP5OzOeghoF FoaFjy0My6Q== 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240605175953.2613260-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605175953.2613260-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 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: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: 802445 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAF05154BFB for ; Wed, 5 Jun 2024 18:00:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610416; cv=none; b=F0PTdvAqbnzSzJ3xLxoR0HXC4jN5bsKP1x//JnbIIlaghP1ev7zXEff2AFssX4yPbGC3e+wuU+C+5W/Tv/ugWSjZdjDVN0+LP5bSsi506nXPq9xZP+yhbWcHo2Q/wMg5VWdxJWI8zXIs0+OtM/zQGziQtGUt/+fq1RAu5bj+M4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610416; c=relaxed/simple; bh=fPdJt4Gydxsb6XLYSRdNJ8hD/W3THq9fKXubquLZs6s=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=i6pO2TMpfF9WSxmEgO2OgQMj+dJxB2O9ZPUNseanigLTQlD7BtCocaUnhG3NIxZlrSfBprkFCXYw4oXWpSwDxDW+dNjlwGkinP6gV7VE76oS46/YUkYaxsln0x6hrQ1WF8mMvYy39CpyJZZZ/x0v8Oz9aGL9L9BspHrFDVUYwuc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=yNqgUmHy; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="yNqgUmHy" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-62c7a4f8cd6so669627b3.0 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=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=qvmsbFq1f0xb8qTUeLHIrwaOpt4YNpx3HYdX4+QrPhA=; b=yNqgUmHy2UkDE3heRRb8oMaXmLeLXyM1i27wFJS/QU6flgxbWEI6TZ7da1x1XjqPQO VlQ19oRwmx0Yd/blYB/OvER0B5Y/49RGI6us/PAl60yjXA5+o8wOy5hEfj5ZadolRbK+ XWIHPanx9sQPLs2/5sl8VyvI7v9OkxWCYCvKJqd4BWY60BaRMym9Ck/ROACMI/JPScoo WSekErhgKeJiiUPjrxf3KdbGf6pBiF0a1bGCPfBXHONpv8wSDHUMAThTTzKivKWkB3ub bbsqHW9iPJwiorjZWv1Xw6UL52JrjCEQWpvC3xexXC3j6MNOu7OViZQDgdh4MDbEtTMU WmCQ== 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=O8dLrSBEtmDHKK9U9hqFXbeLY+q2Yh4zOV7iIpsTT6nJ2LU2bQcivo0jMYlRrfXS2g rKUfHc4I6D9FYtinSZrS0lLge9/fXYVTp8iAaNYYhtegcnFFqDI9ooGLHY7+wlfLBWF2 9xP0YBWvjC8UpvZjgSabE9AHEVJi/DQUBWDbzobAHNkDRZiH1NatOhFvtEI3sDe8J4Mz kQFr+ikDCm9iuwEi50KSKfdenKkXnwCEHufj3SHsv/Yev7f7Ema1PO5NaS7XMqmMTwso +5PQYnxEggskQBHous4qvyfEw6WBVhhGWHbQpT3WvR8bdSSkk+/5NG5YGCJAQyJfZASi cEDg== X-Forwarded-Encrypted: i=1; AJvYcCURBFkNJNLN6mUp68PpCPP1dVfFqrb28fiF3431h2x2qu/uu8u8WOT7tLTrRBfIWE/8zs0UidpcVVGIBjShe8CbZ6Bdpr04X7d22A== X-Gm-Message-State: AOJu0YyUUyHU0zwsXh2U5PXBHm+HyCWbGQySE2vFyxQ+P75EHCbdN8Cu J9kNQW7rNO7crzFv8HIHJm1aA+kj47QHn3VdiMf7z+pE48oIEjN1xblcIPHwZT2LFDv5cULVqnn IpKpBbvvO8Q== 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240605175953.2613260-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605175953.2613260-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 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: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: 802444 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C7141957E8 for ; Wed, 5 Jun 2024 18:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610426; cv=none; b=gYWs4H5w+Eb+bjvVBCa1RgBuoxMUS2g1lCQhhRIyMgHaFaGcHl5lWX7MNwH7m+l/Nnp8ViHfbp0L33lTgbO4GyGEvRT1pXQRCZ4TYO3ta8HsyaLlL9U/i7yAY6w+0JNYUZdZKG6GuCpOBfQ+vtyDwChcd7DRd/JLewaYRVghGh0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610426; c=relaxed/simple; bh=M/eENeT34qITqyMJGoLfrkcDLPx6c2gqtgSpfyqShjk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Xn42PMofL7RbkXVwrjsX3VSxxT3YZva4ZSGc+kqY6gywQc6U2FnbvncDpVeO1yB4R1h9ZMNrX9eS7t87wKmvAxDtFaig1jhiLaKfuzbQD7gw+kk59hLRtQekjy6VUpSHHfhsc2JliYHK2ZLKrv7AmzPjkMcMnNVuBMk4aUeBpBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FJuZggmh; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="FJuZggmh" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-df7a6530373so128565276.0 for ; Wed, 05 Jun 2024 11:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610423; x=1718215223; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=oWEvs7lXuHPW/wbGZW3HASpAVL3QgOZ/ef+Ervw8nvw=; b=FJuZggmhFGhWp10YbseBbhbNSwZbD3YkwUxXiS6vcF3km6ch/KL4ccGCubjjUswrvs stPWi6m+aTLRC39j/3ob86S2Z6NSr8O8AxWYWzc/hE+2uMm67w4Lmz1S94v/l/H2c1hJ O+dO/BeG+dPImMkDS26dKkcAxhVypHz9QHnNm3SysGqu+1oZzO8mtV+2ZAtcfMJ6UYcp ai+ktg2KHiTPkI3n1qzSaKTw4JfArzruUWmO+bX2v6Wv+JKurz/SBGIfcsiP8wS4dc4B B6pVh21yuxtzozIJA2Lvp6iwb6u37kIgRlnXtqQ/gmB7Q0nOc3TCGGSkWeK8EtBzAwJO uA/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717610423; x=1718215223; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oWEvs7lXuHPW/wbGZW3HASpAVL3QgOZ/ef+Ervw8nvw=; b=RIKCbAKtW40+6yz0yNbCoOlKyg/cCLGSmN2l6sRko+zA9Q5FgjeCesrmMZjgOJ+If3 4uX07bl064DkbaxtDGhTB5Vr/GV2aJAFmqN4jb8mwwUclfBysRYIGVL4GapIq1JdevZW tCLA4Cky6M4Fs4/G2FtWY5n3BAR301jrNZ2zIbMMuc8DsEi7nTQUVahpLNKnSCm/XR3r GOQ4q0Vczmuy7volIE/quPPenCtkbasg7UEaYR6u82LT0YlBtE4blXwqO2A48ly7zwXm v2jhgp5+WPtxj8himDcpLD+PhHR9k4UHJANOUAlfAzKDOc6dJgAYT2PsG/PdFzckeW4p /nVQ== X-Forwarded-Encrypted: i=1; AJvYcCXcXBzoWOPM6yUJ2LunoqxLxz7jskcUgfq07AEMP4yoA4L8Vgd9rwWgsdv8ZyGN9zxjCxsJC1ofWIeljCJrMHliMWeSqYHdwIbSYA== X-Gm-Message-State: AOJu0YyQ/Tymb6exgaZKwlyMCqOpxMPbhzzs3z5+YaV/vNv1qDMVS7NE rWNqVjlo5ERDJfKSMx8+7XiaB6RegMyixd7kUEtHmL44LFEeWcu5xJ+Ra+nAyQh77LWo2HzSwAZ Awa5c2gwLoQ== 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240605175953.2613260-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605175953.2613260-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 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: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: 802443 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73F4714EC78 for ; Wed, 5 Jun 2024 18:00:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610433; cv=none; b=pEVsg80n4ziA0A2g3kNmQfuKF6lXZjnmVSIibWkTN8UQKDSAUR7WFXXZF4e1y0Ychr5iYru8eZw2ydlEH5Zzbi31KyEiCwOVQPYDMgeoJnFcM3kxkD0zPFFzXANVLDLg1ngms1ezYwVa3kAUZR11lbaeC5aLQU0qsvFd+b65m0w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610433; c=relaxed/simple; bh=7YntdTNu7aMZ5zLGGRpR3JsfAB0rBOtanC3KQe4XBYY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=gdJehf0c2kLwYEosKVvKC3M4s1Tv8/e0el3g5YIN8eAayg59qfvK2d4D8y9JvWNltMj3x6mnffS1CieHM5sS8qiQstj+pVAU6PbY5cm5xZ9LU7rVDkW3pM7tfX9zDapMPYtIMV1adAmmSRx/D1g4jit9nD3AVLF0UgZGziVsO08= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=xh8vf0dA; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="xh8vf0dA" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-62a3dec382eso603307b3.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=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=GabZAVwK9FSl0VODpa0rRnhc7Hb5WIAFsUpyNY/Jkgw=; b=xh8vf0dA+TFlUnkkazIa6Em6KzJbbntuGamI4Gn8Wj1jFYYx5ZYFkn2tA0alpWg68u 9jhNXfx2DxL9m7tqmgthqmC1rUSflk24zLEIHrstf3mW39EvFDR2FeelUhLsupY30DEi /gVZrfJA0Slzv9rEogcUVgXiY8hLFc0E46E+FUZ/X8hWU6PYTTTOsgDQPMK44rgcyi4X g7UTGxktSZ/IcwoGFDfvWXQYzCbWyLYks/FVJWCMOKozF5JwJ5koJWgZ7381pzPo2fKz JwnKZftDOTv9WkuxVVV5rBvZHglYy9BQThw/il2JbfCMaxHpHsqQPdwDUsOxRCnGKcAo B5jQ== 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=mpiZ+k+Xak3pmHc8sNEtBW48etDTzXx9rXksBj80F7z7Wk9FzjxuoxxHa4t8GDW4ME Nhr14SNJ+mesMjR/8ttU5TzoL64udiywADHqyir+7qxgNSmykiED9BS7kNBokpBVKgql yWRE1aOaRsM6UZC0JKUWNlGHAhb5QCfH8Avn5Gl9jLR0KOrvj4omw2VdnMR1PuHWVOC5 hgPTfF7JKPc3W0byQhD57oQzrC2Ho8NZy5qY/QF7W0ftjiisaqUYO3FBMapQHT7r7VHr YtnPCpsNyEdh5/UI/eZZpVJNy2CI+yDNEX1i1J3nOEcWfjfqS7IqN+hgprIkfmsHTuFV Mgyw== X-Forwarded-Encrypted: i=1; AJvYcCX3z7Loh3IwM6pY+KEcMXjjjD/IUj0LsR2f860m6+oTvGsAIx9j+ktcQfd/3A+DlVG2b8Qg2ahHPr+XBPgS5+PKSiViNXNv198Vvw== X-Gm-Message-State: AOJu0YxoCUvyfHGjjZH67dX6tiV8zmBDoTw+ePYHfXX4IqSxFYAsfeF/ i5s8ftbXUzr6o/tlDJcglLolzbe54CRijWIzBrMKQCkWfGxoNtXoAbV4FEwAlA96XMKViefyshO /ICoKnbLBnQ== 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240605175953.2613260-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605175953.2613260-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 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: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: 802442 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAFB913AD31 for ; Wed, 5 Jun 2024 18:00:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610441; cv=none; b=emtlKl4y9ruMwrDABlL5u7QQJXrSnBhUU3x2wjhSLXn5KDuMHKiaTZeCE+gS/YNUH04jKBbDYBdnkrXFJzOmv1wbGIUSk4c2EhvKA9qWvDyc3zwKSf7/hokhxrpenqmGYCB6H5yyX0yhxvpnE02Ab6YfauvGVYZbrLZniZENTFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610441; c=relaxed/simple; bh=W5M28gmX2P2bsv2kzALbrb00qFmArQmOjGRUC+k0KS4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=JWaL5QkNFqqr396Yxj4oznsIy4y8Rwytqup0BoERT2lGhd94WgJAGMDf4nrCk/hFH8rwPUlRV1M7i0+8wm+xyX/BtaBaEYndDirvELPU7vQjtBj+kGINxfD2oDotpvPMfCG+zn3kUOmezlW/VDn7iCfuYBZIgQtM30QE3N0nVpo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=BoWahOKK; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="BoWahOKK" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-62a23864df0so560987b3.0 for ; Wed, 05 Jun 2024 11:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717610439; x=1718215239; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=+5/Bg969zZ0eVFu5myprHh5fQqxMXbek8nDgGOBzWoA=; b=BoWahOKKkJ1D7kfGtrnP0cUxpIrNaZ2suLddLewzR2oz4u7CWziBpzwFHQ+ftzncIs eFtpB/1H9zyQlzicoMJtoEWPK3DPjQzpefAzkEwD6qaiDFV3B0gWZlDhSKPFv0kyzLES mK3VwWf9UebiINpOs4Y5YKaafb1YFVHMwQk3QrRe8v5CIiNxI1jeF5dttXUDVWoM7CnG Marjrxai/k2CObkQx8B/L/3vNKpz1bxj4bvREXGRI3sEGkj1WJCLGHIzNySao6ORHqDb qzF5yPhaXQSrvk1jdn3p9DrUhYQfLvZ2MNZglt0siqP5RZkjDQWbJGwgpmIA/iYYcKMP XYxA== 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=uZdgn9KR3o14Sq6AUvestJEMy2OK4Fj3yhGsngYJbXIlIXi+cSQM5bgWWejjgDdvCR mf8QkkI4TJl4dZPQM0QdEswWey3CKi7K+Al/7L53F3VzbIrJs0tviMPuIKhPDmsyPZJc kvijyprCEMi0sJD+R7FZqK0pS8EqmYUIOuyWkISiP+RJ7A6kMnjtF70n+nRPUJ+ND/d/ AIVy5bwVQy52lmy0hzIbuWGVnBgwGY7tQrxsRM/Txvy43WmxCkzBEHAYtEsGZxv022k4 YgVd8wRFGOZ/WtG0yWvDOS5zthEVg40JKVC5gRPDhDjnPQxyqh9M323L8WhvxPFSvd0B TS3g== X-Forwarded-Encrypted: i=1; AJvYcCXfH/hSHMnxCOAqh3RANUUJm5JQVz7CnJ3vxgNSiolOJFxBseyJf80ojT9yKbU48u+BS+Yyb325dtO/QZGWq796oEQ0rBvUMZ4Sow== X-Gm-Message-State: AOJu0YyUy62BRXysyTJWkMf3Dj2EUxwRc417PUtFdKogYV27NLlUYI4k o+Av3ZAX3tlxu97GoyMYidq17xlk3G2kv2UjqEt1ql9yGOz1GIn7oEvSfZJo4CO7H8b13CJduJ7 2IRadVrd+4Q== 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> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240605175953.2613260-1-joychakr@google.com> X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605175953.2613260-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 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;