Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3277756pxj; Tue, 11 May 2021 00:20:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj574b2I9Q2LUWx4znv4NJeknq2chYo1K0MbGQKOqRZU+HmRaMYolU5HtGNEmwJVYiHgd1 X-Received: by 2002:a6b:ce12:: with SMTP id p18mr21514367iob.199.1620717650492; Tue, 11 May 2021 00:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620717650; cv=none; d=google.com; s=arc-20160816; b=iTDWeWf3/5+FaAUvYYJJtfS48SjFBEf2GzfdxcegdzsWtSQaYvUHV07K2ORaiNR+TY 9Rne3j4DPPU3N2U+QUADJ18DZqo91ITknSIaiNKtyoXrJ75WF1Kc++9wOIc0dj5E4hKk Y9XR3cemdOP/6O6XTXpF7M2FK4bIw7kRmYr8l/OpwnO9RGRh7e15tr+QjV7wg2PHIZ4k L+89bDCMImEUELdO36SZ9gqGEVLFX1INCaeyTAWdxEM83nmwAQcspGBkqIwK5ZpKtXE5 5i7oPSFSudJ6OhlfdvGfb89yx7XO3nQ/m41BGF4LRdhHKXhcg+JhmibEQwPZNbD81wsU TJXA== 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=jHJAupFk4VVa7z8ctgtedCHBJAEpOSwdi50lGjIjnM8=; b=p2LlTfHBlWrEHtz+PZLzTpwIx/3K7fH8MRmxJ4EpsEtddBRxovnUo6DyQYdlHYeHbI cpqQ2oAQ4U/Z+1HbpXi+vk+xXhvkKpH1MU1gSFyLcsvGNyyk7ajZmLMPyKRTmFeqzbfw JIVl10aPeD1n5egJmX7VMIIOkc89q58EbnKLalf+w3YTJYM52rqPGcejsmdgAicnO56U MZ5rIvL/fY4Cvu1vaaJhnShozjQIbGidbtX11kC8qHalDgRJ0ZLTtpQ7/O2iGzsHwaqv im6xDEf2KIRIM1ECc5SOyj8s4n9NEHAN8qUBGDdbXeoIB3TV85cxz2YaPXZoCtl5ILST RrBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=bTvYTEb2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d14si21043848iod.102.2021.05.11.00.20.38; Tue, 11 May 2021 00:20:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@deviqon.com header.s=google header.b=bTvYTEb2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231233AbhEKHUR (ORCPT + 99 others); Tue, 11 May 2021 03:20:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231166AbhEKHT7 (ORCPT ); Tue, 11 May 2021 03:19:59 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69F3BC061760 for ; Tue, 11 May 2021 00:18:48 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id zg3so28257807ejb.8 for ; Tue, 11 May 2021 00:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deviqon.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jHJAupFk4VVa7z8ctgtedCHBJAEpOSwdi50lGjIjnM8=; b=bTvYTEb2K77cls873u2IXLpinsxfp5BKbdvPHfvZpBd/42WCGy9rj1yWQP4m9ICcHi oHZS1jrg1Kj9A3sMjavCtXrGDl3tMQFBLrMULkUBRSuYAugbephewj2Y35hObGWGI/IG Ey5tjMbqQezTgnEcDZzvpBPillnJfDX+SEPmakcLrwN+zgX/Ney0xycu/aTq/OIKxHiW p2hx0dH3AZzB59ACnTvSpxl0Lcgq1DGxsIyvm3dDo18SasDGxRMgSnNDekXd3HfTc96O CHwZ1s1SqvyhVb1zGm583BYcr7VYwFbSJ04iNsqskfzvq/57NdfLjXStEWfpv9FLVJIR 8vpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jHJAupFk4VVa7z8ctgtedCHBJAEpOSwdi50lGjIjnM8=; b=bIy+UgYou7dvz//qA10vwjYJRDcdgHQ2NjRwZEs+XBl0D68htbZuCRR3O2hnWwr2p1 27jE18vtrXnPQVpdYxAtmtGkkAv6Yjb6SsKfZ28xHRn5G9cwKFRmgUhbsZ4ly/yfZ+YW zachg0oRpcPav/8NiZysNt8mknb7oXsFDiUio7pPf04lwzIWl3koyPq6wprjbeixhPe9 VJfzMANKtzsZ1f8QZ8pd9zbgOlJWV2xjD/VKkMNqugcANRNg3j5TCW0Nv1g7T/BaHwOu HmZS4KbPOe5d3HZgLcA5L0yd0XhIoNIDzEiFW/mKpAWnwHjasC9DAnpG1Nwp+KikOxoK vXzg== X-Gm-Message-State: AOAM532YdwzT0BrdZ/CX1qq+GUbxcRC5A2JGLEVvTWDlybn7Xem4oWJA 9abvL3Ndz9WohEN9LlPztlPssg== X-Received: by 2002:a17:906:91d3:: with SMTP id b19mr30172072ejx.242.1620717527122; Tue, 11 May 2021 00:18:47 -0700 (PDT) Received: from neptune.. ([188.27.131.122]) by smtp.gmail.com with ESMTPSA id i6sm13871558eds.83.2021.05.11.00.18.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 May 2021 00:18:46 -0700 (PDT) From: Alexandru Ardelean To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jic23@kernel.org, Jonathan.Cameron@huawei.com, alexandru.tachici@analog.com, linux@deviqon.com, Alexandru Ardelean Subject: [PATCH v2 12/12] iio: adc: ad_sigma_delta: remove ad_sd_{setup,cleanup}_buffer_and_trigger() Date: Tue, 11 May 2021 10:18:31 +0300 Message-Id: <20210511071831.576145-13-aardelean@deviqon.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210511071831.576145-1-aardelean@deviqon.com> References: <20210511071831.576145-1-aardelean@deviqon.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since all AD Sigma-Delta drivers now use the devm_ad_sd_setup_buffer_and_trigger() function, we can remove the old ad_sd_{setup,cleanup}_buffer_and_trigger() functions. This way we can discourage new drivers that use the ad_sigma_delta lib-driver to use these (older functions). Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/ad_sigma_delta.c | 86 -------------------------- include/linux/iio/adc/ad_sigma_delta.h | 3 - 2 files changed, 89 deletions(-) diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c index d5801a47be07..1d652d9b2f5c 100644 --- a/drivers/iio/adc/ad_sigma_delta.c +++ b/drivers/iio/adc/ad_sigma_delta.c @@ -470,49 +470,6 @@ EXPORT_SYMBOL_GPL(ad_sd_validate_trigger); static const struct iio_trigger_ops ad_sd_trigger_ops = { }; -static int ad_sd_probe_trigger(struct iio_dev *indio_dev) -{ - struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev); - int ret; - - sigma_delta->trig = iio_trigger_alloc(&sigma_delta->spi->dev, - "%s-dev%d", indio_dev->name, - iio_device_id(indio_dev)); - if (sigma_delta->trig == NULL) { - ret = -ENOMEM; - goto error_ret; - } - sigma_delta->trig->ops = &ad_sd_trigger_ops; - init_completion(&sigma_delta->completion); - - sigma_delta->irq_dis = true; - ret = request_irq(sigma_delta->spi->irq, - ad_sd_data_rdy_trig_poll, - sigma_delta->info->irq_flags | IRQF_NO_AUTOEN, - indio_dev->name, - sigma_delta); - if (ret) - goto error_free_trig; - - iio_trigger_set_drvdata(sigma_delta->trig, sigma_delta); - - ret = iio_trigger_register(sigma_delta->trig); - if (ret) - goto error_free_irq; - - /* select default trigger */ - indio_dev->trig = iio_trigger_get(sigma_delta->trig); - - return 0; - -error_free_irq: - free_irq(sigma_delta->spi->irq, sigma_delta); -error_free_trig: - iio_trigger_free(sigma_delta->trig); -error_ret: - return ret; -} - static int devm_ad_sd_probe_trigger(struct device *dev, struct iio_dev *indio_dev) { struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev); @@ -553,49 +510,6 @@ static int devm_ad_sd_probe_trigger(struct device *dev, struct iio_dev *indio_de return 0; } -static void ad_sd_remove_trigger(struct iio_dev *indio_dev) -{ - struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev); - - iio_trigger_unregister(sigma_delta->trig); - free_irq(sigma_delta->spi->irq, sigma_delta); - iio_trigger_free(sigma_delta->trig); -} - -/** - * ad_sd_setup_buffer_and_trigger() - - * @indio_dev: The IIO device - */ -int ad_sd_setup_buffer_and_trigger(struct iio_dev *indio_dev) -{ - int ret; - - ret = iio_triggered_buffer_setup(indio_dev, &iio_pollfunc_store_time, - &ad_sd_trigger_handler, &ad_sd_buffer_setup_ops); - if (ret) - return ret; - - ret = ad_sd_probe_trigger(indio_dev); - if (ret) { - iio_triggered_buffer_cleanup(indio_dev); - return ret; - } - - return 0; -} -EXPORT_SYMBOL_GPL(ad_sd_setup_buffer_and_trigger); - -/** - * ad_sd_cleanup_buffer_and_trigger() - - * @indio_dev: The IIO device - */ -void ad_sd_cleanup_buffer_and_trigger(struct iio_dev *indio_dev) -{ - ad_sd_remove_trigger(indio_dev); - iio_triggered_buffer_cleanup(indio_dev); -} -EXPORT_SYMBOL_GPL(ad_sd_cleanup_buffer_and_trigger); - /** * devm_ad_sd_setup_buffer_and_trigger() - Device-managed buffer & trigger setup * @dev: Device object to which to bind the life-time of the resources attached diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc/ad_sigma_delta.h index be81ad39fb7a..c525fd51652f 100644 --- a/include/linux/iio/adc/ad_sigma_delta.h +++ b/include/linux/iio/adc/ad_sigma_delta.h @@ -133,9 +133,6 @@ int ad_sd_calibrate_all(struct ad_sigma_delta *sigma_delta, int ad_sd_init(struct ad_sigma_delta *sigma_delta, struct iio_dev *indio_dev, struct spi_device *spi, const struct ad_sigma_delta_info *info); -int ad_sd_setup_buffer_and_trigger(struct iio_dev *indio_dev); -void ad_sd_cleanup_buffer_and_trigger(struct iio_dev *indio_dev); - int devm_ad_sd_setup_buffer_and_trigger(struct device *dev, struct iio_dev *indio_dev); int ad_sd_validate_trigger(struct iio_dev *indio_dev, struct iio_trigger *trig); -- 2.31.1