Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp813804imj; Sat, 9 Feb 2019 08:27:06 -0800 (PST) X-Google-Smtp-Source: AHgI3IaEFOXQOvnKwniNUfWZQSieShtXNbNr434vR/WzkR55vM6JZMP7rmZrHBxpRV43EAsKdyKm X-Received: by 2002:a62:5444:: with SMTP id i65mr29026501pfb.193.1549729626246; Sat, 09 Feb 2019 08:27:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549729626; cv=none; d=google.com; s=arc-20160816; b=erKfejUuY+M/yVonXvkl8sVIFEiz4PQFkCUDPzaeDPzgMBxQZg2KaAHHZu/1X4Z3fQ xLmt+VBdRuLbpOKEsZOysd9o51PiL5en+j08DEEvrarFsS9JcrISwR/o/FkFJb8YBRJ4 6uNsEPnnc4kz00FfmyLWdlfKZX/pNQ1U20dvpmy8EDQwCTH8DQpE876i7WUxDDrmxg5O 59t4YUiIrgkDZNPykDZk1tlbhX24JsAvSTRvPLbW5936JvFd2nuNxH6df8poOBSoO3Qu 9QAdUgyoWjYGWrAl+dCbw6US7lcLnXTvj91VvZ4wikvATrpgTG+OwpyqC2S1FMvvUG6v d/sA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=1EUsLSpbEGq/oH1oXnbXvHdX67IkdIsABiJgLwC0m8U=; b=KYtOUkw5DHQRjaP8aUGk5HZN2Du+QQ9zE45J6hT1d63O4tpG7pqgBPzugZPKUIgteE 27JpwDW9/LtKCNgHgiRVQCyo+qtqAfiNwIxUCicD6RrXx5HoSl5kgRCPtKay9SIfcQqG 4QiWVft7+fcz+Tt1TSqYG4qv1cQGrnMPeQqy/GzrAv4yOksDVsDBSbvgEaC2q8Uf61cy NN0hxDp/myWouQ/okaVkrz2ovSouVHO8YDK100b0JdBCWMvnyDlbaTkaVICr9KhxXPno PmyPzODbwwnL6X8NhwfrQc4MxF9Ry+dWOwuYR5KWuCVVCViOr69+yPeZBC8fkwl+3Ftk u6vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tD5jMHyW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 193si4140748pgc.220.2019.02.09.08.26.50; Sat, 09 Feb 2019 08:27:06 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=tD5jMHyW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727144AbfBIQ00 (ORCPT + 99 others); Sat, 9 Feb 2019 11:26:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:42102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726907AbfBIQ0Z (ORCPT ); Sat, 9 Feb 2019 11:26:25 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (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 5DC7521919; Sat, 9 Feb 2019 16:26:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549729584; bh=lfArmp9gKq2w9yF2OtbZGX0njTbCgvS+hs/0pQDIGDM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tD5jMHyW20vQj1tJDToiJKGsElG+EJyHJiUHldykuqw4wmUuAl331HsHQo5cAIPFC N7ugxOn0L1zzKw3WgKmvAfT4zK8qhDHpdlStDjwQkUW6kUaw2XHygVlAbuKAK1ZoW9 9IteCkfSdRIm42y1wYqobrZtEPJgg0scZumnXivU= Date: Sat, 9 Feb 2019 16:26:18 +0000 From: Jonathan Cameron To: Renato Lui Geh Cc: lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, stefan.popa@analog.com, alexandru.Ardelean@analog.com, giuliano.belinassi@usp.br, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: Re: [PATCH v3 2/4] staging: iio: ad7780: move regulator to after GPIO init Message-ID: <20190209162618.64edd25a@archlinux> In-Reply-To: References: X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Feb 2019 15:13:21 -0200 Renato Lui Geh wrote: > To maintain consistency between ad7780_probe and ad7780_remove orders, > regulator initialization has been moved to after GPIO initializations. > > Signed-off-by: Renato Lui Geh This looks fine, will pick up with the earlier patches when ready. Thanks, Jonathan > --- > drivers/staging/iio/adc/ad7780.c | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c > index 6e4357800d31..7804cd2b273e 100644 > --- a/drivers/staging/iio/adc/ad7780.c > +++ b/drivers/staging/iio/adc/ad7780.c > @@ -250,16 +250,6 @@ static int ad7780_probe(struct spi_device *spi) > > ad_sd_init(&st->sd, indio_dev, spi, &ad7780_sigma_delta_info); > > - st->reg = devm_regulator_get(&spi->dev, "avdd"); > - if (IS_ERR(st->reg)) > - return PTR_ERR(st->reg); > - > - ret = regulator_enable(st->reg); > - if (ret) { > - dev_err(&spi->dev, "Failed to enable specified AVdd supply\n"); > - return ret; > - } > - > st->chip_info = > &ad7780_chip_info_tbl[spi_get_device_id(spi)->driver_data]; > > @@ -279,7 +269,7 @@ static int ad7780_probe(struct spi_device *spi) > ret = PTR_ERR(st->powerdown_gpio); > dev_err(&spi->dev, "Failed to request powerdown GPIO: %d\n", > ret); > - goto error_disable_reg; > + return ret; > } > > if (st->chip_info->is_ad778x) { > @@ -290,7 +280,7 @@ static int ad7780_probe(struct spi_device *spi) > ret = PTR_ERR(st->gain_gpio); > dev_err(&spi->dev, "Failed to request gain GPIO: %d\n", > ret); > - goto error_disable_reg; > + return ret; > } > > st->filter_gpio = devm_gpiod_get_optional(&spi->dev, > @@ -301,10 +291,20 @@ static int ad7780_probe(struct spi_device *spi) > dev_err(&spi->dev, > "Failed to request filter GPIO: %d\n", > ret); > - goto error_disable_reg; > + return ret; > } > } > > + st->reg = devm_regulator_get(&spi->dev, "avdd"); > + if (IS_ERR(st->reg)) > + return PTR_ERR(st->reg); > + > + ret = regulator_enable(st->reg); > + if (ret) { > + dev_err(&spi->dev, "Failed to enable specified AVdd supply\n"); > + return ret; > + } > + > ret = ad_sd_setup_buffer_and_trigger(indio_dev); > if (ret) > goto error_disable_reg;