From patchwork Wed Jan 23 15:32:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2025641 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8BACF3FD86 for ; Wed, 23 Jan 2013 15:40:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756266Ab3AWPkc (ORCPT ); Wed, 23 Jan 2013 10:40:32 -0500 Received: from moutng.kundenserver.de ([212.227.126.187]:55358 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755924Ab3AWPkT (ORCPT ); Wed, 23 Jan 2013 10:40:19 -0500 Received: from axis700.grange (dslb-178-006-250-035.pools.arcor-ip.net [178.6.250.35]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0MJZaJ-1U14hY0Eih-0032io; Wed, 23 Jan 2013 16:40:15 +0100 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 7B50240B98; Wed, 23 Jan 2013 16:40:14 +0100 (CET) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1Ty2Qw-0000Pb-5B; Wed, 23 Jan 2013 16:40:14 +0100 From: Guennadi Liakhovetski To: linux-mmc@vger.kernel.org Cc: linux-sh@vger.kernel.org, Magnus Damm , Chris Ball , Guennadi Liakhovetski Subject: [PATCH v2 01/11] mmc: sdhi, tmio: only check flags in tmio-mmc driver proper Date: Wed, 23 Jan 2013 16:32:28 +0100 Message-Id: <1358955158-1510-2-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1358955158-1510-1-git-send-email-g.liakhovetski@gmx.de> References: <1358955158-1510-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:9dDXmzlaB06gv2NkV3I4u+570nfpchCkPZDAB1h8ePR /BX1A1nPQNsrcQiOysjIdXUFwCQdaOWlD224DaDqgfsTRqQwrA oi9es9f7v/ngBD+USbXSs6h3tiEHh1ocGn3n0OimS7bLAx6N1g aVweKNAAmJ2zLx3GzvwHcA0DgmUhZJJG7S92yG6rTfhLSG9in6 P3KyavY8e5fRItx30qAdQz7F8rUpicQRHOQmY/PgglJG4YjIwP 6ztI1uv2tWVz7kew2asai+CUE7pKG8pktBmWfmgbXwdEpgQjRp rgvCYauFDZYnRuAH+VbsSzS/Iv5JyRlSFth2JLNGcTjnuPGwf0 /jgYb2SmskcOkA7MiVjTbbgnCtOHgE8AKTYJ/zBowGU7mkLt6j TXqFQRHBwRoWw== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org tmio-mmc platform flags can be set by various means, including caller drivers and device-tree bindings, therefore it is better to only check them in the tmio-mmc driver proper, not in caller drivers themselves. Signed-off-by: Guennadi Liakhovetski --- v2: .write16_hook should also be assigned in the absence of platform data, e.g. with DT. drivers/mmc/host/sh_mobile_sdhi.c | 3 +-- drivers/mmc/host/tmio_mmc_pio.c | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index 524a7f7..e0ca0ab 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -153,10 +153,9 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) mmc_data->clk_enable = sh_mobile_sdhi_clk_enable; mmc_data->clk_disable = sh_mobile_sdhi_clk_disable; mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; + mmc_data->write16_hook = sh_mobile_sdhi_write16_hook; if (p) { mmc_data->flags = p->tmio_flags; - if (mmc_data->flags & TMIO_MMC_HAS_IDLE_WAIT) - mmc_data->write16_hook = sh_mobile_sdhi_write16_hook; mmc_data->ocr_mask = p->tmio_ocr_mask; mmc_data->capabilities |= p->tmio_caps; mmc_data->capabilities2 |= p->tmio_caps2; diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index 0f992e9..b25adb4 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -928,6 +928,9 @@ int tmio_mmc_host_probe(struct tmio_mmc_host **host, int ret; u32 irq_mask = TMIO_MASK_CMD; + if (!(pdata->flags & TMIO_MMC_HAS_IDLE_WAIT)) + pdata->write16_hook = NULL; + res_ctl = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res_ctl) return -EINVAL;