Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1932572pxb; Wed, 2 Feb 2022 16:19:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyyFcihCSM8xRrv3RBLJetdnJi4kL22rOqb1DM6aPBsy6HINNDxK2TpJpAg3gvxHFhxcFMN X-Received: by 2002:a17:90a:34c3:: with SMTP id m3mr11105164pjf.26.1643847561788; Wed, 02 Feb 2022 16:19:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643847561; cv=none; d=google.com; s=arc-20160816; b=P++c3HfpghyFMpXkynW4KKCx/UXrH4OW3WqYMmVrss9pljR000tiIkQz53lo5vxC9E ybJQTQstauuCqrOQo/v/x/WPV+QvJdhrqG+eXCWzMsmghCfHeeWGeTdWM6DikjQI9Lam foXOfQ3VqaHlHiDlP/ppCmprAkgQm9HV4TnzdleZRlf++W6UKWixjN4bRFHle+pzEg3r hPMd4ZzAAtOAm78oqkDfqqAcNEJtJazJspQoVGVCY/ygvwUroiWcSIRA9hxfpUhuZfor J8Yh70k/xVXghdbtGKuQutD23QPG2rkOBTZWPY/yx9rOWYEU9nhHM1SGv7dgmnKezvHH 3TnQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oqTmB0axPVxCTS0sxTTWZlHegO1uPd5y6swwpolQnGc=; b=KQsP++hxvnvvYPRqSn9CvCqyJHqs42eLlP51KabJEtkvgvlXKt1i/IJSjr5bXFDqxQ +bvC/07jIrP0G4MR2Y1DNNH7qX7e34Hk5tAlsX06y0rJoiMUm9Nn5ukuR86MwK5CTtSe iv/9J+92RgIKcdfkqOOZk7El7DPvEo4HQuM1wV7bDPE8LAaxq1uAK9PaCBJJtZtM88p0 DNLx8p4qQIIhnz4jLgdRWpTTYZLH/mOjWRYSKPRNHHf78jq8QRIX/GihK8ah+YzD6kHX TJdwpdwIP2hzoCzrH0/E6gE3WTLODyhUrmXngQOM2u+WwXslWj3frB/3MTQgDW26Rszf p3cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=P8jc1aWc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17si21221560pfe.381.2022.02.02.16.19.06; Wed, 02 Feb 2022 16:19:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=P8jc1aWc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344712AbiBBSHD (ORCPT + 99 others); Wed, 2 Feb 2022 13:07:03 -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-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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; -- 2.25.1