From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 EC96830E828; Fri, 9 Oct 2026 14:54:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791557655; cv=none; b=C+D0hNxLxV7ZCzZSMCyEI2xI9LH6sNd3P5/7oEwwKHvAEDk//wj35B+bIRtDlBfu8wPMKE8u2lRamIwW0lONIV+2iIQmhXX9Vxllw3MFfpfkdgmcIxvOD5mdxqppNyBZMqMPnLZlQgpG6tIqcRkak9iXUq6o26950qf1GkEoM+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791557655; c=relaxed/simple; bh=yHpyKhzbstZ+KkWJKk1GFugn140OKUOHhtgJon/eFAw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t2NlwQVq8YGu+w2phDyDtaTN/CUu1k+zKlT+QgA0aq8zmEY1Y2YthrV5AlnyFBzQq5SykRcGt2G8CqR8v+65E3kWnAu0VF8T2Y/iLmqEAHCohvztWpPqNGoIG0eqvMg3inmlfPMnmjsXfxqvOOitykXuphZOMSMJwoHOHX969Fw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=J0GXRIwS; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="J0GXRIwS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51BA21F00893; Fri, 9 Oct 2026 14:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791557654; bh=SqJ+fY+q2ZlfM8wNuLtRkbBRwR7P+FfmWaVukwYFvpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=J0GXRIwSKWSnPZeZ4G7wf/qR/GOANVitQUc3mL934oy4bq72iQ88krOoTl0q5PlpW LsARQDx7XTthrMefAu+zMrN2KHA2q1j8AnvHRJByriMu80XpQoMT4nK9Lbm20u1SG6 j0T59RdYW44WzvvukpPwtIYwrCmtncVRO+rAxqYE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Salah Triki , Jonathan Cameron Subject: [PATCH 7.2 399/428] iio: frequency: admv1013: fix wrong channel field used in admv1013_read_raw() Date: Fri, 9 Oct 2026 16:12:16 +0200 Message-ID: <20261009140954.978542256@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261009140946.008206689@linuxfoundation.org> References: <20261009140946.008206689@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Salah Triki commit 2093236e886ad9446ec3285ba520e024dd1464e1 upstream. admv1013_read_raw() switches on chan->channel instead of chan->channel2 when handling IIO_CHAN_INFO_CALIBBIAS. The channel field only ever holds 0 or 1 (see ADMV1013_CHAN_CALIB()), while the IIO_MOD_I / IIO_MOD_Q modifiers are stored in channel2. As a result, the switch always falls through to the default case and calibbias reads always fail with -EINVAL, even though the corresponding admv1013_write_raw() path correctly uses channel2 and works as expected. Fix the read path to switch on chan->channel2, matching the write path and the actual channel_spec definition. Fixes: da35a7b526d9 ("iio: frequency: admv1013: add support for ADMV1013") Signed-off-by: Salah Triki Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/frequency/admv1013.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/frequency/admv1013.c +++ b/drivers/iio/frequency/admv1013.c @@ -195,7 +195,7 @@ static int admv1013_read_raw(struct iio_ switch (info) { case IIO_CHAN_INFO_CALIBBIAS: - switch (chan->channel) { + switch (chan->channel2) { case IIO_MOD_I: addr = ADMV1013_REG_OFFSET_ADJUST_I; break;