From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383211; b=EXxC5iP26y0eDUMDtBSoO3qybE0tI2/gKFNfea7TWWj+7ADCJcpwt0QkRRtm7UQzpTSN HTIfFYJW8j5OX2u3g//60kXtcQQJnhV6LkVX4uJAKO2zCSUomB4JBFQkflHrBECxTzwqI XWAfaSstqTbdkJXjaqGRk5Ybc3rDGKqRA3aLDkubZc6HMlHOljsEiEK8Ld4Q82+OFCRoV w/LqtTd1IsDzKN/EU6qyF18FtzHaWf3pZhF54ihzfWepEB/rd+CGI0KbqLESp4mOSL+Xg xO+lJLgUdxeNivt2VS5vSo4Z1kUiIV/0qmkI0TDr/H7QoH5SxseM6bybtQaKQgkCv8g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383211; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=AqteZnRpViy8Y0LFB8PdN/CUl9o1DTT93EjS4ik7ChE=; b=urZeDkio/Yjq368Pphy0Um5XvlFOziQZV1sMyXpYvpK9QF61TWxnA8iSFzGR8HL0DVEI 5paMbQYmE8WKQ3oz/QYDmkS6TiGe1sQxiRu+LCU2sCP8n2rYSmDyLyiZoe+a98dDYb9Ar S6jNhHMSN9QEYMUAZCM0PY6PM8/5avnoYxq0QDBRy9P7B+SWuvlSC9YFSpqAIejwLe1jy rTtmsNptg2ofxpTC5J8hJ1cfhGYSmYTxpgTg7fNep3zpvnCFZIf27IZscQsAkpQNsrmYL CjUJ32VJ8g7hkQu9R/8UVUydDMHGCj7H2JlRFEkihuSNn3noOjE+xTnuvhpxntUIqeg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Kxm+Dz7I; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0E2A606A335; Fri, 4 Dec 2026 11:20:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Kxm+Dz7I Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57A211F00933; Fri, 4 Dec 2026 11:20:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383210; bh=AqteZnRpViy8Y0LFB8PdN/CUl9o1DTT93EjS4ik7ChE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Kxm+Dz7Iwq1kjgs6a6CO30aX8GEsliZ7HXb5L0FnbAqEPkvF8liP+KtM/oGclKNs8 lYOYoKlmYWcdOtwn0uW+4ArKbDwINpwbxaR+u6f2tTRCweHn8/ECQMG/5HBooPFG/W dt/8D+q/U+obumgQE8v9DtN1rq3Cr/kgdfmRKf4o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Raag Jadav , Andy Shevchenko , Zijun Hu , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 6.12 127/555] devres: Add devm_is_action_added() helper Date: Fri, 4 Dec 2026 19:02:50 +0900 Message-ID: <20261204100612.644976640@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andy Shevchenko [ Upstream commit e383bb8f958444620d96386811aacf6a49757996 ] In some code we would like to know if the action in device managed resources was added by devm_add_action() family of calls. Introduce a helper for that. Reviewed-by: Raag Jadav Signed-off-by: Andy Shevchenko Reviewed-by: Zijun Hu Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20250220162238.2738038-3-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski Stable-dep-of: 6c6508e742b4 ("usb: dwc3: xilinx: unwind ZynqMP platform init on probe failure and remove") Signed-off-by: Sasha Levin --- drivers/base/devres.c | 11 +++++++++++ include/linux/device/devres.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/drivers/base/devres.c b/drivers/base/devres.c index 03da20f0431dc..89fcb95efad93 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -756,6 +756,17 @@ int __devm_add_action(struct device *dev, void (*action)(void *), void *data, co } EXPORT_SYMBOL_GPL(__devm_add_action); +bool devm_is_action_added(struct device *dev, void (*action)(void *), void *data) +{ + struct action_devres devres = { + .data = data, + .action = action, + }; + + return devres_find(dev, devm_action_release, devm_action_match, &devres); +} +EXPORT_SYMBOL_GPL(devm_is_action_added); + /** * devm_remove_action_nowarn() - removes previously added custom action * @dev: Device that owns the action diff --git a/include/linux/device/devres.h b/include/linux/device/devres.h index 9cd1787ef28ed..ae696d10faff4 100644 --- a/include/linux/device/devres.h +++ b/include/linux/device/devres.h @@ -165,4 +165,6 @@ static inline int __devm_add_action_or_reset(struct device *dev, void (*action)( #define devm_add_action_or_reset(dev, action, data) \ __devm_add_action_or_reset(dev, action, data, #action) +bool devm_is_action_added(struct device *dev, void (*action)(void *), void *data); + #endif /* _DEVICE_DEVRES_H_ */ -- 2.53.0