Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp178768imd; Wed, 31 Oct 2018 16:54:46 -0700 (PDT) X-Google-Smtp-Source: AJdET5eMWX7xJO3AUq5B329I0aD8BrBHkCl2lJUcMC1Lr0HUXLlOafR++le8mDALZKoMGwJxcwWb X-Received: by 2002:a62:888c:: with SMTP id l134-v6mr5398710pfd.198.1541030085985; Wed, 31 Oct 2018 16:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541030085; cv=none; d=google.com; s=arc-20160816; b=X3a3qr6OtWegzZ4AEnYV+Ay1hL/l9QB6K16eNKM1yzH1HQ6c/7F9FkuDH2rGjWlcfB dPalHsbFj8o6yg+yh+l6R9j4ltoEEsBkTb4ozXun/+ZWfzPVVkPhZ/WgvEV4MP/s5aPF qWADT6AdykhVYsr0kAmmvFi55O2oaCB50vqB/giOAhXFtr6nMWHuP3ZNgNp/cHcuAGRi 9orApbNK06Jfcz3hEynuCYkirD6Pg/2bhLhKSmzxt6tC3R4Wrww6YdnY0EAg+meLjgDF RVL/6wW4uZJL71so0OcHQh2Kv5SVjW4EP6tEiog4iBiX8uLSGcpxJ7bC4XcBlC/hLAMU UGUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=sHITSHIUd92JOOTjYpQmo6lwCRgo+Tj3i72plR7eD9w=; b=ipw189kKx3vpxhq6FgEbZOqiXwUwsWdvCsfAbnWbrTiuDao3PgIVrNJyXrkp7t9Ke/ CBeRVNmaVxv4YIJ45Hr/2b/6kgbBymZ/1SGc0WXI+W3dG8hFeUkz3axgXxPe1mEFzIQw UIrIJThGFiPSzQCQwf+O38FcwhlUquDBeUQLC0fWklvglswC6ssYr+alRMrZkVQuifQg q6hkoWz8ZhOPVdYaNHr2qANnBl1c9burvzh8WSSLv2vG1co57IVsyzr4VP0mGWFbSJqD ur7B+Dz3jXhrx65iEEECtDg2eXC2zjnIosUwFuPDFi1ZobTJK6eOi2Zto6U8uMbkzJIm l8XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OmmTyM1d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e62-v6si30018326pfe.31.2018.10.31.16.54.31; Wed, 31 Oct 2018 16:54:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OmmTyM1d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728074AbeKAIxY (ORCPT + 99 others); Thu, 1 Nov 2018 04:53:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:53076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727729AbeKAIGQ (ORCPT ); Thu, 1 Nov 2018 04:06:16 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 15ADC20823; Wed, 31 Oct 2018 23:06:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027165; bh=rQkjh6Jbx/gYVbPJxx78KPtQMKnAz+tNa+RYimnIHck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OmmTyM1duX6LbaZo34XL+vfz0/xSidO6h6TcIsGYVD1lnyifzj53HhdNSyhRF3KZx qj+9sYqskoQo2IWbPbkFol4AGG1HSX2Nto5fOYJYsxe1sG1nFrMAFfhdbNoTqkRLHH cdjcOK/NivR1AGYMjFA6aOAIg9X06TJDWwYPxVKY= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wang Dongsheng , Ulf Hansson , Sasha Levin Subject: [PATCH AUTOSEL 4.19 025/146] sdhci: acpi: add free_slot callback Date: Wed, 31 Oct 2018 19:03:40 -0400 Message-Id: <20181031230541.28822-25-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Dongsheng [ Upstream commit c7eabbee3de99347105faa7fd925a500ccf43baf ] The device specific resource can be free in free_slot after removing host controller. Signed-off-by: Wang Dongsheng Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/sdhci-acpi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 32321bd596d8..c61109f7b793 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -76,6 +76,7 @@ struct sdhci_acpi_slot { size_t priv_size; int (*probe_slot)(struct platform_device *, const char *, const char *); int (*remove_slot)(struct platform_device *); + int (*free_slot)(struct platform_device *pdev); int (*setup_host)(struct platform_device *pdev); }; @@ -756,6 +757,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev) err_cleanup: sdhci_cleanup_host(c->host); err_free: + if (c->slot && c->slot->free_slot) + c->slot->free_slot(pdev); + sdhci_free_host(c->host); return err; } @@ -777,6 +781,10 @@ static int sdhci_acpi_remove(struct platform_device *pdev) dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0); sdhci_remove_host(c->host, dead); + + if (c->slot && c->slot->free_slot) + c->slot->free_slot(pdev); + sdhci_free_host(c->host); return 0; -- 2.17.1