From patchwork Thu Apr 1 17:17:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 413633 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp768037jai; Thu, 1 Apr 2021 10:45:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3OePuNKZcbV69R/Me3aok+sVmb/U9SPAeNmuIOCyHZSE73oEczk8Zjxe4zrzq7gY7hNrk X-Received: by 2002:a17:907:94cc:: with SMTP id dn12mr10432788ejc.177.1617299140062; Thu, 01 Apr 2021 10:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617299140; cv=none; d=google.com; s=arc-20160816; b=uxzlDn3y4bf9IglC//a+aKMVMimE+oJqhNZUavwng+x2ML5qGPqrIv4GuWpgHLIUii 0wz3slguTnjsqblutA0U4weVAqCHTG1plxcM+3w2heJJXKoB+UtiD1TMFDBItXjUzyh7 8iS8lGvzTXwkbJI0GVi3hyatovLyAOQGsJXbWvYSt35n5zlbR7mGqBoIMABcljhn9en4 Gazl2pcWtwHmNB4NMdguYJSjSQ1ppsf3lKUYxzuEGlYmrjCnfAHSqepjb4rjmwBbjzUm 1/b99vhXukIBCVBx22qIFBS3hqmhCHsTySr+ZboTQEsSzOCKLsJwo+wju41d3GgL722O iBhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ygJDp6Gy+4ANc8TCsq8Z+jh8sWtbLZ+Cz/sJaF8/vJY=; b=erEys7mbO3wG0kivbGQGVtvAlLqEp0OIqK9G6Yrh2U7jwHzl7Qd8+mlll0OgHIvu/s XMX9KmIbsnhsvwjkOqcIHw/XGVwimEKIw9vcBmuKMuAso+jnTmFBoBdZzbMuLW29ljMC KC4MZcpwHefS9WQh89cvfbssea/3f00W1sYaX/KIflOoBJYOmnSGopkdWxsaHTe5V9Nk zwfKBskCi2//UYto8DbdZskFfphuEsS0Xxb0LIxL7sVBNY2AkmK75XuFN9wSrd9aplRl qupltYYD9TFihdQ/jQcBmzwLFSjuBp7GpHc5QJe1zMppsoZrZ/FJkGEIlPWjVtih/nZV QPxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W8IqReJr; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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. [23.128.96.18]) by mx.google.com with ESMTP id v24si4734993eja.84.2021.04.01.10.45.39; Thu, 01 Apr 2021 10:45:40 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=W8IqReJr; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S235548AbhDARm4 (ORCPT + 6 others); Thu, 1 Apr 2021 13:42:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:40690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234601AbhDARiV (ORCPT ); Thu, 1 Apr 2021 13:38:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 512D3613C9; Thu, 1 Apr 2021 17:20:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617297606; bh=ppFkbyhE1z8HEc1Vjh/sVhlr9mfGa9Nh8NUjxIGBCr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W8IqReJrPDBe28rX9SpHJnVzragn++d0qpzhAmvdxvmFW1CVtSQwL2XX2tZjVr76f itxUNu0C7yvskWFvFHhBJpJ79KOQjYxqFeB8Cmi1gcpcI213MUsi6+xLTPBf8gsK56 KYIF+KUdCS2D4nTwkNE3EU4g1J055EWzwEE0SGBWi/DwyO2bE4iXvtlr0/lTqwVCfP Mu9dL7/vspVMjqlehguS98RUhWz3HZSRqSu80IyEeICZb5rvCJx7PDo8nyo/xOOW8+ 1A5ilHPpiVmqQDTCr6Pyey/ZH7u72NTCpPgylrHkCLVS6ShK/gAnRb+yIybQvpRRKq ixpSU5JKnRbrw== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Rob Herring Cc: devicetree@vger.kernel.org, Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Michael Hennerich Subject: [PATCH 1/3] iio:adc:ad7476: Fix remove handling Date: Thu, 1 Apr 2021 18:17:57 +0100 Message-Id: <20210401171759.318140-2-jic23@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210401171759.318140-1-jic23@kernel.org> References: <20210401171759.318140-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jonathan Cameron This driver was in an odd half way state between devm based cleanup and manual cleanup (most of which was missing). I would guess something went wrong with a rebase or similar. Anyhow, this basially finishes the job as a precusor to improving the regulator handling. Signed-off-by: Jonathan Cameron Fixes: 4bb2b8f94ace3 ("iio: adc: ad7476: implement devm_add_action_or_reset") Cc: Michael Hennerich --- drivers/iio/adc/ad7476.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) -- 2.31.1 Reviewed-by: Alexandru Ardelean diff --git a/drivers/iio/adc/ad7476.c b/drivers/iio/adc/ad7476.c index 17402714b387..9e9ff07cf972 100644 --- a/drivers/iio/adc/ad7476.c +++ b/drivers/iio/adc/ad7476.c @@ -321,25 +321,15 @@ static int ad7476_probe(struct spi_device *spi) spi_message_init(&st->msg); spi_message_add_tail(&st->xfer, &st->msg); - ret = iio_triggered_buffer_setup(indio_dev, NULL, - &ad7476_trigger_handler, NULL); + ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, NULL, + &ad7476_trigger_handler, NULL); if (ret) - goto error_disable_reg; + return ret; if (st->chip_info->reset) st->chip_info->reset(st); - ret = iio_device_register(indio_dev); - if (ret) - goto error_ring_unregister; - return 0; - -error_ring_unregister: - iio_triggered_buffer_cleanup(indio_dev); -error_disable_reg: - regulator_disable(st->reg); - - return ret; + return devm_iio_device_register(&spi->dev, indio_dev); } static const struct spi_device_id ad7476_id[] = {