From patchwork Wed Nov 25 13:57:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 7699611 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 625B4BF90C for ; Wed, 25 Nov 2015 13:58:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5BD84208E9 for ; Wed, 25 Nov 2015 13:58:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FB9B208E5 for ; Wed, 25 Nov 2015 13:58:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753006AbbKYN6G (ORCPT ); Wed, 25 Nov 2015 08:58:06 -0500 Received: from mail-lf0-f54.google.com ([209.85.215.54]:36710 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752667AbbKYN6F (ORCPT ); Wed, 25 Nov 2015 08:58:05 -0500 Received: by lfs39 with SMTP id 39so59339510lfs.3 for ; Wed, 25 Nov 2015 05:58:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=+07f1i4dI+zE39FjcqGQCuHAN8GxRTDX4gtGCwpYGxY=; b=kh8U93BhR+Y+dinyGZtiZWYuZNGFmFVbcmCY3wREgvWJQZm7B35G9K5MwMSDNEjXJw aG/n3TXdby4WoCyqLXnBpWOzbQN3oy7UBH+CP0iIJw7HGWvKOld79ikgyBQfgK5uq4Cf gwoi4w3GMo2j3FTqdqGUFCzvd6wys2ZfFA9jY9MV/b4lbW2YYtx/4HPx+w3DZMenCzDp OF/eP1a6RQuf2Xoq/N9Hxxm9BWoBDVqYSC0sZASYXcmUexprgkwJ0z4wW8a3eYLnRXkO Wy1MXKqEDpEdjbttZ2rDj+QdMn5dmmi5JhfaKEx/AMgIZ5lOwVeGAMveumOAI8jOZHrL PofA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+07f1i4dI+zE39FjcqGQCuHAN8GxRTDX4gtGCwpYGxY=; b=OGKef7wUq5ZiWrp3L8m2ZD3nuiX2Cf6hsuVeuGBZOvZ8esfBoO0q0lYwrT3zS406iV 6L+ScSZABkrzzuqhqX/fgPWETbUaAzNIRNGY8KBj0dXbo42NdU8DEZmM2OgES7pJlMdM uhyI1h65s2bZ1k0b2hKcY7WRJRhp04tw+KwnKHe+fHR8mk33fBNbraiQMIMMUvz/9zP5 8zlOJGECi5ffRXpp/xDIBS91RvRKlnpi5L4nd5C8Vo4vHfg9LVLpC/AuIApVNyre+kPE KO5+n1tHcUWVikLHn1Q4D26FT3S8fCywcUsBxipnhSlhqUmKt2h5qUERcIkdeMWsS0Uy rCcw== X-Gm-Message-State: ALoCoQnYfrF6RuwZ2Xhr6DCjiX1xrmskA7FT4TymQiAMY7vbHB5ypXbtJwH6EA1h014nDJhJZJti X-Received: by 10.25.159.130 with SMTP id i124mr15630565lfe.144.1448459882116; Wed, 25 Nov 2015 05:58:02 -0800 (PST) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id wd2sm261668lbb.6.2015.11.25.05.58.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Nov 2015 05:58:01 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, Chris Ball , Ulf Hansson Cc: Linus Walleij , Nicolas Pitre , Andrew Lunn , Sebastian Hesselbarth Subject: [PATCH 2/2] mmc: mvsdio: delete platform data code path Date: Wed, 25 Nov 2015 14:57:57 +0100 Message-Id: <1448459877-32626-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are no in-kernel users of the MVSDIO platform data method (instantiating from a board file) so just delete this code and make this a DT-only driver. We depend on OF and check that we have an OF node in probe(). Cc: Nicolas Pitre Cc: Andrew Lunn Cc: Sebastian Hesselbarth Signed-off-by: Linus Walleij Acked-by: Nicolas Pitre Acked-by: Andrew Lunn --- drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/mvsdio.c | 63 +++++++++++------------------------------------ 2 files changed, 15 insertions(+), 49 deletions(-) diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 1dee533634c9..1526b8a10b09 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -455,6 +455,7 @@ config MMC_TIFM_SD config MMC_MVSDIO tristate "Marvell MMC/SD/SDIO host driver" depends on PLAT_ORION + depends on OF ---help--- This selects the Marvell SDIO host driver. SDIO may currently be found on the Kirkwood 88F6281 and 88F6192 diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c index 18c70380ea93..42296e55b9de 100644 --- a/drivers/mmc/host/mvsdio.c +++ b/drivers/mmc/host/mvsdio.c @@ -20,8 +20,6 @@ #include #include #include -#include -#include #include #include #include @@ -36,12 +34,6 @@ static int maxfreq; static int nodma; -struct mvsdio_platform_data { - unsigned int clock; - int gpio_card_detect; - int gpio_write_protect; -}; - struct mvsd_host { void __iomem *base; struct mmc_request *mrq; @@ -709,6 +701,10 @@ static int mvsd_probe(struct platform_device *pdev) struct resource *r; int ret, irq; + if (!np) { + dev_err(&pdev->dev, "no DT node\n"); + return -ENODEV; + } r = platform_get_resource(pdev, IORESOURCE_MEM, 0); irq = platform_get_irq(pdev, 0); if (!r || irq < 0) @@ -732,8 +728,12 @@ static int mvsd_probe(struct platform_device *pdev) * fixed rate clock). */ host->clk = devm_clk_get(&pdev->dev, NULL); - if (!IS_ERR(host->clk)) - clk_prepare_enable(host->clk); + if (IS_ERR(host->clk)) { + dev_err(&pdev->dev, "no clock associated\n"); + ret = -EINVAL; + goto out; + } + clk_prepare_enable(host->clk); mmc->ops = &mvsd_ops; @@ -749,45 +749,10 @@ static int mvsd_probe(struct platform_device *pdev) mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count; mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; - if (np) { - if (IS_ERR(host->clk)) { - dev_err(&pdev->dev, "DT platforms must have a clock associated\n"); - ret = -EINVAL; - goto out; - } - - host->base_clock = clk_get_rate(host->clk) / 2; - ret = mmc_of_parse(mmc); - if (ret < 0) - goto out; - } else { - const struct mvsdio_platform_data *mvsd_data; - - mvsd_data = pdev->dev.platform_data; - if (!mvsd_data) { - ret = -ENXIO; - goto out; - } - mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ | - MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; - host->base_clock = mvsd_data->clock / 2; - /* GPIO 0 regarded as invalid for backward compatibility */ - if (mvsd_data->gpio_card_detect && - gpio_is_valid(mvsd_data->gpio_card_detect)) { - ret = mmc_gpio_request_cd(mmc, - mvsd_data->gpio_card_detect, - 0); - if (ret) - goto out; - } else { - mmc->caps |= MMC_CAP_NEEDS_POLL; - } - - if (mvsd_data->gpio_write_protect && - gpio_is_valid(mvsd_data->gpio_write_protect)) - mmc_gpio_request_ro(mmc, mvsd_data->gpio_write_protect); - } - + host->base_clock = clk_get_rate(host->clk) / 2; + ret = mmc_of_parse(mmc); + if (ret < 0) + goto out; if (maxfreq) mmc->f_max = maxfreq;