summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2013-04-04 11:35:49 -0700
committerSimone Willett <swillett@nvidia.com>2013-04-25 17:41:43 -0700
commit9973e69039d39114d35823495a587ff93056cc20 (patch)
tree0ee6f30848d11291e82cc999a53b41461ec2e1a5 /drivers
parent56fc7f6cad0a1fe8403f80af557a08446c10220c (diff)
sdhci-tegra: move kzalloc out of interrupt context
sdhci_tegra_sd_error_stats can be called from sdhci_irq. Move memory allocation to the probe() function so we don't perform it in interrupt context. Change-Id: Ic4278526f72ebeb11d59bfe8a7d3e112172035a8 Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-on: http://git-master/r/216591 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/sdhci-tegra.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 5079dbf19c6e..bdc7a28619ca 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -1076,16 +1076,8 @@ static int sdhci_tegra_sd_error_stats(struct sdhci_host *host, u32 int_status)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_tegra *tegra_host = pltfm_host->priv;
- struct platform_device *pdev = to_platform_device(mmc_dev(host->mmc));
struct sdhci_tegra_sd_stats *head;
- if (tegra_host->sd_stat_head == NULL) {
- tegra_host->sd_stat_head = devm_kzalloc(&pdev->dev, sizeof(
- struct sdhci_tegra_sd_stats),
- GFP_KERNEL);
- if (tegra_host->sd_stat_head == NULL)
- return -ENOMEM;
- }
head = tegra_host->sd_stat_head;
if (int_status & SDHCI_INT_DATA_CRC)
head->data_crc_count++;
@@ -1979,7 +1971,14 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev)
}
tegra_host->plat = plat;
- tegra_host->sd_stat_head = NULL;
+ tegra_host->sd_stat_head = devm_kzalloc(&pdev->dev, sizeof(
+ struct sdhci_tegra_sd_stats),
+ GFP_KERNEL);
+ if (tegra_host->sd_stat_head == NULL) {
+ rc = -ENOMEM;
+ goto err_no_plat;
+ }
+
tegra_host->soc_data = soc_data;
pltfm_host->priv = tegra_host;