Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp410125rwb; Thu, 11 Aug 2022 03:56:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR4SeBC++av28mZNCtojhi/Bg5fSxYKBuj3SF49KuE5i7VjtMrydpDbkhs6Cz2AXRgp2BWPX X-Received: by 2002:a17:90a:d158:b0:1ec:8298:40dc with SMTP id t24-20020a17090ad15800b001ec829840dcmr8286147pjw.51.1660215407368; Thu, 11 Aug 2022 03:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660215407; cv=none; d=google.com; s=arc-20160816; b=NttFYjsBCmv8gXebdTCIYy9qHWPHT/2WqSZ42cbeDjl8FhbqSNCnA25pOnqwl+59aV 42aBrDZ8zFktmLrIDe1PXBlB3vsbXDZcvwVv265H1L4ILR3JxzK30Nth1VFDrgJRRI2H fPU8CiUAK0yD7AFy1ZsEHTcFDP38ih2LvxpnaQyxP4/ntG0WbQT9hOgiCR8zVvgjWlYl cxwt/pgTShZCbkfSflcXW/0eEHFmzoLqAuQFf+mccrdMo0epcb/k45Z8PmTZn4tBGrl4 M/HjUu+cU1CokblrJ2vUy3VtIgFGbAvlXCwRiKlEUVXj6FazaTDP7XHDkqn3XiknlUSq dzUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=F3AREqaAmNIA8b4CTq4bQZvZrznD/j87Pqt0Vn0q/ow=; b=dJtESf9UG8FgnzfYeobXRpjoNDRhVQvNuPhsl4fF7UjAcKlhO1V5PZLtak8rvNv9ze K9FnADd1b3zJN2vFhVh+PSKvx20iyB1LorvWsV5Tlg8XwKFJt2Ww5j3jVWyV7ZpwMVN3 APAO7P6gkXQEoZYrzF8kHge9/nOU4JKhda1T/cE5YViNEpU7Kqljnt9gZzNiGQRFVhsH Yayst6o7ASGVNybl11EPURZ1T+cP9eV+TyI61lCl/cq15T1Msja0b3e41RBsCeshglFb 4MlTFSmOR/vZNSx3KJ48ZtpwAw4dUV0K6Uuuh2tMXghIIr0ZlIB55Y9T6yip7CQ/PT4u iSoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AzSDrxaB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a17090a564c00b001e895fed1e2si5538575pji.130.2022.08.11.03.56.32; Thu, 11 Aug 2022 03:56:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AzSDrxaB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234579AbiHKKvQ (ORCPT + 99 others); Thu, 11 Aug 2022 06:51:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233856AbiHKKvN (ORCPT ); Thu, 11 Aug 2022 06:51:13 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82FD37820B; Thu, 11 Aug 2022 03:51:12 -0700 (PDT) Received: from [IPV6:2405:201:10:389d:42df:ae4c:c047:294c] (unknown [IPv6:2405:201:10:389d:42df:ae4c:c047:294c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: shreeya) by madras.collabora.co.uk (Postfix) with ESMTPSA id 82B106601CE2; Thu, 11 Aug 2022 11:51:09 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1660215071; bh=IfPooe1VNkTtfiNR2zb1X1udyCJ5qiqVzbKpp7Jtf/8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=AzSDrxaBlb/8Z/b1yo7GpOsQOvjwXnAJgnSWybI2ANSb3PhK3MHmB80N5c8Eu6wMb py9MTrBrshMuimJuvgjWQYc1Hof7xpA0JXiLDsx1TVMfQTAh7j6sbzWiUdZyN4ZsTW e9dvKduYfx7W1MjkLB+I4kA6mCMLCX1UEouuS/HL//iCatP2ebA34qKOvoa5ge7fIK gAWQRvdMt8OGHuSEc9Ba2d7yIq5qVyVoUxJrtXmh+et2UEHA5UddanxjB1MyDPPjZ6 uLQLvG5JyCGz5dsEAtxVUcdU/qwq2wX5N7LN5IANqmzi4xctXsRmNBOcDRLvwsP465 VQapnZyFSxxNQ== Message-ID: Date: Thu, 11 Aug 2022 16:21:05 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] iio: light: Add raw attribute Content-Language: en-US To: Dmitry Osipenko , jic23@kernel.org, lars@metafoo.de Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, krisman@collabora.com, kernel@collabora.com, alvaro.soliverez@collabora.com References: <20220811101443.499761-1-shreeya.patel@collabora.com> From: Shreeya Patel In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On 11/08/22 16:13, Dmitry Osipenko wrote: > On 8/11/22 13:14, Shreeya Patel wrote: >> + case IIO_CHAN_INFO_RAW: >> + ret = ltrf216a_set_power_state(data, true); >> + if (ret) >> + return ret; >> + mutex_lock(&data->lock); >> + ret = ltrf216a_read_data(data, LTRF216A_ALS_DATA_0); >> + mutex_unlock(&data->lock); > ltrf216a_set_power_state(data, false) should be called before return. ah! yes, missed that. Thanks for pointing out. I'll send a v2. Thanks, Shreeya Patel >> + if (ret < 0) >> + return ret; >> + *val = ret; >> + ltrf216a_set_power_state(data, false); >