@@ -1719,6 +1719,14 @@ static int fw_devlink_create_devlink(struct device *con,
struct device *sup_dev;
int ret = 0;
+ /*
+ * If the consumer or supplier is a device that'll never be probed,
+ * don't create devices link for it.
+ */
+ if (con->fwnode->flags & FWNODE_FLAG_NEVER_PROBES ||
+ sup_handle->flags & FWNODE_FLAG_NEVER_PROBES)
+ return -EINVAL;
+
sup_dev = get_dev_from_fwnode(sup_handle);
if (sup_dev) {
/*
@@ -19,13 +19,15 @@ struct device;
/*
* fwnode link flags
*
- * LINKS_ADDED: The fwnode has already be parsed to add fwnode links.
- * NOT_DEVICE: The fwnode will never be populated as a struct device.
- * INITIALIZED: The hardware corresponding to fwnode has been initialized.
+ * LINKS_ADDED: The fwnode has already be parsed to add fwnode links.
+ * NOT_DEVICE: The fwnode will never be populated as a struct device.
+ * INITIALIZED: The hardware corresponding to fwnode has been initialized.
+ * NEVER_PROBES: The device that corresponds to this fwnode will never probe.
*/
#define FWNODE_FLAG_LINKS_ADDED BIT(0)
#define FWNODE_FLAG_NOT_DEVICE BIT(1)
#define FWNODE_FLAG_INITIALIZED BIT(2)
+#define FWNODE_FLAG_NEVER_PROBES BIT(3)
struct fwnode_handle {
struct fwnode_handle *secondary;
Add a fwnode flag to mark a device as one that will never be probed even though it's added to a bus. Signed-off-by: Saravana Kannan <saravanak@google.com> --- drivers/base/core.c | 8 ++++++++ include/linux/fwnode.h | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-)