@@ -73,6 +73,12 @@ static int sdio_init_func(struct mmc_card *card, unsigned int fn)
card->sdio_func[fn - 1] = func;
+ /* Set the default block size so the driver is sure it's something
+ * sensible. */
+ ret = sdio_set_block_size(func, 0);
+ if (ret)
+ return ret;
+
/* For each SDIO function initialized, increase the power claim
* reference count of the card */
atomic_inc(&card->power_claims);
@@ -510,7 +516,13 @@ static int mmc_sdio_resume(struct mmc_host *host)
if (func && sdio_func_present(func) && func->dev.driver) {
const struct dev_pm_ops *pmops = func->dev.driver->pm;
- if (pmops && pmops->resume)
+ /* Set the default block size so the driver is sure
+ * it's something sensible. */
+ mmc_claim_host(host);
+ err = sdio_set_block_size(func, 0);
+ mmc_release_host(host);
+
+ if (!err && pmops && pmops->resume)
err = pmops->resume(&func->dev);
}
}
@@ -119,20 +119,11 @@ static int sdio_bus_probe(struct device *dev)
struct sdio_driver *drv = to_sdio_driver(dev->driver);
struct sdio_func *func = dev_to_sdio_func(dev);
const struct sdio_device_id *id;
- int ret;
id = sdio_match_device(func, drv);
if (!id)
return -ENODEV;
- /* Set the default block size so the driver is sure it's something
- * sensible. */
- sdio_claim_host(func);
- ret = sdio_set_block_size(func, 0);
- sdio_release_host(func);
- if (ret)
- return ret;
-
return drv->probe(func, id);
}