From patchwork Wed Feb 2 18:06:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 12733365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57603C433F5 for ; Wed, 2 Feb 2022 18:07:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231880AbiBBSHC (ORCPT ); Wed, 2 Feb 2022 13:07:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbiBBSHC (ORCPT ); Wed, 2 Feb 2022 13:07:02 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CB5EC061714; Wed, 2 Feb 2022 10:07:01 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id ka4so65813ejc.11; Wed, 02 Feb 2022 10:07:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oqTmB0axPVxCTS0sxTTWZlHegO1uPd5y6swwpolQnGc=; b=P8jc1aWcY/XL+b7QzCSCota0C9bBW2ksXIMnw3cZizHXrVzdVkJ/aBQ2bgRjJEBIsP zQJXucoZaRzhET2d54m1slInWOrbdUBRpnpzTmAwCQczXA/tIWPn1QjFN0a/JvkeAznJ JhDTRsLIy9iYhrWyn1su135zmHPebTBtfcgQCSsBQZDwwYa+RL5Um0be+zCu+6pHhDQ+ giez63aK7Zx4J/VcBcKawe41fSwRrtKX45K50VRbY+Tjj+IF+VSHwp6qUiimZ22OA+Gy ny4LvBrGHgvXkGhl71jx9IxF2rBUzJHmkJvfknmfdNpbdex2buTEOGxdg+G5gDQ7e3as 2ZsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oqTmB0axPVxCTS0sxTTWZlHegO1uPd5y6swwpolQnGc=; b=q4lWvhqL1IWzlqksWc2O0MvgVB+CGYXwz3BuxaeR2W38XhMeWLG2LHfApqSgqnN2yP W1L8AFNNqPG32ivwgM9pC4h7j+i6CT2NMAW/QGPPdocich7XYkI4g/3JYlYwvzNHKUg7 uD9w0IgJIvixEbShXcaSvfaeHT7e9cz19WIqwt0KWRKJA1QoU5xl+GwdMjdca75Gv5gQ skpLdv2milkPWVhcOrJe9S3XYUxJLkF7U+ZonoSA3msD34fB4sKdI2R7xHp1zRMAo1+G 2NCSIq/Cbhf+7186JcqHrYeHZ3zxM8WNPM/VxxALhYyJV3drtFvJwDqjOP8m9/wQDEvy w5pg== X-Gm-Message-State: AOAM530NI8AJV3koFzdIyEdTz2/3qC3PwBgLMrxykcaJEoP1oUFrGsO5 2v4xSH7TfGnfXyQCQujlsms= X-Google-Smtp-Source: ABdhPJw/vxEGYkblydj48bZS2rASRw0MuODJxDJoFc58voLMjHalgIzxCNmfpPlt/b9B/RBgN2Exww== X-Received: by 2002:a17:907:2ce4:: with SMTP id hz4mr18280325ejc.261.1643825220235; Wed, 02 Feb 2022 10:07:00 -0800 (PST) Received: from localhost.localdomain (p4fd5939b.dip0.t-ipconnect.de. [79.213.147.155]) by smtp.gmail.com with ESMTPSA id ee37sm3223005edb.106.2022.02.02.10.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 10:06:59 -0800 (PST) From: Bean Huo To: ulf.hansson@linaro.org, eugen.hristev@microchip.com, adrian.hunter@intel.com, nicolas.ferre@microchip.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: beanhuo@micron.com Subject: [PATCH 1/5] mmc: wmt-sdmmc: Use of_device_get_match_data() helper Date: Wed, 2 Feb 2022 19:06:44 +0100 Message-Id: <20220202180648.1252154-2-huobean@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220202180648.1252154-1-huobean@gmail.com> References: <20220202180648.1252154-1-huobean@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Bean Huo Only the device data is needed, not the whole struct of_device_id. Use of_device_get_match_data() instead of open coding of of_match_device(). Signed-off-by: Bean Huo --- drivers/mmc/host/wmt-sdmmc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c index cf10949fb0ac..163ac9df8cca 100644 --- a/drivers/mmc/host/wmt-sdmmc.c +++ b/drivers/mmc/host/wmt-sdmmc.c @@ -751,19 +751,16 @@ static int wmt_mci_probe(struct platform_device *pdev) struct mmc_host *mmc; struct wmt_mci_priv *priv; struct device_node *np = pdev->dev.of_node; - const struct of_device_id *of_id = - of_match_device(wmt_mci_dt_ids, &pdev->dev); const struct wmt_mci_caps *wmt_caps; int ret; int regular_irq, dma_irq; - if (!of_id || !of_id->data) { + wmt_caps = of_device_get_match_data(&pdev->dev); + if (!wmt_caps) { dev_err(&pdev->dev, "Controller capabilities data missing\n"); return -EFAULT; } - wmt_caps = of_id->data; - if (!np) { dev_err(&pdev->dev, "Missing SDMMC description in devicetree\n"); return -EFAULT; From patchwork Wed Feb 2 18:06:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 12733364 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62BCEC4332F for ; Wed, 2 Feb 2022 18:07:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346380AbiBBSHD (ORCPT ); Wed, 2 Feb 2022 13:07:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242208AbiBBSHD (ORCPT ); Wed, 2 Feb 2022 13:07:03 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80A33C061714; Wed, 2 Feb 2022 10:07:02 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id ah7so147719ejc.4; Wed, 02 Feb 2022 10:07:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ip+D+4jKDZ9eZzccWWkC2tZZAMJIHmVnZ4DotqyL+9Q=; b=WvZavXM5BasA5y4AJ64ENlaYbO06iiyfkI2ndwUeanWSXSaI/IHkkZ/0SXLKZgi4Zc bvRw5BReLIZohLrhhXCE4RnC48twGved0UieEha5mY3rwMV8b5lw3yp48SzGMcl+eCL+ NS9AQFdOZK8oqlNHmX4+GyyfdY0+uvDgMZPZmGZ+ifk5SjDhPrELZUmpJVXQVlCDrnYl oe3GsurbvcjvJ6CP1C+iFRnjTQx2jFWgW6NBMzuF30mNBF6w3PvlNlqCtujotjkEFY+/ MxI/GkJv5nxGVPfsNKQIVoOraFynObswwfKu/kql6detF7KoK4NsNSI7IK9AYEtBeWKB /erQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ip+D+4jKDZ9eZzccWWkC2tZZAMJIHmVnZ4DotqyL+9Q=; b=8LXtSuYmehVofxe9nMe4F+xH+tEtsxHQAjQQeHBhPzR0I5BK6Zyeuc934D4WoQT82F CmC50NvRyYCtxRzMHr+U9HfJfQL5+KF8NtNMOZOeRR38kCc+vKMjCDHdKLPrxwcaG14A u2Z5CAPYwRqi0JaaMquojy+F4xN+wGsnysAVUFFJCj1KEkkp1qrADiCMUpN+Gh8lnPI1 AfpNs0EmrJ0ivYuIfkiewmIZ+yjpKbdIK9sjyK+0qcODacyY/Az5WdBqw17/pV36KuKK P9Q7Mhqzn4qhHqJ78gstmrS++U9asP/FhTVCrkkhDkz6r2H61qx4fNXOQTMnRnufNFAD s0sg== X-Gm-Message-State: AOAM532uX18Ka1XEXH5oFJtj1A4vYakpy4x+bR1Ke87GATlW8+0pGbOl Kv97SHTg/chhF9ItOWHwfaw= X-Google-Smtp-Source: ABdhPJwsA+A/ne87WAL/7wGX88dCMjg5hbjYx4j317efSNdmO77fmmWzw9Rc2xNXIwoPHgKRzmgDsw== X-Received: by 2002:a17:907:6d17:: with SMTP id sa23mr26004476ejc.164.1643825221082; Wed, 02 Feb 2022 10:07:01 -0800 (PST) Received: from localhost.localdomain (p4fd5939b.dip0.t-ipconnect.de. [79.213.147.155]) by smtp.gmail.com with ESMTPSA id ee37sm3223005edb.106.2022.02.02.10.07.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 10:07:00 -0800 (PST) From: Bean Huo To: ulf.hansson@linaro.org, eugen.hristev@microchip.com, adrian.hunter@intel.com, nicolas.ferre@microchip.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: beanhuo@micron.com Subject: [PATCH 2/5] mmc: sdhci-tegra: Use of_device_get_match_data() helper Date: Wed, 2 Feb 2022 19:06:45 +0100 Message-Id: <20220202180648.1252154-3-huobean@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220202180648.1252154-1-huobean@gmail.com> References: <20220202180648.1252154-1-huobean@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Bean Huo Only the device data is needed,not the whole struct of_device_id. Use of_device_get_match_data() instead of open coding of of_match_device(). Signed-off-by: Bean Huo --- drivers/mmc/host/sdhci-tegra.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index 35ebba067e87..0c9f778ea860 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -1618,7 +1618,6 @@ static int sdhci_tegra_add_host(struct sdhci_host *host) static int sdhci_tegra_probe(struct platform_device *pdev) { - const struct of_device_id *match; const struct sdhci_tegra_soc_data *soc_data; struct sdhci_host *host; struct sdhci_pltfm_host *pltfm_host; @@ -1626,10 +1625,9 @@ static int sdhci_tegra_probe(struct platform_device *pdev) struct clk *clk; int rc; - match = of_match_device(sdhci_tegra_dt_match, &pdev->dev); - if (!match) + soc_data = of_device_get_match_data(&pdev->dev); + if (!soc_data) return -EINVAL; - soc_data = match->data; host = sdhci_pltfm_init(pdev, soc_data->pdata, sizeof(*tegra_host)); if (IS_ERR(host)) From patchwork Wed Feb 2 18:06:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 12733366 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAD55C433FE for ; Wed, 2 Feb 2022 18:07:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235872AbiBBSHE (ORCPT ); Wed, 2 Feb 2022 13:07:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230512AbiBBSHD (ORCPT ); Wed, 2 Feb 2022 13:07:03 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4241CC061714; Wed, 2 Feb 2022 10:07:03 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id jx6so249774ejb.0; Wed, 02 Feb 2022 10:07:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DAIcuwwi2BP4NiFyHqKe0BCgP8mtwzjUa/ZfXGkPZks=; b=GOMfXIy6GygS0cMun5y2V4/XiJph+7Lvpo1R7S60UziS3zp3BmAGhWPdW6ZLs2Vly7 nb9b0ERNumAQEbrKKCVwZXd4PdGpmJJkPw+z/QmzTgklWLU3FtdMaHkQeFSLZlY79nmt NthTUFUQM7YS9Dt1UhqNsnYSsZ4CJrJu5REHsKB1LugbyQ+r7FVtww/eVJvKsD/bE583 d8KvEHhislw3WdAx6KBholYbaGHcrSfCkBEONVjQCsP5duEbidt+vOQqsQ9pJw0EVpIy AVM25riavAnLOWFIB8FAafNXQTpBAUAupLu9f/jIxYv8DICIwwsjxsRv9ZpKMF7t/L6K ob0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DAIcuwwi2BP4NiFyHqKe0BCgP8mtwzjUa/ZfXGkPZks=; b=xJ7bfI2jusJvqIevL/8dyAbMmgA6Uxh8OFEl57Kne+wi+lHofcEjmeQOUZEm21kw8P 4IQWAjlbHJxZi94xWIaPzPvNmgR5oSfixGoTBlDPMlSM80Bls70mr1D/DVWPtuZpQ/sI QP6mevR/gxobE2hvL3B/n689cxi+engM2E7vLEMqVb8/xR0yMDM3oAo2J9itTnt15aHp HgXzm5GGN7ifOdm5R2aZyEJ7wf3fD4/UavaAYuKnYueH8IBbsuQyBWM7bfaMpIb1LVEJ QMqP4tPnNP5e9NIy4FkTC9yVSyTtUXeE7580R7+dqWof+N5+YuXwi9M7efdX5+JtKGpv NBjA== X-Gm-Message-State: AOAM533bSn3R+NnFUZvuiSnsb2DT/T5QD+a3/C9tdy+prZ+6VJ34fN6+ d4k/5AqZbwH1W/j4W4PnX0c= X-Google-Smtp-Source: ABdhPJxXPFfWWd175RQTh36iz0OTKrKqHNDt2PC8RAWyRPjuvciz6Sl9XGdZYPtCr7t3wd2eaW7Bvg== X-Received: by 2002:a17:907:7286:: with SMTP id dt6mr26104656ejc.285.1643825221869; Wed, 02 Feb 2022 10:07:01 -0800 (PST) Received: from localhost.localdomain (p4fd5939b.dip0.t-ipconnect.de. [79.213.147.155]) by smtp.gmail.com with ESMTPSA id ee37sm3223005edb.106.2022.02.02.10.07.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 10:07:01 -0800 (PST) From: Bean Huo To: ulf.hansson@linaro.org, eugen.hristev@microchip.com, adrian.hunter@intel.com, nicolas.ferre@microchip.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: beanhuo@micron.com Subject: [PATCH 3/5] mmc: sdhci-omap: Use of_device_get_match_data() helper Date: Wed, 2 Feb 2022 19:06:46 +0100 Message-Id: <20220202180648.1252154-4-huobean@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220202180648.1252154-1-huobean@gmail.com> References: <20220202180648.1252154-1-huobean@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Bean Huo Only the device data is needed, not the entire struct of_device_id. Use of_device_get_match_data() instead of open coding of_match_device(). Signed-off-by: Bean Huo Reported-by: kernel test robot Reported-by: kernel test robot --- drivers/mmc/host/sdhci-omap.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 64e27c2821f9..676e3cbbfc95 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -1219,16 +1219,11 @@ static int sdhci_omap_probe(struct platform_device *pdev) struct sdhci_pltfm_host *pltfm_host; struct sdhci_omap_host *omap_host; struct mmc_host *mmc; - const struct of_device_id *match; struct sdhci_omap_data *data; const struct soc_device_attribute *soc; struct resource *regs; - match = of_match_device(omap_sdhci_match, dev); - if (!match) - return -EINVAL; - - data = (struct sdhci_omap_data *)match->data; + data = of_device_get_match_data(&pdev->dev); if (!data) { dev_err(dev, "no sdhci omap data\n"); return -EINVAL; From patchwork Wed Feb 2 18:06:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 12733367 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87B4CC433F5 for ; Wed, 2 Feb 2022 18:07:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241764AbiBBSHI (ORCPT ); Wed, 2 Feb 2022 13:07:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346454AbiBBSHE (ORCPT ); Wed, 2 Feb 2022 13:07:04 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DC0FC061714; Wed, 2 Feb 2022 10:07:04 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id p7so263541edc.12; Wed, 02 Feb 2022 10:07:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XUeG6YFMvh+7CqOP293WygA3xbDCcF5WbzMm/DaxvYw=; b=XUzmneYFMhqpzZi3ETL/Vrr5oBL7rNypn7pnXPyZUZ1SCx6NSSVKfevT3JkfluefFO u/vVrFcllGa2Xn4O2qm9bibBvhmu30dJKvkOBLR7pZ4IfNNeAQZLG6reXGHIVqAB6AG0 yyv3Hw7ez9KNdsV+QNvvrL9mMAH8ZW1cpkLC1b4EyT3nMsiA6ZVqGy0rjA+3uchtAtWJ FWZ2VSS0anw2VB61zNz4xWf1R38Ag0CxvxH/dND/ydvlK+8uFv/QtL2d6iOMc4R8b7px V00y3g0/JIV6yx2subRHIQSmWssFxEMdgxc/IDW5vq2vB7/rG3Uydb1qzlUdnt9MminJ ag2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XUeG6YFMvh+7CqOP293WygA3xbDCcF5WbzMm/DaxvYw=; b=3mg14P2Ffn93404VZEsgJFbzVhmrc9YMPS91OiRnacZjp8Av81KUmM5CHW/a3W+0qC nQ7EdhNfj/1ZTzWiAmp2rtI0rtKdR0LUXyAwDj0BXZhFzxgl8f6HRnqlpcgXR44Fys1E psow3sYVfHwamB0wZ9ropO3Fl/Ckoj51gnf1Hc4WpPI5eYxeh/asRcukNcU2djA3jeOC 7qOwA/qMmtriZYHGSZVTxLguYScTtmdXaRET1C5wefhIFRmyz0IKXfsyS0UzCtODnVHd 0lWwaOCn9vxdOBfvPD/nytM+bD7UUign9zSOrEVik4bq6s5MfblXL7Fi713b+Flyqpyn 7bSA== X-Gm-Message-State: AOAM533xMa1bv8yL6pYSf5esdGGKLUqfd1+VRYG9sFIwyyVyIGNHhWqc rtsaA0hsTB3G/kOchpOsqPo= X-Google-Smtp-Source: ABdhPJz5DEC1wAoBtex4LT9IElo2CBGFpVXnoBC624ImThH9vwbdgqzTG8DSFj6Dl//QGBtQcBz6fA== X-Received: by 2002:a05:6402:448c:: with SMTP id er12mr31464145edb.137.1643825222813; Wed, 02 Feb 2022 10:07:02 -0800 (PST) Received: from localhost.localdomain (p4fd5939b.dip0.t-ipconnect.de. [79.213.147.155]) by smtp.gmail.com with ESMTPSA id ee37sm3223005edb.106.2022.02.02.10.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 10:07:02 -0800 (PST) From: Bean Huo To: ulf.hansson@linaro.org, eugen.hristev@microchip.com, adrian.hunter@intel.com, nicolas.ferre@microchip.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: beanhuo@micron.com Subject: [PATCH 4/5] mmc: sdhci-of-at91: Use of_device_get_match_data() helper Date: Wed, 2 Feb 2022 19:06:47 +0100 Message-Id: <20220202180648.1252154-5-huobean@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220202180648.1252154-1-huobean@gmail.com> References: <20220202180648.1252154-1-huobean@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Bean Huo Only the device data is needed, not the entire struct of_device_id. Use of_device_get_match_data() instead of open coding of_match_device(). Signed-off-by: Bean Huo --- drivers/mmc/host/sdhci-of-at91.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c index d1a1c548c515..10fb4cb2c731 100644 --- a/drivers/mmc/host/sdhci-of-at91.c +++ b/drivers/mmc/host/sdhci-of-at91.c @@ -308,17 +308,15 @@ static const struct dev_pm_ops sdhci_at91_dev_pm_ops = { static int sdhci_at91_probe(struct platform_device *pdev) { - const struct of_device_id *match; const struct sdhci_at91_soc_data *soc_data; struct sdhci_host *host; struct sdhci_pltfm_host *pltfm_host; struct sdhci_at91_priv *priv; int ret; - match = of_match_device(sdhci_at91_dt_match, &pdev->dev); - if (!match) + soc_data = of_device_get_match_data(&pdev->dev); + if (!soc_data) return -EINVAL; - soc_data = match->data; host = sdhci_pltfm_init(pdev, soc_data->pdata, sizeof(*priv)); if (IS_ERR(host)) From patchwork Wed Feb 2 18:06:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 12733368 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79D04C4332F for ; Wed, 2 Feb 2022 18:07:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346474AbiBBSHJ (ORCPT ); Wed, 2 Feb 2022 13:07:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346491AbiBBSHF (ORCPT ); Wed, 2 Feb 2022 13:07:05 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6E3FC06173B; Wed, 2 Feb 2022 10:07:04 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id m11so251817edi.13; Wed, 02 Feb 2022 10:07:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tdNoO+0JES8dypYccGmpRy+mfWGQ7BG4TFVZPkHwt0k=; b=qUTIybu3JdNyGhZcyTKiqhGmVbuXefceqr9jzgLMKZh47ybfHa7MHRtJx6EcHGutpe qzJG9facXuolXfaDZSPpPEMKaIY0rAbtjDV+iSRR3eGWGCi+tMKNmSq692TnkQWadU+n 1XZzDAsfZJCPPkJ+qKL1YcZhpIHhLcVh8I99mILd1sOopogfJN1fmh5F1c1BMEjay9V5 gbQGtK5gkDpuWfSvbBGzoZSIoEC42am9yvXLkWN2IMrcvOMJjhWSRGk1UX5zfI0u7JSq 2ep3xKhrXQRlpG5WqUxtOePEbVTNzQsoZ1SSsHaspsy/A5o/OUVrjJL/DIOl7MyEAmud jkXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tdNoO+0JES8dypYccGmpRy+mfWGQ7BG4TFVZPkHwt0k=; b=LlrKH07w1Q+9K3P/vAQ7Zealvhi5sQcE45C0b8OC58aObmWtk8VwZiDDnDwPYVi74+ WEabOyJmyNGM5wSSYSi+EEOlPyZ5pJUhYY2OgR/Dq26oisSCJKxYcZTeKrF/CofilAUG OgI0dLGO9VWZwLxWwDt4zOgYYturT8kVQjWXlTRN7cBiG16ihM3+w9jjPCep4cpH38zn TWHcq5v5J1jP3RgMBbI5uLBQCPhHfaWE35ImbjrvxHxQtvIkqJ7l9vbSdSf8sSooyM+1 f1aAgJBBKUKq5K109217fqfnx2QkEhPhpsiPzdOGFvs+RxxCELHxuyhgMJ9pTkEWKfpD YuMw== X-Gm-Message-State: AOAM531lbyCQ9EbFo2yyKHpFi14eGj8rMWdnd4Ok8PtdsUxFvycBDcWf DpHzKDOO3o2tNOjFIBYm+2k= X-Google-Smtp-Source: ABdhPJw7Uing6mDjKEv7mKYBUgrEE/xCQOm1tXwNrv5PCY8iz1M3OafxhmqHvlUpfPdOUvaxoBU1ng== X-Received: by 2002:a05:6402:430a:: with SMTP id m10mr31084761edc.67.1643825223423; Wed, 02 Feb 2022 10:07:03 -0800 (PST) Received: from localhost.localdomain (p4fd5939b.dip0.t-ipconnect.de. [79.213.147.155]) by smtp.gmail.com with ESMTPSA id ee37sm3223005edb.106.2022.02.02.10.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 10:07:03 -0800 (PST) From: Bean Huo To: ulf.hansson@linaro.org, eugen.hristev@microchip.com, adrian.hunter@intel.com, nicolas.ferre@microchip.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: beanhuo@micron.com Subject: [PATCH 5/5] mmc: davinci: Use of_device_get_match_data() helper Date: Wed, 2 Feb 2022 19:06:48 +0100 Message-Id: <20220202180648.1252154-6-huobean@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220202180648.1252154-1-huobean@gmail.com> References: <20220202180648.1252154-1-huobean@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org From: Bean Huo Only the device data is needed, not the entire struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). Signed-off-by: Bean Huo --- drivers/mmc/host/davinci_mmc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index 2a757c88f9d2..0cf646ec9a80 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c @@ -1189,7 +1189,6 @@ static int mmc_davinci_parse_pdata(struct mmc_host *mmc) static int davinci_mmcsd_probe(struct platform_device *pdev) { - const struct of_device_id *match; struct mmc_davinci_host *host = NULL; struct mmc_host *mmc = NULL; struct resource *r, *mem = NULL; @@ -1235,9 +1234,8 @@ static int davinci_mmcsd_probe(struct platform_device *pdev) host->mmc_input_clk = clk_get_rate(host->clk); - match = of_match_device(davinci_mmc_dt_ids, &pdev->dev); - if (match) { - pdev->id_entry = match->data; + pdev->id_entry = of_device_get_match_data(&pdev->dev); + if (pdev->id_entry) { ret = mmc_of_parse(mmc); if (ret) { dev_err_probe(&pdev->dev, ret,