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: 13687288 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 0B4AD144D2E for ; Wed, 5 Jun 2024 18:02:44 +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=1717610567; cv=none; b=TNWkcjepHXrnMrDPoAY1mUFjb7ClqM4S7V9LKDxmPhiikeber52twSiafSrWwhjajC3/UFtUHOOBn0Zn6yh6ByEEdvCQHgNRb0OYDGeW+/c80lOY6XrmAteJXCNx37/V7x/ecegtVwUsPoQeCjlOsuykByRiO5AAPBhEP1+cJDg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610567; c=relaxed/simple; bh=eF30gjQEDuHJ/IYGm6d82rKPYlogi0y1Le1+CTBv8es=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=cU0BT3PLpQFZmVqkSuxMCBZLIUvoty1nizTaeXaWI7avo93RLyzgEzw6CEfY3Z27C/Je3TM5f4s75mVM6xIFkGft8qI6JIZkqcUbr/ii76Q026LQWaR1VPx5XTxlIqF7aqbn76Jx+hgT/T0bYYu6F57mqWHi2+xl4b0VJy8iAno= 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=bosRmD0V; 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="bosRmD0V" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-627ec18b115so496197b3.1 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=vger.kernel.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=bosRmD0VAZb+uNeHi7HIWEvwXg4aQpu6UokJkBAlLIP/mwUBkraTcuWQxK3I7oKf92 IUqNEgKeAor+QlQfrxVSX46Wr8qSmnre7Lod1wkkTeP1WiYmtzlXHsm6O3NcweNaf3ya Qandj21eqkSssUvIpP1j/ByVvuTqh/97jqaJeYq3PTsSsF6edkETmP9wm72ftlMYpBuP miYX+L6h9T7WRJYqPenCfll5CtFtSZIBP1XQjvu5Eg6N2CYzUGIsxekAXrrCObtum9/3 0mZb0apPgAHlNJwLvOjE2WR6cA9sNf2aU7/wo0Eq6mAi9yMTDLfZS5nu4m+yBkRZ20EB ZVAA== 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=c6fDl11Xeo2CMelhb3+avnIu/IYOuDlICrTLSQu7k455j/X0dlSgQOcpS3DHjOcVVj sP7ULPAKGP+eCqRpxropMAXiTv4cJnQRjeMq27nOv5Jv32pCYLvYu5QKR5Gch2YsN4cK cnd0r4iPYcuYR5rrsLv9Fq8knggo5injETqfsLorynQQiHac0qbKdqgHWa/yBHE02BSy MIuY6OBvABrV0BEWzI6xpJhbVBciA3xwbf1tCpdl9Gz0Xhny7g/8IG6Yv8mYpSvmihuJ OcwqydWPuX/O9oiFMk4/O9ozIilRkrV49hC2tS6yJF09vH4PLspYexPDw3hPxldU6HYn gJIg== X-Gm-Message-State: AOJu0YwNRMraAJLtpCrbfVNgw8ENLQ6lEgS6t7teWh8EcmQucKkQVAHz ipARYTzBEwbj9KZpk3T/FoAFiRHZZeKb6ycWCBYAoEZ3LRJ7j6SJoVctZdtDWog5fnhXeWzwP1j D5b/lBkQApg== 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 Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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)