Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4672025iob; Sun, 8 May 2022 21:25:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNgd/M1Gh/5Rkctekww0vNeeHIMEIXtEa+FnnU2Hesoz/pYF70klcXvBpOHM/Z+bdfIHGz X-Received: by 2002:a17:90b:1d87:b0:1dc:a9c0:3d49 with SMTP id pf7-20020a17090b1d8700b001dca9c03d49mr24693737pjb.12.1652070329886; Sun, 08 May 2022 21:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652070329; cv=none; d=google.com; s=arc-20160816; b=1BNlprA7AsyXLwVG6z9VAO+cgibd/mFqQm5zCN7wx6GzUQ8Sg/i/NcxSgH5inDYm+2 Me+HnPiteEqHOaebDco0ytLg7mYwVaL2mHIEoYbsIf6hMF+fGTrgtWwzBqDzsSmTRFlg +8UkAq7iPrAATG3eopVcnbzxRhduzKnbDY6P0Ei0E/ETD8Hj5uDiTGO2UeYjKF72n0fY fd5aOp2IeTgdRZh02MGdaUMJJz1XaFFVQOLSMXp/A5g1Ynv8JPldoiAF+Gn5tcxDPDR3 TUDoBvyiVfgY5JW+hEFpBoobybPoQ78TEr5CCFpqcIV63OYlzpCoRQPQqCQ2I2ZqBTMt GCuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+ib8l0pJlK97zSGkdULnqrmwTO4eOweupiGtHE/wGE4=; b=sGfJlybwUQD2AiLi8aJWi+pHByIq6IJsXN8Rh031UsVa1zKAp4j+wirbkRdGYUhSHa 4utbA1PZJzyVg2c0E0fEcpgzyUT64MOrokqWhtS+IiDpj8vwX2MaZM7y+Vf1fkWpDR2M ZwBisUMivFr/IK3rhO10OS2HWeEAWGKRVBQh2RanNfGP2oMsaLdB1/RsDlhClZIpGlTJ P7hA+gGiNmD1BYrxkkwkrCMvst68MSQSdS5gR1TkI8wOliyQ1cEhKPpB3zWBgE8Ed2nb /pgfpbisPZ2SMpEoASc0Pa5PEAaYQl3j8HRCi6JrRNqA/T9z3XMLUjMwdjYzA9EInNV9 1BVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Jj35su75; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e4-20020aa79804000000b0050a7b4bf744si11532401pfl.128.2022.05.08.21.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 21:25:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Jj35su75; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0059B10FC46; Sun, 8 May 2022 21:25:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354609AbiEDRBD (ORCPT + 99 others); Wed, 4 May 2022 13:01:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354054AbiEDQy6 (ORCPT ); Wed, 4 May 2022 12:54:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99A4A49912; Wed, 4 May 2022 09:49:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 339606179D; Wed, 4 May 2022 16:49:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BE16C385A4; Wed, 4 May 2022 16:49:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651682985; bh=/ORMeW9VdrfrZbrInu4dInEhj+vzKcGEl2Q1Sgw3Yvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jj35su75pQQmLfz3iyGlxUrn7yo+Ha+gFcGyytQbZJ6cp0rcU545auARWT0hv2Fca g8hwqwhdIVsV19MouC2a2Ju7Yl/r0jHDw6MkOYbDxs+qZJ7ViLGnAx+Bdke1sX5q3P FZ1mjZAyAUi9+gURlMehXhpnvTUkDOFZj9/tbdT4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Hennerich , =?UTF-8?q?Nuno=20S=C3=A1?= , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.10 014/129] iio: dac: ad5446: Fix read_raw not returning set value Date: Wed, 4 May 2022 18:43:26 +0200 Message-Id: <20220504153022.437640260@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153021.299025455@linuxfoundation.org> References: <20220504153021.299025455@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Hennerich commit 89a01cd688d3c0ac983ef0b0e5f40018ab768317 upstream. read_raw should return the un-scaled value. Fixes: 5e06bdfb46e8b ("staging:iio:dac:ad5446: Return cached value for 'raw' attribute") Signed-off-by: Michael Hennerich Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220406105620.1171340-1-michael.hennerich@analog.com Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/dac/ad5446.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/dac/ad5446.c +++ b/drivers/iio/dac/ad5446.c @@ -178,7 +178,7 @@ static int ad5446_read_raw(struct iio_de switch (m) { case IIO_CHAN_INFO_RAW: - *val = st->cached_val; + *val = st->cached_val >> chan->scan_type.shift; return IIO_VAL_INT; case IIO_CHAN_INFO_SCALE: *val = st->vref_mv;