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: 149439 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp634494vqo; Fri, 6 Oct 2023 15:43:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IENeGzW8nStjIbVS9m5N0u20yHXhoRRBMZv6dujXhvVz11d7ustSC/484d6O5qKvgGUN6Cu X-Received: by 2002:a05:6e02:1090:b0:34c:f2cb:b2c with SMTP id r16-20020a056e02109000b0034cf2cb0b2cmr8484720ilj.19.1696632239744; Fri, 06 Oct 2023 15:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696632239; cv=none; d=google.com; s=arc-20160816; b=tYlCyfkCoqJUhHnLkJNR3c9AUfvocXkV8GxUtf+bJMBQ6PwS9t4DUSXe7mHxE/Clrs i2Esr8NilxGL7IbIYUrBj8kX9ihmC82aFSSzQi1f++3/IYpyfx3kB6hLXemUVY37B9uC vvvUfScPmgJ1xaw5qYbrrsJg4S4XSxEBp+J56U63O5hePb3psCKDz5kfbLHztfSugmC9 BEcxa2oYkSE4ui8z3B+F3ZjbXTBSEvDb3PfQevItYlSFOrXmt5pRSBSMcs67aJWamkEw Umfs6Z7tNazXDVk1Tc0b69vBgh/B2saHl9QEtH4UYUFqeHLoUkVXGTouNJIz9CGdPx3M Y1Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=usxvPkggRH8deKY5SyZpcbQL2tuIqhVXhQTgPertOII=; fh=XRJ0gebQy2Yp9ev1qKoACBnPmF4Y7sNPKY8yIPxENfQ=; b=JBOuAIJOhNDl+ZqWjn0qxF4eIhGEIc7X5k+si/tAPXmsRMev++Ns3E3yYrueJWMR32 Ui1bgas0DC+Oe5fdZ9YdR44PSZaNzGTk9Bj+kGpgAwxOi8kkwJyj+8MKfAamsaf2CcD0 w+FKzJGYZ8gbcKk+0Qfx1NnvGO3FBVa2PirD4hSFQh3U2KrR3v3C6jdeV6jm3Fm1QEiZ bWR1s2M4gKLnC64e0HHUE4pyRgvxH5NsmL6mg2zwwpywhQPn25xoW9MTa2E7qP8c6c3Q 7IMNHCzYplqKGoaRP4+eNEJ8il1ZdTPSbruHCB9ejPqGo4LHoe1lJU+izHPQsLUQ5qQp 6Lcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vx3Jjwep; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y185-20020a638ac2000000b0058988999c70si2685813pgd.165.2023.10.06.15.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 15:43:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vx3Jjwep; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CF8838137692; Fri, 6 Oct 2023 15:43:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233762AbjJFWnu (ORCPT + 18 others); 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 06 Oct 2023 15:43:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779047847506520123 X-GMAIL-MSGID: 1779047847506520123 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), }, };