Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp471240lqr; Wed, 5 Jun 2024 11:07:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUAycJqd4d47lBv6G0uFgteIZEW8cPKfDxRtq9gYZlBT0pSiSnDjL0KELYOAUx7SR99i0iXhwb3ol6ZNwBMWz/Rwn2UgAxyXfTyBAeZzQ== X-Google-Smtp-Source: AGHT+IFc/5zIERKn3GOvPPQb85Eip1AvHRUHZE6vM8pjhXsCpo5OkeSfzzAur86tRmcIDQC47zKc X-Received: by 2002:a05:6870:d201:b0:23e:6d9a:8f45 with SMTP id 586e51a60fabf-2512209fa89mr3662729fac.48.1717610833947; Wed, 05 Jun 2024 11:07:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717610833; cv=pass; d=google.com; s=arc-20160816; b=LY8D+Ee7sDJeAprQfIjT/Fmb+idjeN2mcnac55/ht+yj3GgOjwxvRECp4+c4oreBkQ U/cup6OLZ4MQnDOubsGTGAgXrrLiwGjQacznTqgSO/k8W24rtPjkq1YecIkiI8qvEhQa z/lZ3E8ETPqZQaXZSexnFrQVOq4y5RZBNsQPwoipMwpFth4Jm2gzc6SMmYebYLZuiZX1 LtQjMt16kmOTOvRbARvf4O5b9FAeqnvJC3A0QOlt1LjrJ5skHWo8P/NdIWQwMtjiMiu2 YJukxfPjEbNAXsBsc0fPZvYLZB0Fq+LZ+oGQ2Tqr4fRaJmQ4V/eZvXQbkn2cSMzAOA4s X75Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=xwrLVVIieFUQPopwc+1tOr/or/db/Iy6oXeR6vbSkEA=; fh=0UMmjBlXLpJMxYtP/HvnL+O1vsb48PAHQE0X6zZ2bDQ=; b=lqtQwzJvmSWXBF8BAJnA0t/MF6cirO5EhmEY2QRP2KuHL84wUlB5WFYNKoy1KBsHhr R+aNNuwWarSM8CR4fR3rjJDHnXSHqXVMpkOtpj21aMuHh+LulPR12q6yQdxtxRD/Qu2W wVfDGKokYdPiO5ByNO5oADb1LncWQ/z3+6cW8aL1/2BeOv7G6nrB2QjCtZSaTvO/ju9I c5pSUniyJV8vGITcknWM6eHIrsk2BNQdfnM5S+fpufA49jnxndrS/xnukW5ufuUBnso3 cnadedTKDWhNhNNIf9YvCn8UnH+eyACyfm1f/Pw752CXFtjsNtEYdbem2Yxh+tAax4Lt kG9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Idku6B1W; arc=pass (i=1 spf=pass spfdomain=flex--joychakr.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203022-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a1e0cc1a2514c-80aded67aafsi2037292241.57.2024.06.05.11.07.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 11:07:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Idku6B1W; arc=pass (i=1 spf=pass spfdomain=flex--joychakr.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203022-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203022-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9FA511C21F8E for ; Wed, 5 Jun 2024 18:07:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25B8113C671; Wed, 5 Jun 2024 18:03:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Idku6B1W" 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 8E2C715099F for ; Wed, 5 Jun 2024 18:03:02 +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=1717610584; cv=none; b=CmRlTb2muQAoM1WB7RtDiqeeSss+6fOJJkGNoGW0B6UqzXw/Vi6sERpFw2G2G8KbSi7Asz555W2iVl7d1gXNP7wSdVQYXn27HraMdeVfFyHXamf2pdKkyD7/EEs8KyN5MNwWamlG1fqJFeLIABQEjLiZxCavINuFcHZ9Tf7kXEM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717610584; c=relaxed/simple; bh=5F0WRZAIFyT/53498dR8Vin7Zzzm6LhYVaUBgnMWhtU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=BN93nv/rRIyhyceoz/nuFV5at2MXOSr/SktdA6+9lbJqGUmsykxNINbRZnJu5cNdwABTVKgfAxCo8QR9mNRZWVX2ukkzSAVWRswW/EoLmtK29bSWcuPadWU0adhPxK72aZRZv3xPWECxM1SuVturzYkjvIzrMPspWwOwcxidygY= 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=Idku6B1W; 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 Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-df7721f2e70so1666660276.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=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=xwrLVVIieFUQPopwc+1tOr/or/db/Iy6oXeR6vbSkEA=; b=Idku6B1WbjWlNIoVZa3HVC6dG1gQ0a7HXAXah4JvpCOQTPgCUCAELnQUNb9/wosw+t yhTRct0vZJQ8OSqH5KPEIubSLF5rVAj1uqISQrHjuRVlM6HT/ZYbuFASEfFsS2JqabVf ydM9kdda7TDVtg7RPmBgAe58t94ZiU4P7gdrZ/zvLuxwAh3KNoNY9XqgkYxgn9siwYU2 r03213d0SDy/RCqasY/K9TwS/wg4MMfe8NIvc7lWlB6pgbv/jYWasckvgYwd34B3CNQZ XCOK5SIFmd+94r3xNhyeW9vWwGp6HMd4Id7m+C4bZ+xuvE3VkAS8EC7zJQXikJRsPbTc NE2g== 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=uNuMEbO5GeNnVIm8qABpmbUDDyNcjk4BiO5v8CSVl2eiK+CXOfGHHX0gCP+JjWDoiK A7Sib1Hjyj22Eh5nnqEDQ/ixtc4ijt1hN9tRi3SqDrzQIaCtmVg7GLdGgI+FJ7D8D689 ndutzfXXe6FxfTGkZglyt6v7egwqEbyqBRoXnmhp2v3PB1WN1nZ4dqbqgVygLpra6Oa5 Ye15IB4uKvpiMPdLrQd2sVmBGO3qD8aC8CWtKFGnDnS+XT9oOMGcAQxg+eXGji94rvYu Ds9JANQyup3ZG+1mgy3kg5YAE6LbO1FiCGcwlbU4FGHwqxmSdrCsmuX/WijV8lVlTtfk JZrg== X-Forwarded-Encrypted: i=1; AJvYcCXMADZ0cnReUf1hawRKdRMHsoWgCmC62VyOKl8stkHyl6QN0PKY/v0+TrDMWlNQ+5s+gD4nAMqiGLot/ap8Txlbm+sXv6C29r8LI5Zx X-Gm-Message-State: AOJu0YxQmmwiMeX7rEZr4kVUVX6xhziODk4jW52DPe5v9rzTFewJI8BC rsCUCPVCupSRKiW628fzoH9UxB0xDo/bzELH9hmYNlXwouRQhkOejpxIH6wUjnyDnTqEOosQGfW 2KyulduzoHg== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Content-Type: text/plain; charset="UTF-8" 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) -- 2.45.1.467.gbab1589fc0-goog