diff options
Diffstat (limited to 'drivers/mmc')
| -rw-r--r-- | drivers/mmc/core/block.c | 17 | ||||
| -rw-r--r-- | drivers/mmc/core/pwrseq_sd8787.c | 34 | ||||
| -rw-r--r-- | drivers/mmc/host/bcm2835.c | 4 | ||||
| -rw-r--r-- | drivers/mmc/host/litex_mmc.c | 1 | ||||
| -rw-r--r-- | drivers/mmc/host/meson-gx-mmc.c | 14 | ||||
| -rw-r--r-- | drivers/mmc/host/mmci.c | 3 | ||||
| -rw-r--r-- | drivers/mmc/host/mtk-sd.c | 2 | ||||
| -rw-r--r-- | drivers/mmc/host/mvsdio.c | 2 | ||||
| -rw-r--r-- | drivers/mmc/host/omap.c | 2 | ||||
| -rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 6 | ||||
| -rw-r--r-- | drivers/mmc/host/owl-mmc.c | 2 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci-acpi.c | 2 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci-cadence.c | 8 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 18 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci-msm.c | 3 | ||||
| -rw-r--r-- | drivers/mmc/host/sdhci-spear.c | 4 | ||||
| -rw-r--r-- | drivers/mmc/host/sh_mmcif.c | 2 | ||||
| -rw-r--r-- | drivers/mmc/host/sunxi-mmc.c | 4 | ||||
| -rw-r--r-- | drivers/mmc/host/usdhi6rol0.c | 6 | ||||
| -rw-r--r-- | drivers/mmc/host/vub300.c | 3 | 
20 files changed, 85 insertions, 52 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 00c33edb9fb9..6d01025f1fcf 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -264,6 +264,7 @@ static ssize_t power_ro_lock_store(struct device *dev,  		goto out_put;  	}  	req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_BOOT_WP; +	req_to_mmc_queue_req(req)->drv_op_result = -EIO;  	blk_execute_rq(req, false);  	ret = req_to_mmc_queue_req(req)->drv_op_result;  	blk_mq_free_request(req); @@ -357,15 +358,15 @@ static const struct attribute_group *mmc_disk_attr_groups[] = {  	NULL,  }; -static int mmc_blk_open(struct block_device *bdev, fmode_t mode) +static int mmc_blk_open(struct gendisk *disk, blk_mode_t mode)  { -	struct mmc_blk_data *md = mmc_blk_get(bdev->bd_disk); +	struct mmc_blk_data *md = mmc_blk_get(disk);  	int ret = -ENXIO;  	mutex_lock(&block_mutex);  	if (md) {  		ret = 0; -		if ((mode & FMODE_WRITE) && md->read_only) { +		if ((mode & BLK_OPEN_WRITE) && md->read_only) {  			mmc_blk_put(md);  			ret = -EROFS;  		} @@ -375,7 +376,7 @@ static int mmc_blk_open(struct block_device *bdev, fmode_t mode)  	return ret;  } -static void mmc_blk_release(struct gendisk *disk, fmode_t mode) +static void mmc_blk_release(struct gendisk *disk)  {  	struct mmc_blk_data *md = disk->private_data; @@ -651,6 +652,7 @@ static int mmc_blk_ioctl_cmd(struct mmc_blk_data *md,  	idatas[0] = idata;  	req_to_mmc_queue_req(req)->drv_op =  		rpmb ? MMC_DRV_OP_IOCTL_RPMB : MMC_DRV_OP_IOCTL; +	req_to_mmc_queue_req(req)->drv_op_result = -EIO;  	req_to_mmc_queue_req(req)->drv_op_data = idatas;  	req_to_mmc_queue_req(req)->ioc_count = 1;  	blk_execute_rq(req, false); @@ -722,6 +724,7 @@ static int mmc_blk_ioctl_multi_cmd(struct mmc_blk_data *md,  	}  	req_to_mmc_queue_req(req)->drv_op =  		rpmb ? MMC_DRV_OP_IOCTL_RPMB : MMC_DRV_OP_IOCTL; +	req_to_mmc_queue_req(req)->drv_op_result = -EIO;  	req_to_mmc_queue_req(req)->drv_op_data = idata;  	req_to_mmc_queue_req(req)->ioc_count = n;  	blk_execute_rq(req, false); @@ -754,7 +757,7 @@ static int mmc_blk_check_blkdev(struct block_device *bdev)  	return 0;  } -static int mmc_blk_ioctl(struct block_device *bdev, fmode_t mode, +static int mmc_blk_ioctl(struct block_device *bdev, blk_mode_t mode,  	unsigned int cmd, unsigned long arg)  {  	struct mmc_blk_data *md; @@ -791,7 +794,7 @@ static int mmc_blk_ioctl(struct block_device *bdev, fmode_t mode,  }  #ifdef CONFIG_COMPAT -static int mmc_blk_compat_ioctl(struct block_device *bdev, fmode_t mode, +static int mmc_blk_compat_ioctl(struct block_device *bdev, blk_mode_t mode,  	unsigned int cmd, unsigned long arg)  {  	return mmc_blk_ioctl(bdev, mode, cmd, (unsigned long) compat_ptr(arg)); @@ -2806,6 +2809,7 @@ static int mmc_dbg_card_status_get(void *data, u64 *val)  	if (IS_ERR(req))  		return PTR_ERR(req);  	req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_GET_CARD_STATUS; +	req_to_mmc_queue_req(req)->drv_op_result = -EIO;  	blk_execute_rq(req, false);  	ret = req_to_mmc_queue_req(req)->drv_op_result;  	if (ret >= 0) { @@ -2844,6 +2848,7 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp)  		goto out_free;  	}  	req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_GET_EXT_CSD; +	req_to_mmc_queue_req(req)->drv_op_result = -EIO;  	req_to_mmc_queue_req(req)->drv_op_data = &ext_csd;  	blk_execute_rq(req, false);  	err = req_to_mmc_queue_req(req)->drv_op_result; diff --git a/drivers/mmc/core/pwrseq_sd8787.c b/drivers/mmc/core/pwrseq_sd8787.c index 2e120ad83020..0c5f5e371e1f 100644 --- a/drivers/mmc/core/pwrseq_sd8787.c +++ b/drivers/mmc/core/pwrseq_sd8787.c @@ -28,7 +28,6 @@ struct mmc_pwrseq_sd8787 {  	struct mmc_pwrseq pwrseq;  	struct gpio_desc *reset_gpio;  	struct gpio_desc *pwrdn_gpio; -	u32 reset_pwrdwn_delay_ms;  };  #define to_pwrseq_sd8787(p) container_of(p, struct mmc_pwrseq_sd8787, pwrseq) @@ -39,7 +38,7 @@ static void mmc_pwrseq_sd8787_pre_power_on(struct mmc_host *host)  	gpiod_set_value_cansleep(pwrseq->reset_gpio, 1); -	msleep(pwrseq->reset_pwrdwn_delay_ms); +	msleep(300);  	gpiod_set_value_cansleep(pwrseq->pwrdn_gpio, 1);  } @@ -51,17 +50,37 @@ static void mmc_pwrseq_sd8787_power_off(struct mmc_host *host)  	gpiod_set_value_cansleep(pwrseq->reset_gpio, 0);  } +static void mmc_pwrseq_wilc1000_pre_power_on(struct mmc_host *host) +{ +	struct mmc_pwrseq_sd8787 *pwrseq = to_pwrseq_sd8787(host->pwrseq); + +	/* The pwrdn_gpio is really CHIP_EN, reset_gpio is RESETN */ +	gpiod_set_value_cansleep(pwrseq->pwrdn_gpio, 1); +	msleep(5); +	gpiod_set_value_cansleep(pwrseq->reset_gpio, 1); +} + +static void mmc_pwrseq_wilc1000_power_off(struct mmc_host *host) +{ +	struct mmc_pwrseq_sd8787 *pwrseq = to_pwrseq_sd8787(host->pwrseq); + +	gpiod_set_value_cansleep(pwrseq->reset_gpio, 0); +	gpiod_set_value_cansleep(pwrseq->pwrdn_gpio, 0); +} +  static const struct mmc_pwrseq_ops mmc_pwrseq_sd8787_ops = {  	.pre_power_on = mmc_pwrseq_sd8787_pre_power_on,  	.power_off = mmc_pwrseq_sd8787_power_off,  }; -static const u32 sd8787_delay_ms = 300; -static const u32 wilc1000_delay_ms = 5; +static const struct mmc_pwrseq_ops mmc_pwrseq_wilc1000_ops = { +	.pre_power_on = mmc_pwrseq_wilc1000_pre_power_on, +	.power_off = mmc_pwrseq_wilc1000_power_off, +};  static const struct of_device_id mmc_pwrseq_sd8787_of_match[] = { -	{ .compatible = "mmc-pwrseq-sd8787", .data = &sd8787_delay_ms }, -	{ .compatible = "mmc-pwrseq-wilc1000", .data = &wilc1000_delay_ms }, +	{ .compatible = "mmc-pwrseq-sd8787", .data = &mmc_pwrseq_sd8787_ops }, +	{ .compatible = "mmc-pwrseq-wilc1000", .data = &mmc_pwrseq_wilc1000_ops },  	{/* sentinel */},  };  MODULE_DEVICE_TABLE(of, mmc_pwrseq_sd8787_of_match); @@ -77,7 +96,6 @@ static int mmc_pwrseq_sd8787_probe(struct platform_device *pdev)  		return -ENOMEM;  	match = of_match_node(mmc_pwrseq_sd8787_of_match, pdev->dev.of_node); -	pwrseq->reset_pwrdwn_delay_ms = *(u32 *)match->data;  	pwrseq->pwrdn_gpio = devm_gpiod_get(dev, "powerdown", GPIOD_OUT_LOW);  	if (IS_ERR(pwrseq->pwrdn_gpio)) @@ -88,7 +106,7 @@ static int mmc_pwrseq_sd8787_probe(struct platform_device *pdev)  		return PTR_ERR(pwrseq->reset_gpio);  	pwrseq->pwrseq.dev = dev; -	pwrseq->pwrseq.ops = &mmc_pwrseq_sd8787_ops; +	pwrseq->pwrseq.ops = match->data;  	pwrseq->pwrseq.owner = THIS_MODULE;  	platform_set_drvdata(pdev, pwrseq); diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c index 8648f7e63ca1..eea208856ce0 100644 --- a/drivers/mmc/host/bcm2835.c +++ b/drivers/mmc/host/bcm2835.c @@ -1403,8 +1403,8 @@ static int bcm2835_probe(struct platform_device *pdev)  	host->max_clk = clk_get_rate(clk);  	host->irq = platform_get_irq(pdev, 0); -	if (host->irq <= 0) { -		ret = -EINVAL; +	if (host->irq < 0) { +		ret = host->irq;  		goto err;  	} diff --git a/drivers/mmc/host/litex_mmc.c b/drivers/mmc/host/litex_mmc.c index 39c6707fdfdb..9af6b0902efe 100644 --- a/drivers/mmc/host/litex_mmc.c +++ b/drivers/mmc/host/litex_mmc.c @@ -649,6 +649,7 @@ static struct platform_driver litex_mmc_driver = {  	.driver = {  		.name = "litex-mmc",  		.of_match_table = litex_match, +		.probe_type = PROBE_PREFER_ASYNCHRONOUS,  	},  };  module_platform_driver(litex_mmc_driver); diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index b8514d9d5e73..ee9a25b900ae 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -991,11 +991,8 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id)  		if (data && !cmd->error)  			data->bytes_xfered = data->blksz * data->blocks; -		if (meson_mmc_bounce_buf_read(data) || -		    meson_mmc_get_next_command(cmd)) -			ret = IRQ_WAKE_THREAD; -		else -			ret = IRQ_HANDLED; + +		return IRQ_WAKE_THREAD;  	}  out: @@ -1007,9 +1004,6 @@ out:  		writel(start, host->regs + SD_EMMC_START);  	} -	if (ret == IRQ_HANDLED) -		meson_mmc_request_done(host->mmc, cmd->mrq); -  	return ret;  } @@ -1192,8 +1186,8 @@ static int meson_mmc_probe(struct platform_device *pdev)  		return PTR_ERR(host->regs);  	host->irq = platform_get_irq(pdev, 0); -	if (host->irq <= 0) -		return -EINVAL; +	if (host->irq < 0) +		return host->irq;  	cd_irq = platform_get_irq_optional(pdev, 1);  	mmc_gpio_set_cd_irq(mmc, cd_irq); diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index f2b2e8b0574e..696cbef3ff7d 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1735,7 +1735,8 @@ static void mmci_set_max_busy_timeout(struct mmc_host *mmc)  		return;  	if (host->variant->busy_timeout && mmc->actual_clock) -		max_busy_timeout = ~0UL / (mmc->actual_clock / MSEC_PER_SEC); +		max_busy_timeout = U32_MAX / DIV_ROUND_UP(mmc->actual_clock, +							  MSEC_PER_SEC);  	mmc->max_busy_timeout = max_busy_timeout;  } diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index edade0e54a0c..9785ec91654f 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2680,7 +2680,7 @@ static int msdc_drv_probe(struct platform_device *pdev)  	host->irq = platform_get_irq(pdev, 0);  	if (host->irq < 0) { -		ret = -EINVAL; +		ret = host->irq;  		goto host_free;  	} diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index 629efbe639c4..b4f6a0a2fcb5 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c @@ -704,7 +704,7 @@ static int mvsd_probe(struct platform_device *pdev)  	}  	irq = platform_get_irq(pdev, 0);  	if (irq < 0) -		return -ENXIO; +		return irq;  	mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev);  	if (!mmc) { diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index ce78edfb402b..86454f1182bb 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -1343,7 +1343,7 @@ static int mmc_omap_probe(struct platform_device *pdev)  	irq = platform_get_irq(pdev, 0);  	if (irq < 0) -		return -ENXIO; +		return irq;  	host->virt_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);  	if (IS_ERR(host->virt_base)) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 517dde777413..1e0f2d7774bd 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1791,9 +1791,11 @@ static int omap_hsmmc_probe(struct platform_device *pdev)  	}  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -	irq = platform_get_irq(pdev, 0); -	if (res == NULL || irq < 0) +	if (!res)  		return -ENXIO; +	irq = platform_get_irq(pdev, 0); +	if (irq < 0) +		return irq;  	base = devm_ioremap_resource(&pdev->dev, res);  	if (IS_ERR(base)) diff --git a/drivers/mmc/host/owl-mmc.c b/drivers/mmc/host/owl-mmc.c index 6f9d31a886ba..1bf22b08b373 100644 --- a/drivers/mmc/host/owl-mmc.c +++ b/drivers/mmc/host/owl-mmc.c @@ -637,7 +637,7 @@ static int owl_mmc_probe(struct platform_device *pdev)  	owl_host->irq = platform_get_irq(pdev, 0);  	if (owl_host->irq < 0) { -		ret = -EINVAL; +		ret = owl_host->irq;  		goto err_release_channel;  	} diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 8f0e639236b1..edf2e6c14dc6 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -829,7 +829,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev)  	host->ops	= &sdhci_acpi_ops_dflt;  	host->irq	= platform_get_irq(pdev, 0);  	if (host->irq < 0) { -		err = -EINVAL; +		err = host->irq;  		goto err_free;  	} diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cadence.c index b24aa27da50c..d2f625054689 100644 --- a/drivers/mmc/host/sdhci-cadence.c +++ b/drivers/mmc/host/sdhci-cadence.c @@ -540,9 +540,11 @@ static int sdhci_cdns_probe(struct platform_device *pdev)  	if (host->mmc->caps & MMC_CAP_HW_RESET) {  		priv->rst_hw = devm_reset_control_get_optional_exclusive(dev, NULL); -		if (IS_ERR(priv->rst_hw)) -			return dev_err_probe(mmc_dev(host->mmc), PTR_ERR(priv->rst_hw), -					     "reset controller error\n"); +		if (IS_ERR(priv->rst_hw)) { +			ret = dev_err_probe(mmc_dev(host->mmc), PTR_ERR(priv->rst_hw), +					    "reset controller error\n"); +			goto free; +		}  		if (priv->rst_hw)  			host->mmc_host_ops.card_hw_reset = sdhci_cdns_mmc_hw_reset;  	} diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index d7c0c0b9e26c..eebf94604a7f 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1634,6 +1634,10 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,  	if (ret)  		return ret; +	/* HS400/HS400ES require 8 bit bus */ +	if (!(host->mmc->caps & MMC_CAP_8_BIT_DATA)) +		host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES); +  	if (mmc_gpio_get_cd(host->mmc) >= 0)  		host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; @@ -1724,10 +1728,6 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)  		host->mmc_host_ops.init_card = usdhc_init_card;  	} -	err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data); -	if (err) -		goto disable_ahb_clk; -  	if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING)  		sdhci_esdhc_ops.platform_execute_tuning =  					esdhc_executing_tuning; @@ -1735,15 +1735,13 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)  	if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536)  		host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; -	if (host->mmc->caps & MMC_CAP_8_BIT_DATA && -	    imx_data->socdata->flags & ESDHC_FLAG_HS400) +	if (imx_data->socdata->flags & ESDHC_FLAG_HS400)  		host->mmc->caps2 |= MMC_CAP2_HS400;  	if (imx_data->socdata->flags & ESDHC_FLAG_BROKEN_AUTO_CMD23)  		host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN; -	if (host->mmc->caps & MMC_CAP_8_BIT_DATA && -	    imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) { +	if (imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) {  		host->mmc->caps2 |= MMC_CAP2_HS400_ES;  		host->mmc_host_ops.hs400_enhanced_strobe =  					esdhc_hs400_enhanced_strobe; @@ -1765,6 +1763,10 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)  			goto disable_ahb_clk;  	} +	err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data); +	if (err) +		goto disable_ahb_clk; +  	sdhci_esdhc_imx_hwinit(host);  	err = sdhci_add_host(host); diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 8ac81d57a3df..1877d583fe8c 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -2479,6 +2479,9 @@ static inline void sdhci_msm_get_of_property(struct platform_device *pdev,  		msm_host->ddr_config = DDR_CONFIG_POR_VAL;  	of_property_read_u32(node, "qcom,dll-config", &msm_host->dll_config); + +	if (of_device_is_compatible(node, "qcom,msm8916-sdhci")) +		host->quirks2 |= SDHCI_QUIRK2_BROKEN_64_BIT_DMA;  }  static int sdhci_msm_gcc_reset(struct device *dev, struct sdhci_host *host) diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c index d463e2fd5b1a..c79035727b20 100644 --- a/drivers/mmc/host/sdhci-spear.c +++ b/drivers/mmc/host/sdhci-spear.c @@ -65,8 +65,8 @@ static int sdhci_probe(struct platform_device *pdev)  	host->hw_name = "sdhci";  	host->ops = &sdhci_pltfm_ops;  	host->irq = platform_get_irq(pdev, 0); -	if (host->irq <= 0) { -		ret = -EINVAL; +	if (host->irq < 0) { +		ret = host->irq;  		goto err_host;  	}  	host->quirks = SDHCI_QUIRK_BROKEN_ADMA; diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 0fd4c9d644dd..5cf53348372a 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -1400,7 +1400,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)  	irq[0] = platform_get_irq(pdev, 0);  	irq[1] = platform_get_irq_optional(pdev, 1);  	if (irq[0] < 0) -		return -ENXIO; +		return irq[0];  	reg = devm_platform_ioremap_resource(pdev, 0);  	if (IS_ERR(reg)) diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index 3db9f32d6a7b..69dcb8805e05 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -1350,8 +1350,8 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,  		return ret;  	host->irq = platform_get_irq(pdev, 0); -	if (host->irq <= 0) { -		ret = -EINVAL; +	if (host->irq < 0) { +		ret = host->irq;  		goto error_disable_mmc;  	} diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c index 2f59917b105e..2e17903658fc 100644 --- a/drivers/mmc/host/usdhi6rol0.c +++ b/drivers/mmc/host/usdhi6rol0.c @@ -1757,8 +1757,10 @@ static int usdhi6_probe(struct platform_device *pdev)  	irq_cd = platform_get_irq_byname(pdev, "card detect");  	irq_sd = platform_get_irq_byname(pdev, "data");  	irq_sdio = platform_get_irq_byname(pdev, "SDIO"); -	if (irq_sd < 0 || irq_sdio < 0) -		return -ENODEV; +	if (irq_sd < 0) +		return irq_sd; +	if (irq_sdio < 0) +		return irq_sdio;  	mmc = mmc_alloc_host(sizeof(struct usdhi6_host), dev);  	if (!mmc) diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c index e4c4bfac3763..9ec593d52f0f 100644 --- a/drivers/mmc/host/vub300.c +++ b/drivers/mmc/host/vub300.c @@ -1713,6 +1713,9 @@ static void construct_request_response(struct vub300_mmc_host *vub300,  	int bytes = 3 & less_cmd;  	int words = less_cmd >> 2;  	u8 *r = vub300->resp.response.command_response; + +	if (!resp_len) +		return;  	if (bytes == 3) {  		cmd->resp[words] = (r[1 + (words << 2)] << 24)  			| (r[2 + (words << 2)] << 16)  |