| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Toshiba PCI Secure Digital Host Controller Interface driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Based on asic3_mmc.c, copyright (c) 2005 SDG Systems, LLC and, |
|---|
| 8 | 9 | * sdhci.c, copyright (C) 2005-2006 Pierre Ossman |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 11 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 12 | | - * the Free Software Foundation; either version 2 of the License, or (at |
|---|
| 13 | | - * your option) any later version. |
|---|
| 14 | 10 | */ |
|---|
| 15 | 11 | |
|---|
| 16 | 12 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 655 | 651 | if (ret) |
|---|
| 656 | 652 | goto unmap; |
|---|
| 657 | 653 | |
|---|
| 658 | | - mmc_add_host(mmc); |
|---|
| 654 | + ret = mmc_add_host(mmc); |
|---|
| 655 | + if (ret) |
|---|
| 656 | + goto free_irq; |
|---|
| 659 | 657 | |
|---|
| 660 | 658 | base = pci_resource_start(pdev, 0); |
|---|
| 661 | 659 | dev_dbg(&pdev->dev, "MMIO %pa, IRQ %d\n", &base, pdev->irq); |
|---|
| .. | .. |
|---|
| 664 | 662 | |
|---|
| 665 | 663 | return 0; |
|---|
| 666 | 664 | |
|---|
| 665 | +free_irq: |
|---|
| 666 | + free_irq(pdev->irq, host); |
|---|
| 667 | 667 | unmap: |
|---|
| 668 | 668 | pci_iounmap(pdev, host->ioaddr); |
|---|
| 669 | 669 | release: |
|---|