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: 802169 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 B02C313CFAC 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=1717610407; cv=none; b=ZVYbm20rFwTFY29zQpJtaV757SScvKtevB466aP+av4bUjDgSZ9V8J94I/PagUU8eEizih2xoJhCUADnd/X2qYUFA2gTPCr+U+35an/zaP27WuDqkarnc2jSYPkHQMtNwJrlIy5quoacVywcPOjNo1BEoZwUeF0Bwz7uJhiA8sc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610407; c=relaxed/simple; bh=ipr39Oe7qflzshs+uqKeD5dsLOI2DywzVbGtmwc3XF4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=JUQPpxuQry8lRgbAkyZixMS8fgvYyLblUROg8WF7W1ezKR05sw12CQEKslUgthtKTQ2GW/qRIl/kF6ndpBPPAVdyH9txNcsZ0T5Tr4xTb2DDDEo8VfJx+cSxW/PdC7FuN7UQhMb6zApQnTEkZclcq8ovIY6+7lMfQBA3WHpvPFQ= 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-df7721f2e70so1661155276.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=EjJSGHa9RBLo/hDVSE9GMqxQRI0WhEriuwYJphVQZEcCxmUlGlQTEWIexkTwgt1ORZ CGJL6NlUZfi3N425LoGMMrQulEVkJA+lKUCfIJTQaWceT3GhK8wg9YopuakCU2TYmqCn Z+FBqUp98i83icaUU5vxw66dVHxEzUSsrSXLkeVDQmHWqtGtmzHmKoFrlGGnbH/ZJqRi elrPB80uSZaBy75WDN1GQ/P6fsbqTrI0BumskjXi/WD8z7KCZH4L9jUMTUb17Vo2S2Dx g+sPFwa81dPpwKmvAjtJp8L7MVswGIcbDHiHO+gtcX25KCsMBBijVz/pgtyt6OwwLoef Lnew== X-Forwarded-Encrypted: i=1; AJvYcCUu5F4Y9zjfLMfxATXco2Dx5RVU1LVBBK/bWpS2t9wq8hrcWhod8oonlhtAVYvPJ7ic7nxRUM5xhajerzB2j2sFjUTnLeDTMKT0 X-Gm-Message-State: AOJu0YzgCdKXHHN7I5cL3T38ihLWSU+a85QwYAxH4FJwG9VveBqN0pxd q/L89gUuBTDqTRJfuKtaFJQJpdlewxT736dXIv0DpvwJePnCTytHf6NtF40ZJ+9WcBrK5o3UYlW 8osI4MhPb0A== 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-i2c@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: 802168 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.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 C57E1154C05 for ; Wed, 5 Jun 2024 18:00:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610416; cv=none; b=Qg2ru+kX+3drx2Euc3Ayycd3aASDyCngwRMxB1oBNb01QDh+Q9rPvMOGSkDVsSRKC899Mjg0C7zlRWBOp1E+zbzk3+45TvJ+Dv6l5Yumnbklze2jcFwAcVojL1akFbD4Afmh5w86vIAKasKX4Y7l9Ilaieb+XlNH+0wExuclFBI= 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.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="yNqgUmHy" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-629f8a71413so394377b3.1 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=FVP6YXRr9+rjaeb/BSw3G5lh+UKpuTs3MqWNEbhnQzKee8A9dm/bY8Y37RC4bnZdLw e+hlanCBvI+V87L1YRq3aapLu7gVFwm98dj4iya1UOciOO+ECv8ZQmzJSUG3Kljay2lv NEmmVKLPctkjmX7LXi0EqWg+IBnRmg6tvbbwzh/DmLPgVY5jlGYzX3hAPmftaWrmkJFW LmGkLm4wUAK05k/7Vmmqh09J9oPDzjIogyb0TeHLHqI1b34F1XhGw+QuLvG8QU0YkYtP McDC0gDMUBN4qeeEm11gS2tLeh3nmJ3Oh5UNDwkpeei6vccordQPvMg/pALn1qUghyfy U4Tg== X-Forwarded-Encrypted: i=1; AJvYcCW7nKmGau4mB9fGeO/5uzITSkUpCXdiqn95ktO4tUFluU8pdwOmkMn9tdlIXZzc+wr546bNdi4iTA84XNw6e0FKt4ZdGgfsMss6 X-Gm-Message-State: AOJu0Yy+Bajzoj+8/PdgZ5jkVj/+si+oH0Zhv6iue+61DwPrs7A3/99x XVjarT/bHb1CeBAmO7/sGy952Hy/lJMaaOWkrPI5vK+lFv1/PQizkuZN+mA471HH9F1eqCwZz6x o0BjbHX8QRQ== 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-i2c@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: 802167 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 900151957EA for ; Wed, 5 Jun 2024 18:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610425; cv=none; b=kBRe8NaIxaC7WDqjI1hrInHN3R3Cbz3r2IhZa+j0f9qGdFvfFdhJdWpzs7whRYQhBn9CYohZ19KKxWNsdDrusojsNmu9ZJzeWnYPmPd73N7qa1ek7KD1d5mZEJnemd1aY493qy10ZuB+d23r9AQErR9t6ANu/wiQsiwwEXWMWHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610425; c=relaxed/simple; bh=M/eENeT34qITqyMJGoLfrkcDLPx6c2gqtgSpfyqShjk=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=aDDKGm5My0fYuyu5hAJ6EEIgqc4ueyZpe2JhZCLYHImWJMI3dCln5CdIOgVWdoESJ5ppO3B+9ULTEmfZjEBW8r/nkK95rNYYXCgfPeXgPo6+5S+A5aoyaBSMdGLONTbIjQ8pHBiBtT8lTTh2c3sqIrcSDGf1IPppqHLHVCM4tsQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=FJuZggmh; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--joychakr.bounces.google.com 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-f201.google.com with SMTP id 3f1490d57ef6-df7a6530373so128559276.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=SZR2dDUz1hMZLuuqvdjv349eZ7srNQWPr9JpXE2wSfxWANRG/fpVSs1ZJnkU9DYPzV +1sdrqnxW7FNpq6KWCrl8+eOGPmbyxJHUsXzcgPh3z5xr/XbrHHE7TouGx8JlZQkbowb G9z4EkHujsIhRdbocv6OH8YA0/xlAPMlI9IdrzDwGLwHibaKW4YEfW+lTyRS8SMI5ehS yHfo1hKCIyM8neQSEhIagbq4hlcmmJDi8app3XKAeNIcos3wlrhdeKgPOPP4XFOQffzS HSY7T83RvgXqSRG+IOAFzJmBlLyjMVqll4SRBpO0FZ5TRgmxu/bje7+PIRSeXaN71KWm c27Q== X-Forwarded-Encrypted: i=1; AJvYcCU4dV+gIImBX2we48VZXoHu2uGZ37HsCFtk06n1aZtWPNR2Hyz7h0+CoDc+In6rTDRSiFhNQJ/4LZ4zdn25qrpyecPUHL9qcKME X-Gm-Message-State: AOJu0YyveTBXK76rukNufqi6OZYEyeDWz9DOlwx0ZqCbrN7IZUYfDfzb yUFGc3KzDcKQdl9dvMq4VO0kDJRzegSzeS4pk4k9eSwngSTFJQJ9DzHGRGxmS3kyHvXQoLbSki9 bcQVW2Wal9A== 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-i2c@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: 802166 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.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 62F87195B38 for ; Wed, 5 Jun 2024 18:00:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610433; cv=none; b=O9jnrrlGnKQvE4C9m39M/WC7qL4Smd/PP1MswA/m/T012lRtyiG+JF3a4Q3WT226usSTQmgpUNVke8nfVtfYIrt0QysnVYfoJuG+o3X4SxsDSMIMT6hikBdPja+ZEnKolYOqGoA3HhWQ1UrbSkEEn6OHlM9Muw4N+yjNxVmMgVQ= 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.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="xh8vf0dA" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-62a1e9807c0so743457b3.0 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=JpAPY/XfoKkvorHgfihsl0PobjhIwvVG2JCdHMeMQKh7ntDNKys1QihD++XmeHKkrr f/UgsDvBBFlmC8k8YNDgR5txmRWw712DbFIwGR7RzQ43icdXg2c5UZteAteJB7bLSUYo X3gmr9FgKeE1e9Tb8ohJy8QepQ71t41v37Xvq/MqZ49k8B/aUNj2OWQMtvvqK4ECv+xV 8SKEFivD4nE6bjCzbDZb9OH1hAuiKoplAi26QcOr/4O6m7GeIkUpdlBa4Re/3vH0tXZV U5ocYl4KxwWjXD/6YLOczZ10TJjUMYiNbypaa/xrBNfRkO/P6zZeSSZ3o51lttuQ7R7C TTcw== X-Forwarded-Encrypted: i=1; AJvYcCU+W6u50j/8G8+Tln7HDEYxjMRHHN+Icxz+I/0pO0xLcklYQO1Leu/rsiBtXRy7z5Dyd4blLHxsKIwkSjhbl9HRmLsYrHytxn/I X-Gm-Message-State: AOJu0Yy8x3GTz6BTO7G3LomBRJDUU60u93RaE53hYYvrOryEs2kwBB6k p4g9GTA49klZdLZevwYJUY+5BpyVgO3lepBXhCfkSJ5rooStYR07NyildmA8TPg6eUDOhUYliTY uQUhKfgj2JA== 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-i2c@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: 802165 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.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 8B92613AD18 for ; Wed, 5 Jun 2024 18:00:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610442; cv=none; b=F4v0D4k3uEXKR1m4x62AixiKIDa2X+tnk/hPU6oO0pLZ1EC6UguKKlzPPu9kzwByRGqQ+Az5lCAqMpvY4SVwWe7XqPMqQ7NSIUsJyg26+5YcYb4BCrfaV9Y0PWj6EgIYRa2pTJ7kMGGWGJDDUgSnOucmWDvh40Kqrk49MeTNRcc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610442; c=relaxed/simple; bh=W5M28gmX2P2bsv2kzALbrb00qFmArQmOjGRUC+k0KS4=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=SW1+HTmKe/Ky0awDZp1qIW7NqdWBcDNb65Od2JYyuom0MD2I74d5OLIFrDRZoMQpIbNbqFIVin6psj+rmP+5Vk4fv6lQ53KVtl7N2iySDzlaDo2VZ/j9tBzNyOT0+t5Ru5qKRBsk6oIjY0KUR1M83KRvAP42nV16sC6CfibQMy8= 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.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="BoWahOKK" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-62a08273919so324387b3.1 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=QHwQOS+3XD8X6QdKXPluHJfusxNX4NerZ+lWHAsBsGAv5gao2qx4FI10Zg8pUEOF7v mpq1KJe5TYPDOmJvsaMQPJnC7Z233xXWanZzlQbtcGyPESNQUrPcaSBCi9OnDRYQvBX0 XtMTw10RT20afZdwTW6oMps8UYJDYdg2tiPULKhq2vqsQ7R+FeiTCnJBhZgaxf+TLOXT 7kjD2neCz66OtOgwgSCsEYFXlDUezRohD3IpwPcSnuh/X+zTk0lFyziP6UW1d3zYTsgM cYw+ZBYSsrqgfkyrojEaLV1wpaKCuAUQ+HqAN+j3CDW//+PA5g7jS2Cv9U3PzGIZUoLu i7wQ== X-Forwarded-Encrypted: i=1; AJvYcCXSaXqm/KhiVA0GzBWMa3N/QywOrPcMQcuBZdU/OHlp08kKsIQW0sYL1voBYKeYn3QvPFwf7BYSorr5qn5Olv+3cN/0ncriH09r X-Gm-Message-State: AOJu0YzCd9Nmi3PA/VqSihlWlCES3t9T4hQTWJXynEEAPU6vrT3QD4AF NBAqIPP+Tv9CNHdIEBHr5w/8Jogj+eITijjaf5eOl5jJdUpErDueFwNM6VZCax5bvtmrw/Pcrd3 m47vlBjHMjA== 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-i2c@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;