From 235d530fee92d4e93b24d71aafad4e5a366daa9f Mon Sep 17 00:00:00 2001 From: Oron Peled Date: Mon, 12 May 2014 10:09:22 -0400 Subject: [PATCH] xpp: stability -- better debug information Signed-off-by: Tzafrir Cohen --- drivers/dahdi/xpp/xbus-sysfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/dahdi/xpp/xbus-sysfs.c b/drivers/dahdi/xpp/xbus-sysfs.c index c92ccb7..af94c3a 100644 --- a/drivers/dahdi/xpp/xbus-sysfs.c +++ b/drivers/dahdi/xpp/xbus-sysfs.c @@ -30,6 +30,7 @@ #include #include #include /* for msleep() to debug */ +#include #include "xpd.h" #include "xpp_dahdi.h" #include "xbus-core.h" @@ -967,10 +968,13 @@ void xbus_sysfs_remove(xbus_t *xbus) struct device *astribank; BUG_ON(!xbus); - XBUS_DBG(DEVICES, xbus, "\n"); astribank = &xbus->astribank; - if (!dev_get_drvdata(astribank)) + if (!dev_get_drvdata(astribank)) { + XBUS_NOTICE(xbus, "%s: already removed\n", __func__); return; + } + XBUS_DBG(DEVICES, xbus, "going to unregister: refcount=%d\n", + atomic_read(&astribank->kobj.kref.refcount)); BUG_ON(dev_get_drvdata(astribank) != xbus); device_unregister(astribank); dev_set_drvdata(astribank, NULL);