[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1496331655.340586973@decadent.org.uk>
Date: Thu, 01 Jun 2017 16:40:55 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org,
"Rafał Miłecki" <rafal@...ecki.pl>,
"Kalle Valo" <kvalo@...eaurora.org>
Subject: [PATCH 3.2 029/101] bcma: use (get|put)_device when
probing/removing device driver
3.2.89-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Rafał Miłecki <rafal@...ecki.pl>
commit a971df0b9d04674e325346c17de9a895425ca5e1 upstream.
This allows tracking device state and e.g. makes devm work as expected.
Signed-off-by: Rafał Miłecki <rafal@...ecki.pl>
Signed-off-by: Kalle Valo <kvalo@...eaurora.org>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
drivers/bcma/main.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -297,8 +297,11 @@ static int bcma_device_probe(struct devi
drv);
int err = 0;
+ get_device(dev);
if (adrv->probe)
err = adrv->probe(core);
+ if (err)
+ put_device(dev);
return err;
}
@@ -311,6 +314,7 @@ static int bcma_device_remove(struct dev
if (adrv->remove)
adrv->remove(core);
+ put_device(dev);
return 0;
}
Powered by blists - more mailing lists