From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB220C04A6B for ; Mon, 6 May 2019 15:07:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D2A62054F for ; Mon, 6 May 2019 15:07:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557155237; bh=GymqtUjs3yMq3S/YyM/ppiiHTpPg8oNOIbMQ1GKUQPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=TV9/2EdPy+aFyWLvyqaokVxN85jKdOMMEQwVGaBfTYsfTAF+RMQtlfGdXwi54489e fj82m56k+D/mctgOJBNmpAg72lpaWvi7HpijbzbZyH/x3azBKrsbF0MPXLmIg1bVke TNn85BgssaMQbeFqkxqndWm5fV95vMQZSux0uSrw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727351AbfEFOhP (ORCPT ); Mon, 6 May 2019 10:37:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:57886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727347AbfEFOhP (ORCPT ); Mon, 6 May 2019 10:37:15 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3AACD206A3; Mon, 6 May 2019 14:37:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153434; bh=GymqtUjs3yMq3S/YyM/ppiiHTpPg8oNOIbMQ1GKUQPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yNMQM3Ja04AFZabbTpqOjG1pFnoGmgAkhF3mtqsZzHVf2S8UL5Ep9w+ReYy5TekKI t/70PUSxVROgHcxZxGUFehtUEKJWBOen1ixKmtkJ75pca4NVSdjSZie145/CGeCUu1 pZW6K0vKMVNeD9Mm4M0nAFfoYvfVPqvbMPqWtiKA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeremy Fertic , Jonathan Cameron Subject: [PATCH 5.0 088/122] staging: iio: adt7316: allow adt751x to use internal vref for all dacs Date: Mon, 6 May 2019 16:32:26 +0200 Message-Id: <20190506143102.637545998@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jeremy Fertic commit 10bfe7cc1739c22f0aa296b39e53f61e9e3f4d99 upstream. With adt7516/7/9, internal vref is available for dacs a and b, dacs c and d, or all dacs. The driver doesn't currently support internal vref for all dacs. Change the else if to an if so both bits are checked rather than just one or the other. Signed-off-by: Jeremy Fertic Fixes: 35f6b6b86ede ("staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver") Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/addac/adt7316.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/iio/addac/adt7316.c +++ b/drivers/staging/iio/addac/adt7316.c @@ -1079,7 +1079,7 @@ static ssize_t adt7316_store_DAC_interna ldac_config = chip->ldac_config & (~ADT7516_DAC_IN_VREF_MASK); if (data & 0x1) ldac_config |= ADT7516_DAC_AB_IN_VREF; - else if (data & 0x2) + if (data & 0x2) ldac_config |= ADT7516_DAC_CD_IN_VREF; } else { ret = kstrtou8(buf, 16, &data);