* [PATCH] device-dax: Auto-bind device after successful new_id
@ 2019-01-24 21:30 Dan Williams
0 siblings, 0 replies; only message in thread
From: Dan Williams @ 2019-01-24 21:30 UTC (permalink / raw)
To: linux-nvdimm; +Cc: Alexander Duyck, Dave Hansen, linux-kernel
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 --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,
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-01-24 21:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24 21:30 [PATCH] device-dax: Auto-bind device after successful new_id Dan Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).