Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3295937pxv; Mon, 26 Jul 2021 00:15:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHp8sLBjkTy6ku38RSbtrYdYv1/tTUgImzw+Cce21HgEdjCMoMP0lKzMLcL3dwvtfQGVJQ X-Received: by 2002:a02:331e:: with SMTP id c30mr15207117jae.94.1627283703494; Mon, 26 Jul 2021 00:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627283703; cv=none; d=google.com; s=arc-20160816; b=l1TxWyCWBJ+OgKSP68fB+v7oJVC2ge7zdCw+yvYNI+LpPwAYD2dOEWiTPkVwhV/QBX /385SHVyyb/KNRnv/CpKs0jitKOmXIv0OsJpTmXxP2Lwe+OTvmZ+3+ldo2EKOGfXfZ1c s1r8QvQlG5Yp6diOv8m1LQ4MwhdGaSjIATWARmjLB+3Htpfb05+rCp1gTEqR4t41HazJ Xhpx41oEyMr3fjPyGKhuKd3g+sa8SuSdrc+Wh11tkIsnmReCq9UmjcMO/FZ0qUG5Xdcg 6LSOBESfQ2szrbvQzFiUDU/2Epm2A4/X4dysQg63CxfSQx35dO+IFHrTMNeuafFtEFGF FakA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=1+qLKSiIn7HNMf6/bTQMR2K4OTHRd9f7CQlxNuufkvY=; b=wBCrf/4N7T5z/WT9dWu3p9RpolYhS7BZUVjGO8MtqhvGpFt/dy6TUpg0sNvwHWHpCb LjaPtMjL4RZhZp9/4guDICl/PsNJex1C4/1yhioCNH2zpzTKi93L3jKtKTVDLENHc1CK tdqd1UcYzgcs117y/0pjnLOFShaAxVg87n4huF+qzc/52H+4CMwHkcf77w6J2/eDAKUj aCd7MmRYYKeizmBNokaIR1UW69Zfg8vLksr6/jawsKmJPwuGXqmpvtfiVBiunw8InczH gsPO8+GyKCrF4sPyHb19iSweKlLYt0Y2km3CTrnx0UgQKBLcuF3xM92ap+xkUFpeFiJN CIzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=OCatUbQg; 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=deviqon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si44880143ion.69.2021.07.26.00.14.51; Mon, 26 Jul 2021 00:15: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; dkim=pass header.i=@deviqon.com header.s=google header.b=OCatUbQg; 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=deviqon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231785AbhGZGdk (ORCPT + 99 others); Mon, 26 Jul 2021 02:33:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231707AbhGZGdk (ORCPT ); Mon, 26 Jul 2021 02:33:40 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28206C061757 for ; Mon, 26 Jul 2021 00:14:09 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id go31so1172917ejc.6 for ; Mon, 26 Jul 2021 00:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deviqon.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1+qLKSiIn7HNMf6/bTQMR2K4OTHRd9f7CQlxNuufkvY=; b=OCatUbQgWGAWcsrCHABpdl78tzlAWqGos/HhsOUNhWsGIWWuPdY6tZ9Jv0UivBtUO5 fqPXGHHWhIP/FjmaaXrL8CuBK9vQ8yEMzzRHy1NjilHWOmPYS8gvceB2Dx3PwT/3VoXH zKRVPsy1hkrBxsyu2BxaZVPZXpwqooHTUSi8lVnmgS76V4zfbXzT4YsQxmiHKc8lHC4x zKDczljKTbshKSNYFC2iNXAs9qzfz9k4SQy1C8x5qHOVRSKMCWZm217ceMVTpCV9dlfz nxVxNYg12flYjwbe+uv5ikU0E7vhTMERkJOSHvSdHvT5cFOhpIT0EFSh2H96Pw670kta p83Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1+qLKSiIn7HNMf6/bTQMR2K4OTHRd9f7CQlxNuufkvY=; b=RyMe7It8FBBHfVBA0BQ4RcAecSFLb3QHYTedU3R5vNrS9OguhTU+7ohXyyIEzEeum1 yrOiqZP0C4re64NBPEIp6EdsywXAL/18PLce8FDfDo/Z4DZ++pJVEZAaavis0AmrtddQ 8gvTfco4djRVlnhkvWP6gSyTn39lJoVi7rNJYutZtBfC1ngCJruyGgyM2Rk8UwJ/V/fu 3We+ZeACAqPFdYT2q75LfqZ4N5JoYBiPUJ+SX+mJy1DHLe8LVRfJ4KmbTS9tQqiaqM+D Cd9yt04RCClZr/14W3zi15RncxkGQqIp+8/KWCEskZ04dtnVhUC0E6biX2druIjJhKWr WE9w== X-Gm-Message-State: AOAM533Icap6l+lD+9hVpK9CZ7ldnTc1Pwh8xWs5F68v51D4I1tLN9bQ qPSebYTWvkI6/KSp8vsfdevJ4w== X-Received: by 2002:a17:906:4f01:: with SMTP id t1mr7438109eju.388.1627283647775; Mon, 26 Jul 2021 00:14:07 -0700 (PDT) Received: from neptune.. ([5.2.193.191]) by smtp.gmail.com with ESMTPSA id v13sm13863772ejh.62.2021.07.26.00.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 00:14:07 -0700 (PDT) From: Alexandru Ardelean To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: denis.ciocca@st.com, jic23@kernel.org, Alexandru Ardelean Subject: [PATCH 0/4] iio: st_sensors: convert probe functions to full devm Date: Mon, 26 Jul 2021 10:14:00 +0300 Message-Id: <20210726071404.14529-1-aardelean@deviqon.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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]. 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(-) -- 2.31.1