Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp260489lqp; Wed, 12 Jun 2024 00:05:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqp8USGbzN5k3tafVY/Exo/AjlaNyKZHEnWJqHhW6qMjQ/GEzm1T5Dxzy505CpPI5T6eyvoQvFeyZtrtjgxXZxoAQXeBuA2q7L4530ig== X-Google-Smtp-Source: AGHT+IGhGqQknO/YwnJelRjuHEFZdtzmAA2CESLXpy+vNGMEwotgzBzKva7BxS4jAPwk+iPGx37s X-Received: by 2002:a05:6a20:918a:b0:1b7:77ef:b125 with SMTP id adf61e73a8af0-1b8a9ba6e04mr1319764637.21.1718175957700; Wed, 12 Jun 2024 00:05:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718175957; cv=pass; d=google.com; s=arc-20160816; b=TG29Ypd6nIjCGNhr/wjqVdIXZ4pCWger8qvlcfg1wHI0Czth+0+0uhFxy83S+8gh+r JQ1IWDDThp6kqzci4bT+BZdvU6iFZnJ3JF0MKE3Bdp8r7T7cx1RLcWPX01h0+YS+BwXb 18VDHliVQ+M9s+jMg5L5SkNNQg0KvstH0J5xyVJNheIm5Y5VSrzus05Yj4KGdALujdb+ MtaO8XUPdaRNIoMcUYmZKG6edr1GOrW2Hzsl+stoEjkiQJRaqwYkLbH1fMIh63mICM4B 6AoU9p92zM4pBC92IjbSKArB88xi0HdJXwGmoZgo5hv5R5O79GxAmWZJf/3l5mkfvmm4 M7Bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=I/wC/xKlaJhlLxFPJxNnjPTcgc2tAkZZ0x5vCfuNPTA=; fh=VQK10yAguO4TlqYU3kydRrKuXxKSK6wEuAdcsWwcrhA=; b=dwsyYryVrhp6KQBY1L6y3YomHh4ZJkiXnv8QpkvRSdxHnuZLTODMxvUiqggdl/9XmL PbZTLjiT2ifvkWdP2r87gy1yQ9vfEms8hiXjAZupy4sKRLGtRhw3VV5mvqS2mNZdVYBm M/DF6/n2j8EraDgIbp6dAIkzwRpq1fATYI4FQK2j3aG8ZSnFuSXrrwAyCAA7WPS3Y9pu MLD5d+eXEnHxPdHp+fODR3I5HzORjn/a4hUXz60qKfySvYvIMOaPFdwYIwiyJGP/ODkg /Lcf/ZLmkK9Yb2w1nxFIt/E8lW7rZe9O+KItTh0nuiUbDmMvBfz6ehT/eSHclxyqbyIa pjYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tRnbJ4w+; 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-211023-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211023-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd56c545si7807583b3a.345.2024.06.12.00.05.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 00:05:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211023-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=tRnbJ4w+; 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-211023-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211023-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id C1974B24F04 for ; Wed, 12 Jun 2024 07:01:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 378EA16C445; Wed, 12 Jun 2024 07:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tRnbJ4w+" 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 EE79D16C43E for ; Wed, 12 Jun 2024 07:00:40 +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=1718175642; cv=none; b=r/RjyJI4ZSkC4hC87Z0O865a5UAg1e7LUsP9LkOas5tGZoVMuzXeFyu0yskr8/bS7uETPYOMT9R9BjYwL0SJJr9AmEZik2KMCbA2Y4p1CSyMZb6VSdf4mcYtWHMfeXSaQXFJEIEVG+DaQrFldlzlAln6xiFlxK9z07IZrPozIUM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718175642; c=relaxed/simple; bh=OscwHNEBraxjXT0TgXjSjjl1pljTEut6w8PorcGMCFM=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=gh2w9cXzZWlGRTf/ofvpgxPcjFiRfH6K+wX66BLNi1seqtkm73IaPC20Vn699W3iOaGpqf+nOBCa5UinQfPj7joVzi/8/U3ae3HVvlOwab6vdyUnnkzxiR7w11QcjF9Hc4xk9ps482tihMz6WAwRgBsN1yDxv0hvX2Wh3W9aDKA= 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=tRnbJ4w+; 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 Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-62a248f46aaso107945697b3.0 for ; Wed, 12 Jun 2024 00:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718175640; x=1718780440; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=I/wC/xKlaJhlLxFPJxNnjPTcgc2tAkZZ0x5vCfuNPTA=; b=tRnbJ4w+nIjDLfHo3fKvXKDSNDq+aAHqzDhsWDy9uIUPBr9L39b+ruyysh55tdvftF iYqN3OTQDSy0MxHAB//5W7QwSKzZ1NltyYYyZXQL26ZCMCb/b9TJ0C4oG63bxCeGw2XK kj3b6eySIedgWMu88aODpQQy4ioEr4cHrDL3neLRIEo7KgmdUDFL25NtPagGdmXlCdpC dU9S2wdqPXz8NZmxyjiXzHKxKPec5dj5tsaG1SmEEGjxFjivUp9KX/RRGmCHOO5376T7 yp0xXRNwVrf64B4ugXVIHk0IFugxRmUhkkFtPhHI5itzRLBeMMN5cVUp3tr3VsQ3ZeBM yo8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718175640; x=1718780440; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=I/wC/xKlaJhlLxFPJxNnjPTcgc2tAkZZ0x5vCfuNPTA=; b=mNL296vFvqHYYf0zJkd/51AWNoWLbQQtBBau3uXhTQslZoEoieN+M8XnRDX9bF25as jK2sEVqoJXXjFpKMdJXyXL1dHb16CTJl49m7U3vkJ8OdKDZxBCbYPoBxoLXHmJ3XQJfs mblFlJYARQFPriCxSn0bgMXe1DJvidMTmRtHLkg/gZ7ba5xL06W4xVqTDo6f4n2rnf07 PYIVEE/j+PL+Kqs5TZD9JT+J2xuoyEF3YoypUb8L26kLcS7qqhlIc6V+HpCvqLYqwfJu ceHPsV0NhnrEo/9PW+kDwhjrwAuSQ6NSoxJnfTKM/95mAdLo6jdtMTsZgHo7SzlmLZ4l nusg== X-Forwarded-Encrypted: i=1; AJvYcCX1ltR9n9xjFroCcLxRqLmZylD3rfAWT9XPU+sc4V1k5JWck9Hi7vzXmt2i66uobDfZ/Dz4tGDCuGoSyc0tu48khVAl6G4lDa127DuH X-Gm-Message-State: AOJu0YwpdPfHdbbByOQrRfMxNnc8JpnHUYRzND3U7uHuKpzlQlpbOF4s vACY6MHUf4xSYCZLR+4ijqlr1FtWEH6xq9ozmx5FuEGNiaFbWuYJkL73n5cqCHGwNs2KBHCQ1Ij XIXuidLptvQ== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:60c1:b0:61a:d161:ff8a with SMTP id 00721157ae682-62fb95f886amr3164577b3.1.1718175640030; Wed, 12 Jun 2024 00:00:40 -0700 (PDT) Date: Wed, 12 Jun 2024 07:00:30 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.45.2.505.gda0bf45e8d-goog Message-ID: <20240612070031.1215558-1-joychakr@google.com> Subject: [PATCH] misc: microchip: pci1xxxx: Fix return value of nvmem callbacks From: Joy Chakraborty To: "Vaibhaav Ram T . L" , Greg Kroah-Hartman , Kumaravel Thiagarajan , Tharun Kumar P , Srinivas Kandagatla , Dan Carpenter Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Joy Chakraborty , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Read/write callbacks registered with nvmem core expect 0 to be returned on success and a negative value to be returned on failure. Currently pci1xxxx_otp_read()/pci1xxxx_otp_write() and pci1xxxx_eeprom_read()/pci1xxxx_eeprom_write() return the number of bytes read/written on success. Fix to return 0 on success. Fixes: 9ab5465349c0 ("misc: microchip: pci1xxxx: Add support to read and write into PCI1XXXX EEPROM via NVMEM sysfs") Fixes: 0969001569e4 ("misc: microchip: pci1xxxx: Add support to read and write into PCI1XXXX OTP via NVMEM sysfs") Cc: stable@vger.kernel.org Signed-off-by: Joy Chakraborty --- drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c index 16695cb5e69c..7c3d8bedf90b 100644 --- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c +++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_otpe2p.c @@ -153,7 +153,6 @@ static int pci1xxxx_eeprom_read(void *priv_t, unsigned int off, buf[byte] = readl(rb + MMAP_EEPROM_OFFSET(EEPROM_DATA_REG)); } - ret = byte; error: release_sys_lock(priv); return ret; @@ -197,7 +196,6 @@ static int pci1xxxx_eeprom_write(void *priv_t, unsigned int off, goto error; } } - ret = byte; error: release_sys_lock(priv); return ret; @@ -258,7 +256,6 @@ static int pci1xxxx_otp_read(void *priv_t, unsigned int off, buf[byte] = readl(rb + MMAP_OTP_OFFSET(OTP_RD_DATA_OFFSET)); } - ret = byte; error: release_sys_lock(priv); return ret; @@ -315,7 +312,6 @@ static int pci1xxxx_otp_write(void *priv_t, unsigned int off, goto error; } } - ret = byte; error: release_sys_lock(priv); return ret; -- 2.45.2.505.gda0bf45e8d-goog