Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp132292imc; Fri, 15 Mar 2019 19:16:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvDXJUR7nWYt9bAM7hgkaNwLRxHXQ1tFX3NluAGgif9y9ztRC5xdHcZ1VdpbKPkrnxSvfC X-Received: by 2002:a17:902:45a5:: with SMTP id n34mr7640266pld.127.1552702562549; Fri, 15 Mar 2019 19:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552702562; cv=none; d=google.com; s=arc-20160816; b=MN5Gj3tlCSJ99WjkHxTV8LOUGOetGqFkkQu+88QxLkHF3y5HI1jCkR8lEl8HybjsXj oKX15wHbC/kYR8bVkVsV+u7zWNI1aIxkGcxVWMm724JnnuQcN2tvo0Ra27MHSU15Suz5 zFjVmDuSBhRjTeSkxwfGAmj7dg1LsJrUVH9CnwcLCvH6MP7CLwgmUDfj8od0GgrQ996p JDmSFiP5e7pszHviZaJBr7wx0ZuMuC8MnCu2UdtblZUA0rp+cU/QDNmgtkXjNNmIZET2 E2WXAh3uTxzUsfrg4by5RBgoo80a5uQwf2/w4qosIW4bJdpU+Fnmc5U289bUyzWsE4/X mj2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=E79KXUnhP4o02hGiR6DT9/4NVN8LNyEneSndXO0JIsw=; b=lEwItFPDn8pDnxbWrvT7yCFIImE6OofpzRx0KrebHgS++g4prYkfGbS5JZh8gbQJnS ZW1Ik+fhvA7uXl2Ti/9IPCOfCqKv12Mk5Lr2A7O6AVzCr8t9HKDVbGcgPINRVN/gMQFp s0Mx3DCTyr7+W8momTaamusav80SSSVCwcy2vkbAmLEgsv96hHr1/nmtAEQKXY8ow8Gz pJm8YYOMftEMu9jFn25QYyYm3/891+cu1UZilC8ITV0bzzyL2jec5Kdb93t4B9MCMe71 yqC7iqnp22uSQOLJB8zwffsW28C4Vw0AmrwXFWIw5WU9LgNXI+jL1eT1OZxmz4Q542OR YfAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h0D+aQ2J; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x17si3367453pgg.431.2019.03.15.19.15.47; Fri, 15 Mar 2019 19:16:02 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h0D+aQ2J; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726695AbfCPCPG (ORCPT + 99 others); Fri, 15 Mar 2019 22:15:06 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:35978 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbfCPCPF (ORCPT ); Fri, 15 Mar 2019 22:15:05 -0400 Received: by mail-qk1-f196.google.com with SMTP id k130so6705074qke.3; Fri, 15 Mar 2019 19:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=E79KXUnhP4o02hGiR6DT9/4NVN8LNyEneSndXO0JIsw=; b=h0D+aQ2Ju6xSelONwMt6gNSu83Ys9FhLReo4hICCKjL+UQ9ydsWlbygDpNdGSOfC0U VKAt9sU/H9olMbyHo3NGXjr0c5oEOOdLLO8NFhh4x3Gftc58BSZWZg5WXUe7uJPL+Xbm rx03bL92k1Csc96suTMEWzMt/CXiz9Cxyycp2oXOstvHXKM9NmtK+KF5v9EVHPPRLZLa e/oNHZkhygqNsP4Pn86IvzLvsI19tc/+gyeVrW1ZevdRwr3cxJiAa2sx4QGS3dltMKCF dFp0NsERGarU7YQJgR5S7GryVrkC0EzUqUSSB5AnqV29taGlpcvrDOikNgaYiKNx2BOv XMUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=E79KXUnhP4o02hGiR6DT9/4NVN8LNyEneSndXO0JIsw=; b=UOS9JXCpywBk3jzo4cXBghTs5z9H8bPi6IRZ5iuYz6/nk3LUXrxp+ukp82UMA7erwQ Vdt1Y1jEFTpKIC6CKTNWXdwbaN8TeCcWZFZmtUOCFgqWHm1lv8cEoxU5v/b8fykt656F /WINF7wtLAhniRu2RBfTlThFrZ5mlerclmkgSE3f8Ts3uMBsHUIhupE+bPNMm+VHKIIR pOLOxbTVqhvO+qpynRgMirmIpYeb0KKB4etScvZYDP0DSnL0qOJ4Ij6DUgTmpa+WpQrb Mu0xGCAnv1PN2R4qHBYLdM2bShDBWhMvyxyMeelyL7bOLrQfr+dZ1rR7+nodnLYy81Ox oZiw== X-Gm-Message-State: APjAAAUWaP3PkyQkv6921iy8VNq0XmOdO/sGJs4RgSdYKwPD4xtYREWI NCM8fH7heqUEVSRCvvQdzJI= X-Received: by 2002:a37:d6ce:: with SMTP id p75mr5100559qkl.286.1552702504574; Fri, 15 Mar 2019 19:15:04 -0700 (PDT) Received: from renatolg ([186.220.21.102]) by smtp.gmail.com with ESMTPSA id v131sm2132489qka.95.2019.03.15.19.15.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2019 19:15:04 -0700 (PDT) Date: Fri, 15 Mar 2019 23:14:59 -0300 From: Renato Lui Geh To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, stefan.popa@analog.com, alexandru.Ardelean@analog.com, giuliano.belinassi@usp.br, robh+dt@kernel.org, mark.rutland@arm.com Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com, devicetree@vger.kernel.org Subject: [PATCH v5 07/11] staging: iio: ad7780: move regulator to after GPIO init Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/staging/iio/adc/ad7780.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c index 977b381c1260..568c5b4472ff 100644 --- a/drivers/staging/iio/adc/ad7780.c +++ b/drivers/staging/iio/adc/ad7780.c @@ -295,16 +295,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]; @@ -321,6 +311,16 @@ static int ad7780_probe(struct spi_device *spi) if (ret) goto error_cleanup_buffer_and_trigger; + 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; -- 2.21.0