From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 F0FDE46D2C2 for ; Tue, 4 Aug 2026 14:11:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785852672; cv=none; b=IqQRioUULEmwrPAwesgo8C53tnnuwOrl6JhuOxYKtfbCumYrw72qkwpqByw3KC1n4c5w78wnlnYkbd8Am+sd2h2NUEc/cv1uQ0Jufv4Mth+ZyZ6V0gp6hOHHlgKWg5vFora5wU7zndIrQbAVh6lAeBs2jBF/90ztCfm3Vy9hV4U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785852672; c=relaxed/simple; bh=2luqUJM4mc2+5DxEEi6GcuNREqLUXAgtLcwuEVDveZs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=IUjmlzAqtCfa5nJs75HQ2uRyOIqF+1UYOLemdHzQfZOnwgViS28JjEgtajzbACXi63gYyNaUjOrzZILeePvOlkOywh8y6JKzuvPmFgZ0UgZXtQuhE+VY/mCdkwHqog//Qh5LQDp+8yTHYYGV0EF3Cc+cdQJkkbkdT/F4S8VtpTQ= 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=pNWRd6yk; arc=none smtp.client-ip=209.85.215.173 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="pNWRd6yk" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-ca88130e09aso3394352a12.3 for ; Tue, 04 Aug 2026 07:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785852668; x=1786457468; 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=95IHI0w3W2JQknsdPnGS1ocyntvOOPtTyIFBtv4D+oU=; b=pNWRd6ykmPSgRB0QWkjgbwZyZmdhRlq5JG8kA3xx1VDzOmNxg/a52vkEzye3jZj1Bc aU/lpSuhIIcLXc/A4FiUNS5N12yOA3z6VEcg9JI6Crw2YDssNjmgOUWatcdSaFV0xyQI V+bv34hQ2DtE+W4Cc5efx1fDxKSl7YYlF9B2W8BadHCbW8oyL000y6nIg0J5vh7IUPJV RihfNEbboDMltMwVYxPWYxbP7pysVuCYi8gVfjBEuuPzZPvbdXyJuJG+A6knZBjcHUd4 DVCZpz6sF1FPeY7TUMMZhn/W5aW3oZoNXjmwzalL89GWGHPhdPV8zxzTn0N/NDcLD4fL KF4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785852668; x=1786457468; 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=95IHI0w3W2JQknsdPnGS1ocyntvOOPtTyIFBtv4D+oU=; b=NZtu/2F8F/1ltLqaOMTZ8HUpUG/JpuuG1lBbTuwo9k7rxEESjfXuLtXgvVBfh2QsaQ e6cxlBjwDKo0kBW61R6unycn8NH3AFqGhxxiGhWb75tpP+uj/x2iv0UKRxCqKfO67QOp CDSs1PoTWkJjENHNvhwcn3AzJUF+R3mOymD9Pn3QoYFfCjG+6tb3qCZ3Zuw/vdhLXARS NdybMN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31mr129335435ad.5.1785852668344; Tue, 04 Aug 2026 07:11:08 -0700 (PDT) Received: from localhost.localdomain ([1.226.165.54]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d0aa4d8af6sm8205685ad.74.2026.08.04.07.11.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Aug 2026 07:11:07 -0700 (PDT) From: Myeonghun Pak To: Daniel Scally , Jacopo Mondi Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: renesas: rzv2h-ivc: manage runtime PM with devres Date: Tue, 4 Aug 2026 23:11:04 +0900 Message-ID: <20260804141104.38891-1-mhun512@gmail.com> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Runtime PM is enabled before the IRQ is looked up. If that lookup fails, probe returns without disabling runtime PM. The subdevice initialization error path disables runtime PM but leaves autosuspend enabled, while the remove path does neither. Use devm_pm_runtime_enable() so the driver core disables autosuspend and runtime PM on every failed probe and after remove. This also makes the manual subdevice error unwind unnecessary. This issue was identified during our ongoing static-analysis research while reviewing kernel code. Fixes: f0b3984d821b ("media: platform: Add Renesas Input Video Control block driver") Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak --- .../media/platform/renesas/rzv2h-ivc/rzv2h-ivc-dev.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-dev.c b/drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-dev.c index 355842abb24b..48f9fd818bff 100644 --- a/drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-dev.c +++ b/drivers/media/platform/renesas/rzv2h-ivc/rzv2h-ivc-dev.c @@ -202,7 +202,9 @@ static int rzv2h_ivc_probe(struct platform_device *pdev) pm_runtime_set_autosuspend_delay(dev, 2000); pm_runtime_use_autosuspend(dev); - pm_runtime_enable(dev); + ret = devm_pm_runtime_enable(dev); + if (ret) + return ret; ivc->irqnum = platform_get_irq(pdev, 0); if (ivc->irqnum < 0) @@ -210,14 +212,9 @@ static int rzv2h_ivc_probe(struct platform_device *pdev) ret = rzv2h_ivc_initialise_subdevice(ivc); if (ret) - goto err_disable_pm_runtime; + return ret; return 0; - -err_disable_pm_runtime: - pm_runtime_disable(dev); - - return ret; } static void rzv2h_ivc_remove(struct platform_device *pdev) -- 2.47.1