From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 524213955CD for ; Wed, 12 Aug 2026 16:44:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786553092; cv=none; b=AzZ5LH4I2qn6xIGuQsq0AqN6Z2gmnArjwT8+wAcqde+Hlqy3yrYUIQmn7+Pmy+DTiFhW1taDvUKAsrDVYCz7AINHQoxcrGFcOoOKl0sjYeGDy9ZeR8Pjqddc8zAHTlAjFHKuj1PMkRnoHQS7Pd9YiHyb1ogdmkf4ZXPzJagCcOM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786553092; c=relaxed/simple; bh=OMdEa+eiE2MKqUHH8XXBut0ICYi8AxN+pkOMvV/Vj1o=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ZhnYcfo6iBEN5etBNq0+TUtf84fABgO+w33ycSHnkQVRhIbimDVM8rCW9R1mlGn1Xk4wOfvaQ+7F5qFVYr5FpqC7JJE8c46xs7V5V/+L/EkO8FsPYAZ5lHD/xvV2A4SKpm/sQQJb+Ba/Fp+kphkUg1MC0BT+UBTSfpjmz4Y4E+U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jPBSu4Zd; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jPBSu4Zd" Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-ca97d139d8dso775097a12.2 for ; Wed, 12 Aug 2026 09:44:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786553089; x=1787157889; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=4Vgp03XD4TAR6Veh5Nvw5ei2/BjzAgfusQS5tUaaQiw=; b=jPBSu4ZdV0paiTH/RFzLyHIqC1G4HWaoP7EABn3YzjcqfqblqFPd+FABWX4KQBUbJu ihzP4AC6/IoD02BEPw/GFCB31z0KJVP8M+WSPMdUXI/ZDIxTQrjSXD/5uhrfnRDXTG9J 6j7uC8IB+VvXpluaFeKw9uFTv4SvyurwgSfyGbooYTcfg9xwmsg+a440IkG4Ozmp7Y3I Ey5/2DezAsFqnYFPctfV4/0kiTsfPpB4U/VBdsn5khzivZZ2q3pPqtoefEyRBScUsPbL A5XAakK9dE2+nxiX4ruBWREVexDuqz+8hHqy4ipFIGtQv42gONgq8VsNwQysQ8LWb/mm ngIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786553089; x=1787157889; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=4Vgp03XD4TAR6Veh5Nvw5ei2/BjzAgfusQS5tUaaQiw=; b=mEW+XmxWKXG7R+5VhKIV+X5OWe5mk/oCd8jl0BRGChSw3k8c969qFcEsmjOyw+k2B5 k/KtVbxIhldTqVcFrlGefgd2VKo7tna3/ND2Fs4ubaW37mRMF01kxNvsP4HyYi0RdudD Fvn5/igny1QBYwv8zJWiMYMA1p7ODmCpMPqTASANe2DEWI08RwsyYwZLBs9L0NR3OhUR mRZaQdNMMQducyJeLOqeRsZces6CecuzWA7LCkf3/45nBFkC6zCrmDpZJcVWvXV3tk1Y BjCzNVcZd7kQfMpLfE5uyjLuogvJqOkaWwPMY/4hjDe+mlxxooa7oyShcXtnldZyfLiM 8gdg== X-Forwarded-Encrypted: i=1; AHgh+Rp0GZ8sOhEpQaXihgvKULtywdRbWtUBPupWRcUbfVQgkcoQyAJRjEKwmnQOZCw9+KyS7Zr22000x+gwb9s=@vger.kernel.org X-Gm-Message-State: AOJu0YzFAMCSC/YfZjEVIvO2A+z8ju/hJ9azRZdL2/hBFZlBvOOIPwYa Q6n+5cQDQbypknUhOink/F3WLYOfe2VoRzv/BPy+7aNhYqA9qTZVVnAy X-Gm-Gg: AR+sD13dlkS3mw6oukXA7q7Q0qse38sPeWRSmgU+8ziZDwyhUZa/RLigQ2ewqhtL9Z4 F//XngU31kUypqvOG/JNDrJNDivB0qbMlEkeqhYJ5+uyJhBKzai2v4ISHmDPr4jHlPPB/wgUWTc HC2bdZN4+YHX/4MP02g6o5Obn/mZMwNkIiUDUuv93AKRq5ZUfieB+TvE8hbvtX8Xs2drTLfyuz1 WfL/zD3+mqrjW/BvFv+PWdg40xkV512N6DmikPQqCifPZATV5IlOJaYq8SAK2GTR2QzME6UfFHL NRo1QQfhCsu/8CpUFxB7EeCv48gzjdZ+vXcfJkp9VEVQgMxFhXdIZn5+IP4UEDCbQMdTTqiLdSN 3B3eCD9yWgHXPmlpdCEPSWwXjfwJNQaumivXfYuCVB1fsQI4W8reSPUJLAwjK8b/fCnBRyW8+3e bC9/ZSn/plRpZfm0E72/5o0FgeEvcCERa2gZb42EMD/yCCmOH2zjE5S5ouObNc2c/KZInOgm11a L3uxCvzoqkG2Yl/tHK/f2qMjzrLIDQ4jmw= X-Received: by 2002:a05:6a20:729c:b0:3bf:6d96:ac40 with SMTP id adf61e73a8af0-3cc3f5d3760mr7260641637.12.1786553089218; Wed, 12 Aug 2026 09:44:49 -0700 (PDT) Received: from debian.ari ([47.30.26.35]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-31cf40f7151sm12462621eec.12.2026.08.12.09.44.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 09:44:48 -0700 (PDT) From: Archit Anant To: jic23@kernel.org Cc: dlechner@baylibre.com, andy@kernel.org, nuno.sa@analog.com, u.kleine-koenig@baylibre.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Archit Anant Subject: [PATCH v3 0/8] iio: adc: ti-ads1015: modernize resource management Date: Wed, 12 Aug 2026 22:14:25 +0530 Message-Id: <20260812164433.23011-1-architanant5@gmail.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series modernizes the ti-ads1015 by transitioning it to a fully devm_ architecture. By moving resource allocation, device registration, and runtime power management to the devm_ infrastructure, the teardown sequence is now guaranteed to execute safely in the reverse order of initialization. This allows for the complete removal of the ads1015_remove() function, eliminating boilerplate code and reducing the risk of future resource leaks. Also the driver's configuration logic has been updated to use the modern FIELD_PREP() and FIELD_GET() macros, allowing the removal of all custom _SHIFT macros and a redundant helper function. Additionally, housekeeping patches are included to ensure header includes remain alphabetically sorted, dev_err_probe() is used consistently, and PM macros are updated to modern standards. Changes in v3: - Added Patch 7 to replace all custom _SHIFT macros with FIELD_PREP and FIELD_GET as requested by Jonathan Cameron. - Added Patch 8 to inline ads1015_set_conv_mode() directly at call sites, allowing for the removal of the final _SHIFT macro. Changes in v2: - Split the monolithic v1 patch into a 6-patch series to isolate housekeeping, bug fixes, and API modernizations for easier review and backporting. - Patch 1: Added to modernize PM ops and remove #ifdef CONFIG_PM. - Patch 2: Added to fix a pre-existing PM leak on probe failure identified by Jonathan Cameron. - Patch 3: Extracted header sorting into a prerequisite patch. - Patch 4 & 5: Extracted the introduction of the local 'dev' pointer and dev_err_probe() conversions, suggested by Jonathan Cameron. - Patch 6: Now contains only the devm_ conversions and the removal of ads1015_remove(). Archit Anant (8): iio: adc: ti-ads1015: use DEFINE_RUNTIME_DEV_PM_OPS() iio: adc: ti-ads1015: fix PM leak on probe failure iio: adc: ti-ads1015: sort headers alphabetically iio: adc: ti-ads1015: use local device pointer in probe iio: adc: ti-ads1015: use dev_err_probe() for error handling iio: adc: ti-ads1015: convert to fully managed resources iio: adc: ti-ads1015: replace custom shift macros with FIELD_PREP/GET iio: adc: ti-ads1015: inline ads1015_set_conv_mode() drivers/iio/adc/ti-ads1015.c | 176 ++++++++++++++++------------------- 1 file changed, 81 insertions(+), 95 deletions(-) -- 2.39.5