core: Add dev_{disable,enable}_by_path
We cannot use device structures to disable devices, since getting
them with the API functions would bind and activate the device, which
would fail if the underlying device does not exist.
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/include/dm/device.h b/include/dm/device.h
index 3120b68..9812d86 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -601,6 +601,22 @@
bool of_machine_is_compatible(const char *compat);
/**
+ * dev_disable_by_path() - Disable a device given its device tree path
+ *
+ * @path: The device tree path identifying the device to be disabled
+ * @return 0 on success, -ve on error
+ */
+int dev_disable_by_path(const char *path);
+
+/**
+ * dev_enable_by_path() - Enable a device given its device tree path
+ *
+ * @path: The device tree path identifying the device to be enabled
+ * @return 0 on success, -ve on error
+ */
+int dev_enable_by_path(const char *path);
+
+/**
* device_is_on_pci_bus - Test if a device is on a PCI bus
*
* @dev: device to test