Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1724954pxj; Sun, 16 May 2021 02:09:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfqvNLN0bKueYxiC5uR1ke6qKBpRjz2UEqmKdOWmn+cY6CzAhdwVabAlfVd7VNWlUJlqP5 X-Received: by 2002:aa7:d607:: with SMTP id c7mr17167736edr.255.1621156143262; Sun, 16 May 2021 02:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621156143; cv=none; d=google.com; s=arc-20160816; b=nt3D5OCveB0qjoGHu9LqEEU0geyhOd1N/3GWSgKwVzLrAFx8OPuKTLQcJHQXxc3/O4 VvbiEGTrPu9vyLZMVbdgoJNyIw9Y2IrH/SeqVk+37eT38RHLrJ+vusfr3R4e6XEjXwjm 8qI1zOY2aTIiv0m70Drhe51Undq68NsjmM9K2ABmC6P4Jo6Q96YBQ4DNb1bFntSV/Uxc xjBuVXk49Il6XOPFVojMRyfR5ZrLPIiNSz2UUzAwr1b/VgcQjHknLCMk4Lte+pNRL1qM u9W/W5VEJ882sd3ACaPRyZNLBp6pZh44ksVGjH6bMO39tWWwTDrrPLQfhqqcX0Ns+//X khYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=W+jXA8BLzt3r1bMEde/rsSzVo1cBdcViDy3vtDM4FvM=; b=i7Cbi+p9iSfz03AGKP655GL4uDDaCsXlpCLGnekBmKeXOXVj1kHe8iRSNTnSD9BPh3 V8qUKGm0FJ70WZAvQ2vcTyLTN4buyWse/QThs9wMf/KKouHb2tf1pfcgAsxRdrBf2IEa /dGQg8Neik+H2yHyYmczpTo7XWu7govucc5ZKVnLxG7mPbBWNGax8+PU8zkbN6A3QtkR k5/f48HxfoHdaiwL/3T+Uyml+3jsp8/OOkrVujWwCga9peplfzMfPwP1p+lX4D4VJ1Oy 0pGVZs9+B/3/MRKq0XbCzOgdQ5bRCSgvXJo+rdY857wGs42eUaJw0h8yuWFlA2rKv9ET iUvw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zg9si12487179ejb.436.2021.05.16.02.08.40; Sun, 16 May 2021 02:09:03 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234765AbhEOTxk (ORCPT + 99 others); Sat, 15 May 2021 15:53:40 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:50850 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231334AbhEOTxi (ORCPT ); Sat, 15 May 2021 15:53:38 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id B62D41C0B81; Sat, 15 May 2021 21:52:21 +0200 (CEST) Date: Sat, 15 May 2021 21:52:21 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jonathan Cameron , Michael Hennerich , Alexandru Ardelean Subject: Re: [PATCH 5.10 036/530] iio:adc:ad7476: Fix remove handling Message-ID: <20210515195221.GA4103@amd> References: <20210512144819.664462530@linuxfoundation.org> <20210512144820.931257479@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline In-Reply-To: <20210512144820.931257479@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! >=20 > commit 6baee4bd63f5fdf1716f88e95c21a683e94fe30d upstream. >=20 > 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. I don't think this is correct: > --- 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); > =20 > - ret =3D iio_triggered_buffer_setup(indio_dev, NULL, > - &ad7476_trigger_handler, NULL); > + ret =3D devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, NULL, > + &ad7476_trigger_handler, NULL); > if (ret) > - goto error_disable_reg; > + return ret; > =20 > if (st->chip_info->reset) > st->chip_info->reset(st); > =20 > - ret =3D 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); > - Regulator_disable is now removed, but we still use regulator_enable, and we still need to keep it balanced. > - return ret; > + return devm_iio_device_register(&spi->dev, indio_dev); > } Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmCgJnUACgkQMOfwapXb+vIgIACeNJBbhxFmGCays2US+k3vdn3b OYkAnjoBQ4ogsSqWiYx0GGd1moQXFtDQ =XCF+ -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA--