Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp394477pxy; Sat, 31 Jul 2021 10:40:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1BFCBoT463Fz36nhiQDSgRSkYwtWL5v/lGltfMAxapey05qJh0rSuNpjnxubq4L7vMTzx X-Received: by 2002:a17:906:546:: with SMTP id k6mr8288651eja.53.1627753246750; Sat, 31 Jul 2021 10:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627753246; cv=none; d=google.com; s=arc-20160816; b=f4wsB7WJDquV1d5qLpPRquLYQBrQszQAyfK37ypyDdZDLhOuSllRaCapvtUKVOln0V BBDuIJRPq5B6KQ7mqP67FZTRyOgyvB/MYR3hH5vm5oa6vgbVkE0oUDboZfhe01KLhOjx 83kchLm+5WjUGDpf+1DlsEmtUnnDyche5Vgezh9/BCDh155DoQL4/Q/SUAYx7TThCCBc 4e5cO5baNfVciyLwlvS3SPhAiKK88b4eATDcFBwTSTg/Gwadt+QYexJedFlHfdBOQTgl N7OUH1CgmPRjzbrppTZDD+NCfMXUzLx8cnAGcnrQyD2Xg78/fxVr3gIkV5OI98KRBsHb nIPg== 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=2f9wr7maJ1WJqd8/qjThcTvzPXPkOALeUZSdSyysZi8=; b=1Ko3UgF/Vwj7zOMFhWk2IbVWfCo/5iVj2/EZuxxWwoNJm77UiqMxspgRyvKliz6EQe sIGQWCcdrBkkuamkFBvOverVLxdhuzZRL0tSWycEQcqnw2nX0Blsw5NuZiP4+DTMSIS4 6obGJNs3Yk31uv+BiU56teL7yR+MP1QQrpJcCun8SL0zQzcDPsAaurkOL/91RzhVS0hk ocod1W9Tld0cgQk2VYr9i5uS20Z7nJgqUtPcJnifXClXV+huLykmvcWZQ6QnSqD5XRXt 6NsK9cmNeQ1l5Gx1LScrqqJVEWeCO8VwEQIVLA/DqW7umviYRE5RBM74dJxI/mxvqEmI kvbA== 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 r7si4949903edh.441.2021.07.31.10.40.22; Sat, 31 Jul 2021 10:40:46 -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 S231205AbhGaRhx (ORCPT + 99 others); Sat, 31 Jul 2021 13:37:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:46256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbhGaRhx (ORCPT ); Sat, 31 Jul 2021 13:37:53 -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 AF4C860EE6; Sat, 31 Jul 2021 17:37:45 +0000 (UTC) Date: Sat, 31 Jul 2021 18:40:24 +0100 From: Jonathan Cameron To: Alexandru Ardelean Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, denis.ciocca@st.com Subject: Re: [PATCH 0/4] iio: st_sensors: convert probe functions to full devm Message-ID: <20210731184024.454ad962@jic23-huawei> In-Reply-To: <20210726071404.14529-1-aardelean@deviqon.com> References: <20210726071404.14529-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, 26 Jul 2021 10:14:00 +0300 Alexandru Ardelean wrote: > Continuing from series: > https://lore.kernel.org/linux-iio/20210720074642.223293-1-aardelean@deviqon.com/ > > This goes a little further and converts all ST drivers using the st_common > bits to devm functions. > As mentioned by Jonathan, the devm unwind is often attached to > iio_dev->dev.parent, and something it's attached to some other pointer > which references the same device object. > > In the last patch, that point is removed, to eliminate doubt about this > mix-n-match. > An alternative would be an assert/check somewhere to ensure that > 'iio_dev->dev.parent == adata->dev'. But I [personally] don't like it that > much. > > As mentioned previously, I was also thinking of sending this set with the > previous one. But I am usually reserved to send large sets; also, because I > don't really like to review large sets [when I'm reviewing other people's > code]. I'm fine with this, though I would like the reorder pulled out as as separate patch and moved to the front of the series. It's a good change in it's own right and will also make the rest of the series more 'obviously' correct as you'll always be stripping off the last thing done in remove. Otherwise, needs some time for others to take a look. thanks, Jonathan > > Alexandru Ardelean (4): > iio: st_sensors: remove st_sensors_deallocate_trigger() function > iio: st_sensors: remove st_sensors_power_disable() function > iio: st_sensors: remove all driver remove functions > iio: st_sensors: remove reference to parent device object on > st_sensor_data > > drivers/iio/accel/st_accel_core.c | 32 +++-------- > drivers/iio/accel/st_accel_i2c.c | 23 +------- > drivers/iio/accel/st_accel_spi.c | 23 +------- > .../iio/common/st_sensors/st_sensors_core.c | 34 ++++++------ > .../iio/common/st_sensors/st_sensors_i2c.c | 1 - > .../iio/common/st_sensors/st_sensors_spi.c | 1 - > .../common/st_sensors/st_sensors_trigger.c | 53 +++++++------------ > drivers/iio/gyro/st_gyro_core.c | 27 ++-------- > drivers/iio/gyro/st_gyro_i2c.c | 23 +------- > drivers/iio/gyro/st_gyro_spi.c | 23 +------- > drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h | 1 - > drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 17 +----- > drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 6 --- > drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 6 --- > drivers/iio/magnetometer/st_magn_core.c | 29 ++-------- > drivers/iio/magnetometer/st_magn_i2c.c | 23 +------- > drivers/iio/magnetometer/st_magn_spi.c | 23 +------- > drivers/iio/pressure/st_pressure_core.c | 27 ++-------- > drivers/iio/pressure/st_pressure_i2c.c | 23 +------- > drivers/iio/pressure/st_pressure_spi.c | 23 +------- > include/linux/iio/common/st_sensors.h | 13 ----- > 21 files changed, 60 insertions(+), 371 deletions(-) >