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>
This commit is contained in:
Родитель
3f32b3c093
Коммит
593f010bc0
|
@ -140,19 +140,13 @@ struct pcmcia_socket *pcmcia_get_socket(struct pcmcia_socket *skt)
|
||||||
struct device *dev = get_device(&skt->dev);
|
struct device *dev = get_device(&skt->dev);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return NULL;
|
return NULL;
|
||||||
skt = dev_get_drvdata(dev);
|
return dev_get_drvdata(dev);
|
||||||
if (!try_module_get(skt->owner)) {
|
|
||||||
put_device(&skt->dev);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return skt;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(pcmcia_get_socket);
|
EXPORT_SYMBOL(pcmcia_get_socket);
|
||||||
|
|
||||||
|
|
||||||
void pcmcia_put_socket(struct pcmcia_socket *skt)
|
void pcmcia_put_socket(struct pcmcia_socket *skt)
|
||||||
{
|
{
|
||||||
module_put(skt->owner);
|
|
||||||
put_device(&skt->dev);
|
put_device(&skt->dev);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(pcmcia_put_socket);
|
EXPORT_SYMBOL(pcmcia_put_socket);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче