Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp913703pxb; Sat, 18 Sep 2021 23:55:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNtHo7EqVA/3T6YS2gf+LzR2rrDkKkBPZAIRs9bt8/tq/fpLH7Cg3XiSB/GB51w1bLB2/J X-Received: by 2002:a05:6e02:1a68:: with SMTP id w8mr12036334ilv.78.1632034557008; Sat, 18 Sep 2021 23:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632034557; cv=none; d=google.com; s=arc-20160816; b=BHwj44qKo1nbmYNJXGADvJ5WevpeacwAgzG8ixvMtRjKuX0qj8AOIvJJtc2kVLaMPX 9a75EyXa7bnqM75gFjlMi67Ye320n8H50V34lH7+AuOTRAKf9MS+zjFTc+M5m9mLwlCO CqkE3OQv0nG39wyPtplJrgHND1eTc8HZghxte+8CJ/QsJ0Bha16j2XJJHoKOOU67xjOS MNUNOGow3yx6vFL6gSvSrO+v//nofnJ/c2tsjSC0RPh8mifdO+BuXXMc46n1SQ9BqvW9 Av90RqW+6jJVk916ECDEfUBo7C9AT+KGnYqj29kkgVy8zVo1z/0/Y263XquRgIBLQEvP ZkZA== 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=QRkbIwuYQM0tEdBqxv6lc06WJJHdBxNi4h+zEAXUx3E=; b=ro9aqcD8zTK6GVlfdIZX2FRAlaiDdPexo2D9l5KRwsolinw7oGMuooFnX96qwnbK1p 4uxTn6szAWJsUoGk43m96Ccz6A7ov7k+DjAAreW/QK8Q88QQdioAZJs5sutUHZvPQGQF rjSVY2tfKicj6eXcGvCbJh71zTkFd4LXdp8Ir1Igy/QCiueFR9GMhWwxIqwlkpR+A1/7 881t89d9b+FEUcQ9Frpxc4iaw/MyRcu/TX3Qc5m58FGNDzBVo5Sk4PxQSP91ntTsBKjc mDlbCVqoI5XLtH7p0oenZvGSeuI7X1KnPPCnP5nV1pwdjcQGjV7QIRhNuGufrWCBCVj8 q3CQ== 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 x8si11121117iom.11.2021.09.18.23.55.45; Sat, 18 Sep 2021 23:55:56 -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 S240095AbhIRSFG (ORCPT + 99 others); Sat, 18 Sep 2021 14:05:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:57144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238237AbhIRSFG (ORCPT ); Sat, 18 Sep 2021 14:05:06 -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 78DC5610E9; Sat, 18 Sep 2021 18:03:41 +0000 (UTC) Date: Sat, 18 Sep 2021 19:07:21 +0100 From: Jonathan Cameron To: Alexandru Ardelean Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Subject: Re: [PATCH] iio: gyro: adis16080: use devm_iio_device_register() in probe Message-ID: <20210918190721.58d3aa44@jic23-huawei> In-Reply-To: <20210913115308.301877-1-aardelean@deviqon.com> References: <20210913115308.301877-1-aardelean@deviqon.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; 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, 13 Sep 2021 14:53:08 +0300 Alexandru Ardelean wrote: > There is nothing else that needs to be done for this driver. The remove > hook calls only the iio_device_unregister() hook. > > So this driver can use devm_iio_device_register() directly. > > Signed-off-by: Alexandru Ardelean huh? How did we end up with this one being so nearly done. I guess maybe it predates devm_iio_device_register()! Applied to the togreg branch of iio.git and pushed out as testing for 0-day to waste time testing it for us ;) Thanks, Jonathan > --- > drivers/iio/gyro/adis16080.c | 11 +---------- > 1 file changed, 1 insertion(+), 10 deletions(-) > > diff --git a/drivers/iio/gyro/adis16080.c b/drivers/iio/gyro/adis16080.c > index e2f4d943e220..acef59d822b1 100644 > --- a/drivers/iio/gyro/adis16080.c > +++ b/drivers/iio/gyro/adis16080.c > @@ -195,8 +195,6 @@ static int adis16080_probe(struct spi_device *spi) > if (!indio_dev) > return -ENOMEM; > st = iio_priv(indio_dev); > - /* this is only used for removal purposes */ > - spi_set_drvdata(spi, indio_dev); > > mutex_init(&st->lock); > > @@ -210,13 +208,7 @@ static int adis16080_probe(struct spi_device *spi) > indio_dev->info = &adis16080_info; > indio_dev->modes = INDIO_DIRECT_MODE; > > - return iio_device_register(indio_dev); > -} > - > -static int adis16080_remove(struct spi_device *spi) > -{ > - iio_device_unregister(spi_get_drvdata(spi)); > - return 0; > + return devm_iio_device_register(&spi->dev, indio_dev); > } > > static const struct spi_device_id adis16080_ids[] = { > @@ -231,7 +223,6 @@ static struct spi_driver adis16080_driver = { > .name = "adis16080", > }, > .probe = adis16080_probe, > - .remove = adis16080_remove, > .id_table = adis16080_ids, > }; > module_spi_driver(adis16080_driver);