From: Alan Cox Date: Sun, 1 Oct 2006 06:28:00 +0000 (-0700) Subject: [PATCH] cardbus: switch to ref counting/hotplug safe API X-Git-Tag: MMI-PSA29.97-13-9~46949 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=74ae3221818eaf3884ceac931ba3cd2c00045483;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [PATCH] cardbus: switch to ref counting/hotplug safe API Signed-off-by: Alan Cox Cc: Dominik Brodowski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c index 3f6d51d11374..2d7effe7990d 100644 --- a/drivers/pcmcia/cardbus.c +++ b/drivers/pcmcia/cardbus.c @@ -138,7 +138,7 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void cs_dbg(s, 3, "read_cb_mem(%d, %#x, %u)\n", space, addr, len); - dev = pci_find_slot(s->cb_dev->subordinate->number, 0); + dev = pci_get_slot(s->cb_dev->subordinate, 0); if (!dev) goto fail; @@ -152,6 +152,9 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void } res = dev->resource + space - 1; + + pci_dev_put(dev); + if (!res->flags) goto fail;