Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp913892pxb; Sat, 18 Sep 2021 23:56:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym1LTjdWuLptVl56WMS8GjYFQLQAoBURvM0j2YuAy50FZI77EM5Xe2qMnZA1/3Y5b20X/r X-Received: by 2002:a5d:9247:: with SMTP id e7mr14744311iol.161.1632034584705; Sat, 18 Sep 2021 23:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632034584; cv=none; d=google.com; s=arc-20160816; b=eqnI9lIxLRzVyp8wcSEhMh2a/uhLQ+4ZL4ZaLfbX3HaW4QTuouR4fbbJOHRPdA0i1r tJfJKZIk40IqzBrOR0GGzBvGa0fB1pIb4BJTavriT7myaAxxPyqqg2DoivdMJvf31jmP b07T6rICilpCAbHoqNxmYLnFD7wzCVjG1sxjh5rwxS8icwSaW/DzRDdA3S5HmA27MevF Ivm5BAv8IPk73ND+AcNqSU2GUloFVx5wLUZdTpZ2+/Gg3DEb/tFDQgHV0ZQRc0A0ZyTh iLZrmNDDbYFK68TJpKM0vyR9TX6whVPJPcJZX2E2Y0mrWEjqZ2WMzuz7OGdZRGJXyNIu FRjA== 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=CoXp4cqHN3MQRQykFmOST+xuMRWWVxwB5us5cUTwrpI=; b=IX7khOLMvVHvDaSH3AylMXI3TFYPv3A67mk5yYztIl/EWPp+hOt6jYKgn6YF+509aj t3wLOtfblH5rbQ17euu+cNIHEaxh6t39vgsGJlzS9i5nhAYSJlaBlvuzbenPIRxIZKix uc6Ct2itpSqo6ky7lR8cTk6LMnzJfwV+IIOF+cfZZAzT82p40iEPAER55WHq6hLQ/KOe 0JSgSzyE4hwO8nCmPbSa7IegaEOpUnqFbJ9BXlp8P/Kp2a8l39NuW5yantVdvtUNg6Ig KrQhB10wQHJE7Gv0cdKlTv6qNEnslfwQEsMjAjJubMZfMO3RKCyp2lzFRTOqTBa9vKcY 6cDg== 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 p6si13825570jag.18.2021.09.18.23.56.14; Sat, 18 Sep 2021 23:56:24 -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 S240115AbhIRSGU (ORCPT + 99 others); Sat, 18 Sep 2021 14:06:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:57562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238237AbhIRSGU (ORCPT ); Sat, 18 Sep 2021 14:06:20 -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 8154461100; Sat, 18 Sep 2021 18:04:55 +0000 (UTC) Date: Sat, 18 Sep 2021 19:08:34 +0100 From: Jonathan Cameron To: Alexandru Ardelean Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Subject: Re: [PATCH] iio: light: max44000: use device-managed functions in probe Message-ID: <20210918190834.66d6fbce@jic23-huawei> In-Reply-To: <20210913120002.306280-1-aardelean@deviqon.com> References: <20210913120002.306280-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 15:00:02 +0300 Alexandru Ardelean wrote: > This is a simple conversion. Both iio_device_register() and > iio_triggered_buffer_setup() functions have device-managed variants. > > Signed-off-by: Alexandru Ardelean Applied to the togreg branch of iio.git and pushed out as testing as per normal. Thanks, Jonathan > --- > drivers/iio/light/max44000.c | 17 +++-------------- > 1 file changed, 3 insertions(+), 14 deletions(-) > > diff --git a/drivers/iio/light/max44000.c b/drivers/iio/light/max44000.c > index b8e721bced5b..85689dffbcbf 100644 > --- a/drivers/iio/light/max44000.c > +++ b/drivers/iio/light/max44000.c > @@ -540,7 +540,6 @@ static int max44000_probe(struct i2c_client *client, > return PTR_ERR(data->regmap); > } > > - i2c_set_clientdata(client, indio_dev); > mutex_init(&data->lock); > indio_dev->info = &max44000_info; > indio_dev->name = MAX44000_DRV_NAME; > @@ -589,23 +588,14 @@ static int max44000_probe(struct i2c_client *client, > return ret; > } > > - ret = iio_triggered_buffer_setup(indio_dev, NULL, max44000_trigger_handler, NULL); > + ret = devm_iio_triggered_buffer_setup(&client->dev, indio_dev, NULL, > + max44000_trigger_handler, NULL); > if (ret < 0) { > dev_err(&client->dev, "iio triggered buffer setup failed\n"); > return ret; > } > > - return iio_device_register(indio_dev); > -} > - > -static int max44000_remove(struct i2c_client *client) > -{ > - struct iio_dev *indio_dev = i2c_get_clientdata(client); > - > - iio_device_unregister(indio_dev); > - iio_triggered_buffer_cleanup(indio_dev); > - > - return 0; > + return devm_iio_device_register(&client->dev, indio_dev); > } > > static const struct i2c_device_id max44000_id[] = { > @@ -628,7 +618,6 @@ static struct i2c_driver max44000_driver = { > .acpi_match_table = ACPI_PTR(max44000_acpi_match), > }, > .probe = max44000_probe, > - .remove = max44000_remove, > .id_table = max44000_id, > }; >