summaryrefslogtreecommitdiff
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorVitor Soares <vitor.soares@toradex.com>2025-12-04 13:49:42 +0000
committerVitor Soares <vitor.soares@toradex.com>2025-12-04 13:49:51 +0000
commite0d2c0556a62886a8db485beef41d45be5b24a76 (patch)
treefe285624899543b24fbe8dd15f55f8f42421f695 /include/linux/device.h
parent88e9f1ec02f87bb86c41152f0b18eec78d0fbfeb (diff)
parent4ac2b983648e08576dc45697ba3680a07b0d2b29 (diff)
Merge commit '4ac2b983648e' of github.com/Freescale/linux-fslctoradex_5.15-2.2.x-imx
Sync with linux-fslc branch 5.15-2.2.x-imx up to commit 4ac2b983648e which includes the v5.15.196 stable update. Signed-off-by: Vitor Soares <vitor.soares@toradex.com>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 440c9f1a3f35..89864b918546 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -30,6 +30,7 @@
#include <linux/device/bus.h>
#include <linux/device/class.h>
#include <linux/device/driver.h>
+#include <linux/cleanup.h>
#include <asm/device.h>
struct device;
@@ -736,6 +737,9 @@ static inline bool device_pm_not_required(struct device *dev)
static inline void device_set_pm_not_required(struct device *dev)
{
dev->power.no_pm = true;
+#ifdef CONFIG_PM
+ dev->power.no_callbacks = true;
+#endif
}
static inline void dev_pm_syscore_device(struct device *dev, bool val)
@@ -822,6 +826,9 @@ void device_unregister(struct device *dev);
void device_initialize(struct device *dev);
int __must_check device_add(struct device *dev);
void device_del(struct device *dev);
+
+DEFINE_FREE(device_del, struct device *, if (_T) device_del(_T))
+
int device_for_each_child(struct device *dev, void *data,
int (*fn)(struct device *dev, void *data));
int device_for_each_child_reverse(struct device *dev, void *data,
@@ -952,6 +959,9 @@ extern int (*platform_notify_remove)(struct device *dev);
*/
struct device *get_device(struct device *dev);
void put_device(struct device *dev);
+
+DEFINE_FREE(put_device, struct device *, if (_T) put_device(_T))
+
bool kill_device(struct device *dev);
#ifdef CONFIG_DEVTMPFS