@@ -47,6 +47,12 @@ static int __init sysfs_deprecated_setup(char *arg)
early_param("sysfs.deprecated", sysfs_deprecated_setup);
#endif
+/*
+ * Default authorization status set as allow all. It can be
+ * overridden by arch code.
+ */
+bool __ro_after_init dev_default_authorization = true;
+
/* Device links support. */
static LIST_HEAD(deferred_sync);
static unsigned int defer_sync_state_count = 1;
@@ -2855,6 +2861,7 @@ void device_initialize(struct device *dev)
#ifdef CONFIG_SWIOTLB
dev->dma_io_tlb_mem = &io_tlb_default_mem;
#endif
+ dev->authorized = dev_default_authorization;
}
EXPORT_SYMBOL_GPL(device_initialize);
@@ -959,6 +959,8 @@ int devtmpfs_mount(void);
static inline int devtmpfs_mount(void) { return 0; }
#endif
+extern bool dev_default_authorization;
+
/* drivers/base/power/shutdown.c */
void device_shutdown(void);