hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mmc/host/wbsd.c
....@@ -1,13 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * linux/drivers/mmc/host/wbsd.c - Winbond W83L51xD SD/MMC driver
34 *
45 * Copyright (C) 2004-2007 Pierre Ossman, All Rights Reserved.
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or (at
9
- * your option) any later version.
10
- *
116 *
127 * Warning!
138 *
....@@ -33,6 +28,8 @@
3328 #include <linux/pnp.h>
3429 #include <linux/highmem.h>
3530 #include <linux/mmc/host.h>
31
+#include <linux/mmc/mmc.h>
32
+#include <linux/mmc/sd.h>
3633 #include <linux/scatterlist.h>
3734 #include <linux/slab.h>
3835
....@@ -775,22 +772,22 @@
775772 * interrupts.
776773 */
777774 switch (cmd->opcode) {
778
- case 11:
779
- case 17:
780
- case 18:
781
- case 20:
782
- case 24:
783
- case 25:
784
- case 26:
785
- case 27:
786
- case 30:
787
- case 42:
788
- case 56:
775
+ case SD_SWITCH_VOLTAGE:
776
+ case MMC_READ_SINGLE_BLOCK:
777
+ case MMC_READ_MULTIPLE_BLOCK:
778
+ case MMC_WRITE_DAT_UNTIL_STOP:
779
+ case MMC_WRITE_BLOCK:
780
+ case MMC_WRITE_MULTIPLE_BLOCK:
781
+ case MMC_PROGRAM_CID:
782
+ case MMC_PROGRAM_CSD:
783
+ case MMC_SEND_WRITE_PROT:
784
+ case MMC_LOCK_UNLOCK:
785
+ case MMC_GEN_CMD:
789786 break;
790787
791788 /* ACMDs. We don't keep track of state, so we just treat them
792789 * like any other command. */
793
- case 51:
790
+ case SD_APP_SEND_SCR:
794791 break;
795792
796793 default:
....@@ -1706,7 +1703,15 @@
17061703 */
17071704 wbsd_init_device(host);
17081705
1709
- mmc_add_host(mmc);
1706
+ ret = mmc_add_host(mmc);
1707
+ if (ret) {
1708
+ if (!pnp)
1709
+ wbsd_chip_poweroff(host);
1710
+
1711
+ wbsd_release_resources(host);
1712
+ wbsd_free_mmc(dev);
1713
+ return ret;
1714
+ }
17101715
17111716 pr_info("%s: W83L51xD", mmc_hostname(mmc));
17121717 if (host->chip_id != 0)