Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4581400pxj; Wed, 12 May 2021 08:37:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvSM5WueNuUzmhRJ/JhBtNyHcMN522R9WMqZXgg+AMbkjEJawibbWEPfL9eGcfKznH/SZU X-Received: by 2002:a17:906:f283:: with SMTP id gu3mr38001851ejb.91.1620833848441; Wed, 12 May 2021 08:37:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620833848; cv=none; d=google.com; s=arc-20160816; b=bSHpGxak2m0/fdZ0JFEcu4WQiHGucmHCVMUQmapv2WDkdzf5hrHUC+k2FDoUwhCXEJ 6iO7OiWxNuOTp7Kf5LrQlP7OjrvuGB6/7vpB2BJ6SMooKgGWc/a7+Yq7tshNchVpBuRf W2Uj3HI7i7WYAWTvw7qzci6BL3oX7qqpytE9FHxRrLWDgktvTFCngTmdaKW1VVvGIon1 kSV8fcNmi2ca/cZkbPWwJJsNTddk2k9JhlARE6Tt/uvlqMAXlcenMyQWumKbd/YC/ZIy eq6aHF6GEKQWsuvZakMN0G7aVhUb6TtniZMdnqtLDvsPFVFOFiV4jliBxBZrzl4qJjoV c8cg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=E90w+ypnlxYQ2Ehd0TEvvL4Pl8Xxa7qrKy117fEOdpU=; b=zQtwWh3TWS5HTZQy1ENejoeW0U7RyY7sCqUqHAcHpZqmb8ERM+lpgKsBgljC6SXjhJ ZM7+Gs0EQVD7dLaEKHZvZQnqtMV0r5u0r7GDXLiHYF+uEiZVxcexMxB1/A5xdo1LS+65 +CNXzEhyU0/lzRReB/e36WhtZVTet7/XVxqx/8i+tPfdnvvWr7ZKs++q92IFrbz12Cbu lcQ9ZmUETHvuvWGGEUyJVjFJNlNUuiZ0rk5hmNxy9gpx32lfePj91U5JlKeNXc80U7LR N6aws7lrs20GwsjmPtY6XaWUXxAQfMMpjYaDxFC+vbUlWBf5nW8LONSWecYZ0oifzmEF IkoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y3eGTuL6; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a9si254891ejt.117.2021.05.12.08.36.54; Wed, 12 May 2021 08:37:28 -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=@linuxfoundation.org header.s=korg header.b=Y3eGTuL6; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234561AbhELPdM (ORCPT + 99 others); Wed, 12 May 2021 11:33:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:50812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233974AbhELPPv (ORCPT ); Wed, 12 May 2021 11:15:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E6ECF61943; Wed, 12 May 2021 15:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620831925; bh=B5Eco/c8L9SzFnYodt52q0nVjjincIn6qbhxraeFXaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y3eGTuL6CkkW2h8+29liUMANX84IzlZMuOrglcKjV4VU3XPjgIXhpR6uoqIGC0SxG eBHIyv9fTCOGdJSDii0rixe+YthPdk8Qg1p5Vc5KwucLA2LSDh80hQsuw2/UZNZRD/ T5SbABwmREONw/mG8DUSgg5Em98oR5RUkiO5Hd8A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Michael Hennerich , Alexandru Ardelean , Stable@vger.kernel.org Subject: [PATCH 5.10 036/530] iio:adc:ad7476: Fix remove handling Date: Wed, 12 May 2021 16:42:26 +0200 Message-Id: <20210512144820.931257479@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Cameron commit 6baee4bd63f5fdf1716f88e95c21a683e94fe30d upstream. 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 basically finishes the job as a precursor to improving the regulator handling. Signed-off-by: Jonathan Cameron Fixes: 4bb2b8f94ace3 ("iio: adc: ad7476: implement devm_add_action_or_reset") Cc: Michael Hennerich Reviewed-by: Alexandru Ardelean Cc: Link: https://lore.kernel.org/r/20210401171759.318140-2-jic23@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/iio/adc/ad7476.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) --- a/drivers/iio/adc/ad7476.c +++ b/drivers/iio/adc/ad7476.c @@ -316,25 +316,15 @@ static int ad7476_probe(struct spi_devic 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[] = {