Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2186771imm; Thu, 18 Oct 2018 10:20:52 -0700 (PDT) X-Google-Smtp-Source: ACcGV62uIstNF7Dwxucf3r6yWBE7h6x2raZ2Qmq3980SArjd30RLQ3+5Nksh4Jb9eOY+qM1EevJN X-Received: by 2002:a17:902:8f90:: with SMTP id z16-v6mr31017126plo.214.1539883252393; Thu, 18 Oct 2018 10:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539883252; cv=none; d=google.com; s=arc-20160816; b=utihyQaoLAldeeazZCoHQTVtJbjJ+xcAZbUkt8RkbzDKxPURJZe/SldiXiraAa2kvn NBupTh4h7IN5zREJSAx+lDmvMx1pu4/QawzFrgKJbJwWunl+35NdyMb5TO/jlxyu2/4t t9QNT3m/eLeUMwBMK2VRvcXgiyotkYp60Ou5vc7aBRZdf+YkqNivCOEAwx6AxLdfMM3j 0fA0KuNj5iW/iG0lnTyV+nbqfot6VjZHq2q9uI6FXsl+ooobziZq20/9cFQgX0yKwGGg NdANlkuyLVf2ee4qfxerv22HqDctUAdZbl4Gjmyes2dDGXh/toYhiS5EWyU0LT0xujmx h7vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=4Kec6BZjhT3gt+a+hpD7WBYnxz/lpcpb2kTW3J0/a08=; b=b21Hm9Pp4zjr2G97cmjf43asTA/SQQ07eVYx//KrpEaiL75TruflIy1ZD/I4SuR9Vg Nbxtu4QKjgjEsYI0BIXrW6hQhGJjKzuXCCmP5DHhTa0YLMiND7zSzsIQ2ef+l1FobHB7 ObBsHLPF4YBkGbaIcIq8MPAlO6AbNoAI8+621dqOWwGxKPNJ5s120LaNcoNAwf3GOpwq uV6x1zTcFu1KbeGCrfvKWBKeuaUgfLR2aVgUUEs5r1Rky2c1Tz/48YD67DoWy/ieBimO 2YJcII8WKTg1qfDs6DguFH1/K0VDHdNb9NFxHBS0wMcCc0MHTzLjYg9A7NN5wLNvzp61 yQgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i10-v6si22066635pgc.420.2018.10.18.10.20.34; Thu, 18 Oct 2018 10:20:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728644AbeJSBWC (ORCPT + 99 others); Thu, 18 Oct 2018 21:22:02 -0400 Received: from www381.your-server.de ([78.46.137.84]:45698 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726444AbeJSBWC (ORCPT ); Thu, 18 Oct 2018 21:22:02 -0400 Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by www381.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1gDBxn-0005Fo-9C; Thu, 18 Oct 2018 19:19:59 +0200 Received: from eisbaer.ursus-maritimus.org ([78.47.220.141] helo=[127.0.0.1]) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1gDBxm-000WBD-Lj; Thu, 18 Oct 2018 19:19:59 +0200 Subject: Re: [PATCH 1/2] staging: iio: ad7606: Move out of staging To: Dan Carpenter , Stefan Popa Cc: jic23@kernel.org, devel@driverdev.osuosl.org, Michael.Hennerich@analog.com, linux-iio@vger.kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, pmeerw@pmeerw.net, knaack.h@gmx.de References: <1539853832-26534-1-git-send-email-stefan.popa@analog.com> <20181018125502.2hnp3s45lk6dggqt@mwanda> From: Lars-Peter Clausen Message-ID: <2199f866-4c23-5424-3459-b966514414ce@metafoo.de> Date: Thu, 18 Oct 2018 19:19:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181018125502.2hnp3s45lk6dggqt@mwanda> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.100.1/25048/Thu Oct 18 14:58:26 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/18/2018 02:55 PM, Dan Carpenter wrote: > On Thu, Oct 18, 2018 at 12:10:32PM +0300, Stefan Popa wrote: >> +static int ad7606_read_samples(struct ad7606_state *st) >> +{ >> + unsigned int num = st->chip_info->num_channels; >> + u16 *data = st->data; >> + int ret; >> + >> + /* >> + * The frstdata signal is set to high while and after reading the sample >> + * of the first channel and low for all other channels. This can be used >> + * to check that the incoming data is correctly aligned. During normal >> + * operation the data should never become unaligned, but some glitch or >> + * electrostatic discharge might cause an extra read or clock cycle. >> + * Monitoring the frstdata signal allows to recover from such failure >> + * situations. >> + */ >> + >> + if (st->gpio_frstdata) { >> + ret = st->bops->read_block(st->dev, 1, data); >> + if (ret) >> + return ret; >> + >> + if (!gpiod_get_value(st->gpio_frstdata)) { > > This check should maybe be: > > if (gpiod_get_value(st->gpio_frstdata) <= 0) { > > (Or possibly not, I don't know the code very well). gpiod_get_value() is only allowed to return either 0 or 1.