From patchwork Wed Jul 21 17:33:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ohad Ben Cohen X-Patchwork-Id: 113428 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6LHZbRx008323 for ; Wed, 21 Jul 2010 17:35:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761151Ab0GURfb (ORCPT ); Wed, 21 Jul 2010 13:35:31 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:59315 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761093Ab0GURfW (ORCPT ); Wed, 21 Jul 2010 13:35:22 -0400 Received: by mail-bw0-f46.google.com with SMTP id 1so374531bwz.19 for ; Wed, 21 Jul 2010 10:35:21 -0700 (PDT) Received: by 10.204.45.207 with SMTP id g15mr440372bkf.14.1279733721516; Wed, 21 Jul 2010 10:35:21 -0700 (PDT) Received: from localhost.localdomain (93-172-119-238.bb.netvision.net.il [93.172.119.238]) by mx.google.com with ESMTPS id f10sm29348743bkl.5.2010.07.21.10.35.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Jul 2010 10:35:21 -0700 (PDT) From: Ohad Ben-Cohen To: , , Cc: , , Chikkature Rajashekar Madhusudhan , Luciano Coelho , , San Mehat , Roger Quadros , Tony Lindgren , Nicolas Pitre , Pandita Vikram , Kalle Valo , Ohad Ben-Cohen Subject: [PATCH v2 17/20] mmc: sdio: relocate sdio_set_block_size call Date: Wed, 21 Jul 2010 20:33:51 +0300 Message-Id: <1279733634-21974-18-git-send-email-ohad@wizery.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1279733634-21974-1-git-send-email-ohad@wizery.com> References: <1279733634-21974-1-git-send-email-ohad@wizery.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 21 Jul 2010 17:35:38 +0000 (UTC) diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 79e6fa1..5c0fbfa 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -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); } } diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c index 4a890dc..87269f6 100644 --- a/drivers/mmc/core/sdio_bus.c +++ b/drivers/mmc/core/sdio_bus.c @@ -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); }