aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-01-02 16:59:15 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2010-01-17 12:31:00 -0500
commit593f010bc0d8f7fde2ce948cac3f77f6a3d9db2b (patch)
treea8ceda9b2678714e5c2253e67dcab209e7ba60c0 /drivers/pcmcia/cs.c
parent3f32b3c093eddc03ed477ae0d7a6938db6b94a05 (diff)
pcmcia: do not lock socket driver module in pcmcia_get_socket()
Do not lock the socket driver module in pcmcia_get_socket(), as the PCMCIA core can handle a socket module removal: In pcmcia_unregister_socket(), we explicitely wait for the last put_device() to succeed. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/cs.c')
-rw-r--r--drivers/pcmcia/cs.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index 9d8b9c1f5a69..f0630a61da90 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -140,19 +140,13 @@ struct pcmcia_socket *pcmcia_get_socket(struct pcmcia_socket *skt)
140 struct device *dev = get_device(&skt->dev); 140 struct device *dev = get_device(&skt->dev);
141 if (!dev) 141 if (!dev)
142 return NULL; 142 return NULL;
143 skt = dev_get_drvdata(dev); 143 return dev_get_drvdata(dev);
144 if (!try_module_get(skt->owner)) {
145 put_device(&skt->dev);
146 return NULL;
147 }
148 return skt;
149} 144}
150EXPORT_SYMBOL(pcmcia_get_socket); 145EXPORT_SYMBOL(pcmcia_get_socket);
151 146
152 147
153void pcmcia_put_socket(struct pcmcia_socket *skt) 148void pcmcia_put_socket(struct pcmcia_socket *skt)
154{ 149{
155 module_put(skt->owner);
156 put_device(&skt->dev); 150 put_device(&skt->dev);
157} 151}
158EXPORT_SYMBOL(pcmcia_put_socket); 152EXPORT_SYMBOL(pcmcia_put_socket);