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 <[email protected]>
Cc: Dave Hansen <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
---
 drivers/dax/bus.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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,

Reply via email to