From patchwork Fri Oct 6 22:43:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 730614 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 6C86CE94139 for ; Fri, 6 Oct 2023 22:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233701AbjJFWnu (ORCPT ); Fri, 6 Oct 2023 18:43:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233522AbjJFWnt (ORCPT ); Fri, 6 Oct 2023 18:43:49 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24A1293; Fri, 6 Oct 2023 15:43:49 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AB3EC433C7; Fri, 6 Oct 2023 22:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696632228; bh=vU0MD6zQSd/9wJqpp2u4BnkSbs9vInQtgXvnmfV7Sp8=; h=From:To:Cc:Subject:Date:From; b=Vx3Jjwepc9I/PBd0V2H54HRiPKmZfWPZl8acvys5eMoJcTB2XWKf+OvSEeQRsg4gD YPv1rv23ybUvgvJlmnefuQX4tGMRdkqJ7ypfmJpnZkZs3hCPnMuja8OkpXhFyHABPD nxKw3dYwCkKWOZx/WFTHR4OPrVLH/Jxf7it14axbzCAQ0TUZV9DnK00Stjv1tmhJ2m 0rLosWHAPTHUFv/deXYRlCA36/vdVglWoxJnJ35FfILgNdmIw/1N9+pDDR4Ok8fQen /EStTvj317d7slOGAG/FUMmlZzcOJMKpYolUkX+fWJQdpoydvTKO3n9T0bKM3E2Ppy q8C7CMdhQCBJw== Received: (nullmailer pid 441819 invoked by uid 1000); Fri, 06 Oct 2023 22:43:46 -0000 From: Rob Herring To: Paul Cercueil , Ulf Hansson Cc: linux-mips@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mmc: jz4740: Use device_get_match_data() Date: Fri, 6 Oct 2023 17:43:43 -0500 Message-Id: <20231006224343.441720-1-robh@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring Reviewed-by: Paul Cercueil --- drivers/mmc/host/jz4740_mmc.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c index f379ce5b582d..6a45991ca056 100644 --- a/drivers/mmc/host/jz4740_mmc.c +++ b/drivers/mmc/host/jz4740_mmc.c @@ -18,9 +18,10 @@ #include #include #include -#include +#include #include #include +#include #include #include @@ -1040,7 +1041,6 @@ static int jz4740_mmc_probe(struct platform_device* pdev) int ret; struct mmc_host *mmc; struct jz4740_mmc_host *host; - const struct of_device_id *match; mmc = mmc_alloc_host(sizeof(struct jz4740_mmc_host), &pdev->dev); if (!mmc) { @@ -1050,13 +1050,8 @@ static int jz4740_mmc_probe(struct platform_device* pdev) host = mmc_priv(mmc); - match = of_match_device(jz4740_mmc_of_match, &pdev->dev); - if (match) { - host->version = (enum jz4740_mmc_version)match->data; - } else { - /* JZ4740 should be the only one using legacy probe */ - host->version = JZ_MMC_JZ4740; - } + /* Default if no match is JZ4740 */ + host->version = (enum jz4740_mmc_version)device_get_match_data(&pdev->dev); ret = mmc_of_parse(mmc); if (ret) { @@ -1200,7 +1195,7 @@ static struct platform_driver jz4740_mmc_driver = { .driver = { .name = "jz4740-mmc", .probe_type = PROBE_PREFER_ASYNCHRONOUS, - .of_match_table = of_match_ptr(jz4740_mmc_of_match), + .of_match_table = jz4740_mmc_of_match, .pm = pm_sleep_ptr(&jz4740_mmc_pm_ops), }, };