From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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 6D4A44BC038 for ; Fri, 5 Jun 2026 09:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780650628; cv=none; b=bIJ+lsDkK1OBFbNgk1R7KHEpQocSgQ638Jws+4AXbI0jf26Ikdhy/ROfjXAHK63MFFzge/SkHXknG79rx+BE7K7Ggs6p8g5DSOSlEUJhDPK64vSa+pi69vErKwvztDQ3lHfVOzUapavu9Vm6+SlwCOY8kUE/8PBpEWk2qALSLVA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780650628; c=relaxed/simple; bh=cQOCyWEIALkdoLR3TrYUhtEyJOAoHDyTYq9GcxdQAAI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fgecZrceClGt07Wxxy3cUD6k8agqw6PIP1QVHxFzPbQw129MeNpGJBZwAbSrytb6VdH4NJcCcjPBdJPteMJnurG3cWVYFwh7wMiSbIrNNn34TRPVZYFl3KqFFq5E0CrTvv219egNwuNUZA7vRunh4jJzEzgTtijexeFXjxKecVw= 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=HuAmDL/N; arc=none smtp.client-ip=209.85.167.46 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="HuAmDL/N" Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-5aa68cd8dd3so1618714e87.0 for ; Fri, 05 Jun 2026 02:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780650626; x=1781255426; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=awNPDfMBLScbqNNAfmJZbvI6wRRhBZ6Yy/Wt1gz41bE=; b=HuAmDL/Ng3heZ0WZ1Re4JxpincnKp0EIFGD2wRz+K5BCF6eMofxxyrKV2aAf4NWGLY 7VCZ+vgu/REuenqOokTHZ7Uj4AgxDtcVHUrqaiKr3juOvXp92LM+7rAn16RH1Zb5v+f/ H8UiHQKW4iiDZYYr25q4ao+PfNEk8pJIw3NccGc8nnuknSXsKmt0aOE/CRICLC2vOxrG IAHbh/oV0al8wJTuFRQJOMzxBcj9APAV+kBT6qMaFRoKciBIL4+Sb7RVXAXVqOpbK/N7 UWrHCGNORC2Iqgn9snseqgMPJDKgMRAnyGWFIix5XtqCfXzgkF1cxaWFVGpq0HUkfZ7Q a0Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780650626; x=1781255426; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=awNPDfMBLScbqNNAfmJZbvI6wRRhBZ6Yy/Wt1gz41bE=; b=ePQ42eKyCOL90i/Nud09qgrrJGv03EK7iAA3Y4880u7wtU+Bs2tE0ow4wAHDusPhXT RIRuofNcNBoMDfNJiIA0hhx2++/XJQWb26WFlURNHy1rM6zC7pdDxEAnZYFDl2YQPGVl cnZNY+WN99Djf/2MI4rBNxjkFdfYY9UFdbOJ9OQtVgBZYs+lihS2xf6TJGnVA8VEW2i3 PuIBo+B7GPykF3I+SUBaMCqEySnflAau+jGsvwpe8YKKBl3HiJwO6SBHHL2236P2yD/a ep1QxvSu+g+PT19G9Lt5t+CAl0jMXrNzeVE+Cbrq1evxDMGDrDflFKNfIgsx4PqYClyQ DUCg== X-Forwarded-Encrypted: i=1; AFNElJ9MSn4EtNeExNyw2bTDACtSPkPNaTtGRPCvXV/PZ+ZUgfYqtuparFlufOg/kzQUqCcqz2l2VM4LOhkAI6g=@vger.kernel.org X-Gm-Message-State: AOJu0YxBDiKywGkBUrx01KBt90bbZpZKOKgwk2oRWzMnU+8yExplo8nu qMGF05nY5hKN6DaawBcA+Q2llKjPNpaDm0UTJjNO/CtcgGenUFRwharY X-Gm-Gg: Acq92OE30YOQNGivtV7Rbydf9UvukCfn3cmQydabBJpUs1+dDM5rBwnm6UAfKBB4jkY qt5XBO3Ezd3MEZdqswHjYOZ9bNY58o8VuK0CyNvf+Om4T7aCbTZw14qa2gsfQTnwN1s//EQ7QG5 acCroyQIF8HYTI8dr1g7qiFZrF6IZ/DlTJt9nSE7IwL6EP81n8c5t6zNKPY6/5oKoNGtPkvR8mS 4Yq4hOWHArQebCRc7ti6Gnwu1p582d3giyxLeUX+yTKsPaftUCF4xaYchW7M1sxvuEgi75GPl1C hSHc3vv3sygQpMRN7YSMHe6XKAWy5g+SSCdKTDxlVHSRWfXTtGpB4bfjRHm2zkTFHNjYdykofCu 760NvJKuSGJEd8hgAcQX1h3KhN7+EooQRMi8KrUtGSXe5FUCfxLoIJGhB0KtXmhZxznv7b4pyhS +z5xuZBwFiTC220MY7pzU3sHVM6yJAgT0ruq7epYUGeis= X-Received: by 2002:a05:6512:ad6:b0:5aa:671d:9966 with SMTP id 2adb3069b0e04-5aa87b40683mr814399e87.6.1780650625403; Fri, 05 Jun 2026 02:10:25 -0700 (PDT) Received: from new-nest ([2a05:3580:f312:6c00:1b49:dfce:283c:7307]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5aa7b9903e9sm1705914e87.69.2026.06.05.02.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jun 2026 02:10:24 -0700 (PDT) From: Andrey Skvortsov To: Jean-Baptiste Maneyrol , Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Marek , Brian Masney , Rob Herring Cc: Andrey Skvortsov Subject: [PATCH v4 2/3] iio: imu: inv_mpu6050: use devres-enabled version of pm_runtime_enable() Date: Fri, 5 Jun 2026 12:09:39 +0300 Message-ID: <20260605090940.1103750-3-andrej.skvortzov@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260605090940.1103750-1-andrej.skvortzov@gmail.com> References: <20260605090940.1103750-1-andrej.skvortzov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Usage of devm_pm_runtime_enable() allows to remove driver-specific action, that does the same as default action. Signed-off-by: Andrey Skvortsov --- Changes in v4: - update commit message to address Andy's comment about functions, callbacks and runtime PM names Changes in v3: - remove extra blank lines in "use devres-enabled version of pm_runtime_enable" drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 8c8b4f9a8ff63..6fd35ea5daabb 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -1874,13 +1874,6 @@ static void inv_mpu_core_disable_regulator_action(void *_data) inv_mpu_core_disable_regulator_vddio(st); } -static void inv_mpu_pm_disable(void *data) -{ - struct device *dev = data; - - pm_runtime_disable(dev); -} - int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, int (*inv_mpu_bus_setup)(struct iio_dev *), int chip_type) { @@ -2023,13 +2016,12 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, /* chip init is done, turning on runtime power management */ pm_runtime_get_noresume(dev); - pm_runtime_enable(dev); + result = devm_pm_runtime_enable(dev); + if (result) + return result; pm_runtime_set_autosuspend_delay(dev, INV_MPU6050_SUSPEND_DELAY_MS); pm_runtime_use_autosuspend(dev); pm_runtime_put(dev); - result = devm_add_action_or_reset(dev, inv_mpu_pm_disable, dev); - if (result) - return result; switch (chip_type) { case INV_MPU6000: -- 2.53.0