Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3508428pxf; Mon, 29 Mar 2021 04:21:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUtn3XWHhdSp0c2KIHjckFOR+gpW9XrV/BbSFrVScqhHfkQGcQRmMzRGneumyahnu/9aP6 X-Received: by 2002:a17:906:6d01:: with SMTP id m1mr18205209ejr.501.1617016875825; Mon, 29 Mar 2021 04:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617016875; cv=none; d=google.com; s=arc-20160816; b=dyBy7VoUba4ACPts52nIoG+58h+C08qDVQyL0Woc++JHbOpIpxH76vdkhen+CcMRK7 e8wvXtaExElpz5CPWRWjzoMx0DRvlbP9KzhPNWU9dzYQFHzifpA+x9sMx31pDS3gl1WP Gmla4rjofe/r62INjBGaN1FkPRf77CJyxJfeZ5yMVcd2qVO1RW7IDMJ/zDxB6t5Ioul2 mTOW0QyBHrqxMk+ljbnmA9a5NXgBuq9j8GwgMATWEE8tYhTw8m3od9qux+kHl86n8Ykq GZKCSPmDsnXOYv9nNOmI8GJxSIN5zE2ACJDKngxWO8WP6uxKNfnU2Z9Njg7/YUBrUobR pwDQ== 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:subject:cc:to:from:date; bh=Kr+N+ytaO6pDrGMyKilMr/g/ahoIX+v41kYrcHY6t18=; b=YWccoS5Im5vSsHCtTTEeG9BcjiRAda7qOH3mFTAAmM4WHYMY4LQ0Jy7z2csvoTBL8i nS8x0WFgrM1wAKIjFLntDQdpUEDMS5mkkFVujRvEGPbm71rRrSEu2WJh2a7EjAUo07Bi Ni3WbyQQezXTtVJm51qM+3j+ZlNEDkgqjIxluEfimFb+z+tU5KCjwtUl360o07wl5Hiu RNQcbx7IPCKPpimliVKwj+FILH10geMtS4JkqKaqIBcgnDGlWs3WpeqXewQX/COoGM6I dClRVHvtALTph2aVzLf2xoJnm8p2zrkKMDVjxaLuWDBSJs+nSlBWpY6FkKVVd4pPYrkQ eHTQ== 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; 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 qu2si12656242ejb.373.2021.03.29.04.20.53; Mon, 29 Mar 2021 04:21:15 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232754AbhC2LTH (ORCPT + 99 others); Mon, 29 Mar 2021 07:19:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:53582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231941AbhC2LSv (ORCPT ); Mon, 29 Mar 2021 07:18:51 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AF18761554; Mon, 29 Mar 2021 11:18:49 +0000 (UTC) Date: Mon, 29 Mar 2021 12:18:56 +0100 From: Jonathan Cameron To: Lars-Peter Clausen Cc: Lucas Stankus , Michael.Hennerich@analog.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] iio: adc: ad7923: register device with devm_iio_device_register Message-ID: <20210329121856.0327b9a4@jic23-huawei> In-Reply-To: <1548d948-bd01-a8db-6ecc-720bb7ca73a9@metafoo.de> References: <1548d948-bd01-a8db-6ecc-720bb7ca73a9@metafoo.de> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 29 Mar 2021 09:06:14 +0200 Lars-Peter Clausen wrote: > On 3/28/21 11:46 PM, Lucas Stankus wrote: > > Registers the device using the devm variant. > > This is the final step of converting the ad7923 to only use devm routines, > > meaning that the ad7923_remove() function is no longer needed to release > > resources on device detach. > > > > Signed-off-by: Lucas Stankus > > Hi, > > Thanks for the patches.T his looks good, just one small comment. On basis of saving everyone time, I've fixed up the comment from Lars below whilst applying. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to see if they can find anything we missed. Thanks, Jonathan > > > --- > > drivers/iio/adc/ad7923.c | 12 +----------- > > 1 file changed, 1 insertion(+), 11 deletions(-) > > > > diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c > > index d07eaf3111ed..f7af2f194789 100644 > > --- a/drivers/iio/adc/ad7923.c > > +++ b/drivers/iio/adc/ad7923.c > > @@ -356,16 +356,7 @@ static int ad7923_probe(struct spi_device *spi) > > if (ret) > > return ret; > > > > - return iio_device_register(indio_dev); > > -} > > - > > -static int ad7923_remove(struct spi_device *spi) > > -{ > > - struct iio_dev *indio_dev = spi_get_drvdata(spi); > > This removes the last user of get_drvdata() on the SPI device. This means you > can also remove the spi_set_drvdata() in the probe function. > > > - > > - iio_device_unregister(indio_dev); > > - > > - return 0; > > + return devm_iio_device_register(&spi->dev, indio_dev); > > }