From patchwork Fri Aug 17 23:36:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 1340081 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5563F3FC81 for ; Fri, 17 Aug 2012 23:36:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753297Ab2HQXgE (ORCPT ); Fri, 17 Aug 2012 19:36:04 -0400 Received: from mail-ee0-f74.google.com ([74.125.83.74]:52986 "EHLO mail-ee0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752585Ab2HQXgD (ORCPT ); Fri, 17 Aug 2012 19:36:03 -0400 Received: by eekd4 with SMTP id d4so192260eek.1 for ; Fri, 17 Aug 2012 16:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=yk1y4Xoqgg8xkQ1A687T/BxigddCCETqkG09Y1FgpPI=; b=B7hiWC4loKWygkaUE0pIkRFOriQi8cl17cWJ+MIjy373ussC5aqdhKMhJh58qEN1U2 PZnNyUgjuW3vZXPWuTDfh/e1pe4fOvo1/X3MEFUcBZzETXJJO2SIuw8i82Df/Uf7+pXG Fpwy3cl+DkDRB3vg4HK/N9PZTxN/GRFcNMT/iPNmQHRXCfBO4JlbAZz8LMXULnKRadfO 1iPewbwOgnoc1aZqH5TzdoRwL9B66ueTin7efJf1gCr2IBpM/VxSBXexfHij2sNGqF8l MZ1OqHNYr6HJc5grvpKm+oHvcDQpOgZy5Bd5kB5oXmtO2anwUoxjPUdbVtpmOEMe9bUY h51w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=yk1y4Xoqgg8xkQ1A687T/BxigddCCETqkG09Y1FgpPI=; b=Hi5Ig+VIX5e74oi8G7XSNfrYEBVEKZbxXO76qsQqMAAeYZIJhccRaM05osVhVLjrOL bGNrSytELukibZDSqUqzisQYMs2EhiNyqJ/b2QIvQTzuKo/j6py1WMfJaP//Cjzwd+Qw sLYiL/riYbRAEMhgg8N1z0PLtm0bVZrMOExXrVJzHlzjR1c0CHdHsU0bNhzNTj0EUOpt PZ883R6nDdL5RAxzsYkonsrikT5DWuZljNCPqr4eV2tSYykCrB8ENabYwxV2/Ghp1hfL dL+ejk14EGe7MycymiQg1EXe/WDGoyO6tRsjp0PTjzHpw9XCUiyt4oK0el+CtrOwI3XL 7I6A== Received: by 10.180.88.195 with SMTP id bi3mr703259wib.3.1345246561119; Fri, 17 Aug 2012 16:36:01 -0700 (PDT) Received: by 10.180.88.195 with SMTP id bi3mr703251wib.3.1345246561076; Fri, 17 Aug 2012 16:36:01 -0700 (PDT) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id 46si11743491eed.1.2012.08.17.16.36.01 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 17 Aug 2012 16:36:01 -0700 (PDT) Received: from bhelgaas.mtv.corp.google.com (bhelgaas.mtv.corp.google.com [172.18.96.155]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id DCB3620004E; Fri, 17 Aug 2012 16:36:00 -0700 (PDT) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id 47FFF1801BB; Fri, 17 Aug 2012 16:36:00 -0700 (PDT) Subject: [PATCH v2 03/16] pcmcia: Use common pci_stop_and_remove_bus_device() To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-pcmcia@lists.infradead.org, Yinghai Lu , Kenji Kaneshige Date: Fri, 17 Aug 2012 17:36:00 -0600 Message-ID: <20120817233600.10973.11841.stgit@bhelgaas.mtv.corp.google.com> In-Reply-To: <20120817233100.10973.59521.stgit@bhelgaas.mtv.corp.google.com> References: <20120817233100.10973.59521.stgit@bhelgaas.mtv.corp.google.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlpQ9woUnhnhHEg1wCqCbX6P0zMiRyAqFNBCCd7YMHRyYscv4mMeMS3L2p5gel4Ay5mBfQ3vv+eR8OWAcWs4vBQEWi1DAu7Cs3b9XpslMasqjWNDg5HyDCfUV12Jfl6WN9/fGNFfyatlxTXLf4sZbjkfr9pie6AFIkf69LBAMY2csBP43V4pVBoN0+Dw4ACzxfq7Fy0cfhlRnID+QXc1ReQOKoX2A== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Use pci_stop_and_remove_bus_device() like most other hotplug drivers rather than the special-purpose "behind_bridge" variant. This just means we have to iterate through all the devices downstream of the bridge ourselves, which is the same thing pci_stop_behind_bridge() did. Signed-off-by: Bjorn Helgaas --- drivers/pcmcia/cardbus.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c index 24caeaf..94f87b5 100644 --- a/drivers/pcmcia/cardbus.c +++ b/drivers/pcmcia/cardbus.c @@ -106,7 +106,10 @@ int __ref cb_alloc(struct pcmcia_socket *s) void cb_free(struct pcmcia_socket *s) { struct pci_dev *bridge = s->cb_dev; + struct pci_bus *bus = bridge->subordinate; + struct pci_dev *dev, *tmp; - if (bridge) - pci_stop_and_remove_behind_bridge(bridge); + if (bus) + list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) + pci_stop_and_remove_bus_device(dev); }