Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1132624lqb; Thu, 30 May 2024 00:45:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWldCFUbpJCzD1HFXeUmaUYaw+VtQJnMKw97T2P5YIw+wVuT8Sg0+j5Gsy6HTovpwCTaKRC/cfPcp1WzrEO33Cyc0xfgfNia4lFQpQ71A== X-Google-Smtp-Source: AGHT+IGN6tY/q4FOOME0AkSesQd7h3HF+GFSbhFg8gAY7d01ZhzUXWOhHhhbrEIPlyk/BdYrHDg8 X-Received: by 2002:a05:622a:1a85:b0:43b:18b7:5584 with SMTP id d75a77b69052e-43fe92abf66mr20098141cf.8.1717055121926; Thu, 30 May 2024 00:45:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717055121; cv=pass; d=google.com; s=arc-20160816; b=d0HxqKHGPI85K3pzhI6++JI1WEPqS8oTx9ayceW3ijNuRZyeVCbBSpV/07briyH+we iMeKw/3iVX2sRCAqh22RYYbh/c2RQa5cOGJMmARLOpiqP/1x3GWnIhIgrTPVExQB4voe CViOsDkkCcE0eV25Zyz1YJeZV5JHoeg79kAqJe+sqZ+LH0Vmg3RLHnmbebXnxQiOTzS5 gmC+gfBvuILwL+NLxZkm7RJ55/gQPMoRbpQylT3zuoIcRtrz1YejtVlHi+IOooJDd8K+ jd0f6ANfH9XT+iAarsS481hBiB8qv7sfkaST4DF74vHQV4wHnEd5lsyMX1W9Cu3Qaz7X GZpw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=rpADpYcFX3Mr7rOGquMLPgdn5l9VIWss9Yv5ywnvHNc=; fh=DpQOZRg+BHhzlzYEWv50v0ds4mdb39xQuj27B/3aVwI=; b=fR4H93dX15Q91CsZ95J0yCrc1kNiI+LxPcsqdFy9EXLxElWno6+Hw3M6lbuTiiaLw1 kC8qcJl/zhhQpDrXEM9YuBNblMHwsODddPBxNfauXcKlnoZISp9jJiHPLIv8srem85yo 0xAQ8KTy9Sh1VjQVOUWmGgy3ncxnlpHuwh6EwIHung5fjKpGdftliy9Kxg0Dg6qWruBm 0sA9/TOKZU7zVfLmDqxLuQJrCFXra8FAQBEhim6QhBM6NtG1MJnvfrhLnpxNq7X2QhT3 3NJsJli3F6VbL+oYbkpSq5gv6V33V5/S46M2bF4hMWNCjEsX+2pz3d4fZajsoKkgP2Am 2NmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SHCk36Ms; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-195016-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43fb18b2d49si19831441cf.402.2024.05.30.00.45.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 00:45:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195016-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=@kernel.org header.s=k20201202 header.b=SHCk36Ms; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-195016-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195016-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 A524A1C20EDC for ; Thu, 30 May 2024 07:45:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52BE6142E78; Thu, 30 May 2024 07:45:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SHCk36Ms" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79A32176ABC; Thu, 30 May 2024 07:45:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717055114; cv=none; b=lh8HiIADwbgg3hqgfp88Ysq0guJQjyb9CoPV5vMU/oMtIKX6D+LMwqlPcyUSRe5NvLMzHJAzfbB7PGBP+pUALWTgTko6yHGNaFfTx3eHCnCBx30qsaU5EFGxCXH5gQupdhko7+/yTXvqFz//UJmYwMB+I/1DZ9YEGlEtyZ96U+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717055114; c=relaxed/simple; bh=FWoszlZ0BSMty3cvpzChmu4sK4x/JmRHfY9S9eDrwsk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tOg/oZQ7Cqcp0HzmFJ89UvQ+VvdDHiEHH7YjUrbmMLfiOefHh2eW/cR/oDnjhvPp8P04sw8ku0FgyheF3OhjrBXjY2e517sLxFrKhfbIpqE9Jt/axOrOwrHoNqZ7EBTV4l9WB2nMnF5bbyLbbnv+a+Cls49tEKHbxaJrWYZ284A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SHCk36Ms; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07482C2BBFC; Thu, 30 May 2024 07:45:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717055114; bh=FWoszlZ0BSMty3cvpzChmu4sK4x/JmRHfY9S9eDrwsk=; h=From:To:Cc:Subject:Date:From; b=SHCk36MstXr/KoRfeDIXw6HIjCIr9TJFktlnNcPRF/WypqsCA+C4e5hH3tilqk0m2 a5aZINGWT0KbSUPGywHfVd3YkPbNqAQt8+ed5uc5B6VJ6K3v/gZJ25Nthbx43zGQp+ BJFb9f0818gVRwkitc4TemvJCDYKi7yAu4af4fLi7RYhgCNbNNocD+4iJSbtupFN3V 0f6sFFyOCFQJPrSRQDg/zY5MDUhPtJpAzDHPfTqWs8RP7WHGAr3pacI5jR0iJUQ8L2 Mfu4DJtpObrn9jT3i5vwvOln4z89SC3B60CCkHCaWeAATIBr8ZEQTJIyx5GeoE7/lz s19Jsa5A00vjw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sCaTJ-000000003Zn-0WRd; Thu, 30 May 2024 09:45:13 +0200 From: Johan Hovold To: Jonathan Cameron Cc: Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Nuno Sa Subject: [PATCH] iio: inkern: fix channel read regression Date: Thu, 30 May 2024 09:44:16 +0200 Message-ID: <20240530074416.13697-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.44.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit A recent "cleanup" broke IIO channel read outs and thereby thermal mitigation on the Lenovo ThinkPad X13s by returning zero instead of the expected IIO value type in iio_read_channel_processed_scale(): thermal thermal_zone12: failed to read out thermal zone (-22) Fixes: 3092bde731ca ("iio: inkern: move to the cleanup.h magic") Cc: Nuno Sa Signed-off-by: Johan Hovold --- drivers/iio/inkern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Someone should re-review the offending commit so that there are no more of these subtle regressions that are bound to happen when people use cleanup.h to save a few lines of code at the cost of readability. Johan diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 52d773261828..485e6fc44a04 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -721,7 +721,7 @@ int iio_read_channel_processed_scale(struct iio_channel *chan, int *val, return ret; *val *= scale; - return 0; + return ret; } else { ret = iio_channel_read(chan, val, NULL, IIO_CHAN_INFO_RAW); if (ret < 0) -- 2.44.1