diff mbox series

device-dax: Auto-bind device after successful new_id

Message ID 154836541248.2998916.14581880959768387544.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Superseded
Headers show
Series device-dax: Auto-bind device after successful new_id | expand

Commit Message

Dan Williams Jan. 24, 2019, 9:30 p.m. UTC
The typical 'new_id' attribute behavior is to immediately attach a
device to its driver after a new device-id is added. Implement this
behavior for the dax bus.

Reported-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/dax/bus.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index c620ad52d7e5..7053ab6419db 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -92,7 +92,10 @@  static ssize_t do_id_store(struct device_driver *drv, const char *buf,
 	} else
 		/* dax_id already added */;
 	mutex_unlock(&dax_bus_lock);
-	return rc;
+
+	if (rc < 0)
+		return rc;
+	return driver_attach(drv);
 }
 
 static ssize_t new_id_store(struct device_driver *drv, const char *buf,