From patchwork Tue Nov 23 15:37:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fan Fei X-Patchwork-Id: 12634487 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 9CECEC433EF for ; Tue, 23 Nov 2021 15:38:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231344AbhKWPlU (ORCPT ); Tue, 23 Nov 2021 10:41:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237066AbhKWPlT (ORCPT ); Tue, 23 Nov 2021 10:41:19 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F12CC061574 for ; Tue, 23 Nov 2021 07:38:11 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id p18so19086272wmq.5 for ; Tue, 23 Nov 2021 07:38:11 -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=7h7rcOGOfizWdjjC0AXruzevZZll8UqDG0otjXjxUQA=; b=aB3pqOE/nb5+OctjJsSIAyLYqNUL0a4dV3rx57exPvBnWvd2DXMhLbpzCAJWE5vnyz mNcGAC+RZgWCrmxzskb5KlzG/8l78IuR0OLxK0KRAmnsaNwlB1JE+hQvmkKFANY1xhY4 v9aH3+75wCDzH7U2AXasx095UXl57zDKrEXiXv3sv3zCVsG3pkNGTzfrDsuCp6VO522z eRIxe0s+vNAbVL2+DuFlZJuAS0wQyX3HlgikexnsrUmMIPNpz+j+c2XJsglMMgXpF/js Pl0vZK9xgiXLsKoqcKnrIXgysxSfmDdbZv+GRPMu6ia6XSh6X52TNr2Cutq835zjUwFU 4VvA== 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=7h7rcOGOfizWdjjC0AXruzevZZll8UqDG0otjXjxUQA=; b=eVW+X/jXuS2Ldsw/nrVGSQy9kHKWfhQ5KTwQaOnNyrmum+mc9U/TlT0nQq1Xp/Qs60 eD+bxVU5D9adIm1Q8S6aYP5nwN8RPaxATzQYocgPymHzsMFsGpxYk8DPKTph2l78geK5 yT7hziFIOV/OIvjM36QsvEQ5BgRqCM6viXV6N0WmZLI4ZIU432jvMp+5jc+iGKTJBXC+ 6sNYbQWJNrP4CbmHvKF/SrBoqDs80gbxHK7nS+0ngawK6rsHDF63EUXJEoZpAm93uoB+ Nzqi67j0u8usor5Vxd6IT8MWq4QR6tYbwKEo1S+4byUA+7lvsgn/sHKKIkISk2MV5qs+ w6yw== X-Gm-Message-State: AOAM531y2ateg3O3UwqAFTzEu75s0i8FiRRjui/hiQODcAioYcM6K14G rXSQIbjsP6tX64tfvmSfKXU= X-Google-Smtp-Source: ABdhPJxOthbjS68jIQxrrpVnzKx4oyowzNbodrRB7fakNKDSDHej+aTtcDDPLJQIa7rDfcMT8vEFtA== X-Received: by 2002:a05:600c:3516:: with SMTP id h22mr4181714wmq.62.1637681889750; Tue, 23 Nov 2021 07:38:09 -0800 (PST) Received: from claire-ThinkPad-T470.localdomain (dynamic-2a01-0c23-b916-4400-b786-57bd-b8fa-4b8b.c23.pool.telefonica.de. [2a01:c23:b916:4400:b786:57bd:b8fa:4b8b]) by smtp.gmail.com with ESMTPSA id h15sm1959273wmq.32.2021.11.23.07.38.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 07:38:09 -0800 (PST) From: Fan Fei To: bjorn@helgaas.com Cc: Fan Fei , linux-pci@vger.kernel.org Subject: [PATCH 1/7] PCI: altera: Prefer of_device_get_match_data() over of_match_device() Date: Tue, 23 Nov 2021 16:37:56 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The altera PCI controller driver only needs "struct altera_pcie_data *" during probe(). Replace of_match_device(), which returns "struct of_device_id *", with of_device_get_match_data(), to get "struct altera_pcie_data *". Signed-off-by: Fan Fei --- drivers/pci/controller/pcie-altera.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c index 2513e9363236..98ada2e20e02 100644 --- a/drivers/pci/controller/pcie-altera.c +++ b/drivers/pci/controller/pcie-altera.c @@ -767,7 +767,7 @@ static int altera_pcie_probe(struct platform_device *pdev) struct altera_pcie *pcie; struct pci_host_bridge *bridge; int ret; - const struct of_device_id *match; + const struct altera_pcie_data *data; bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); if (!bridge) @@ -777,11 +777,11 @@ static int altera_pcie_probe(struct platform_device *pdev) pcie->pdev = pdev; platform_set_drvdata(pdev, pcie); - match = of_match_device(altera_pcie_of_match, &pdev->dev); - if (!match) + data = of_device_get_match_data(&pdev->dev); + if (!data) return -ENODEV; - pcie->pcie_data = match->data; + pcie->pcie_data = data; ret = altera_pcie_parse_dt(pcie); if (ret) { From patchwork Tue Nov 23 15:37:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fan Fei X-Patchwork-Id: 12634489 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 252FCC433F5 for ; Tue, 23 Nov 2021 15:38:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237066AbhKWPlV (ORCPT ); Tue, 23 Nov 2021 10:41:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238474AbhKWPlV (ORCPT ); Tue, 23 Nov 2021 10:41:21 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAB6BC061574 for ; Tue, 23 Nov 2021 07:38:12 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id d24so39747781wra.0 for ; Tue, 23 Nov 2021 07:38:12 -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=YMu/QHi9PWMtTOr57k7Enm5+z/lmpZGy5PwjeKee51Q=; b=R3z6k5NZv38JhcPerXsLBKVEyJYDDfN7NQ7CNiJszXtm//OT1OWTmamSTEfbdP2CL1 AWuBewuRunC+7OZH5Sfsx4Vxs1RBcXhq0bUc0MIL8a3w/8f4cTnne5yyDtbaR/tXUXtf e1E5ieCSznB/sGZop6EF0fMjgFRsAyNS9u+WAf4Y00Y2T1GvqEZhiT2Zb1ULZsPp8GI1 H7a9ak05QY66p/93dp3bmTTHWQxLScG7v81eYbrgLmWvzRGWa5Efh07zga5XOwSwBPIy 2ZCW3B+dgYYbJRNcJYkg4bfVd/9KgFl824n+09soNKX3EsJT6WsnLheoED7KFuuBD3LO z15A== 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=YMu/QHi9PWMtTOr57k7Enm5+z/lmpZGy5PwjeKee51Q=; b=sL75ck58685GjJSNfA3l7QJRGsliBqjZBnK/7WC/Sts0RNb+OAbaAh5+vBblI29463 3qNna0D2Gs4JX6D0EWUItAu+ZQZDeUwrgGvfbuhIdq5MgkY3z7XW8hDLI8azUE3ZKiKF 9GzcILs4NxtQUHcehqBDyvyfzRJXvOqdjtR7zlPalM6Eh2a/Au6/4vVzODGQEC2vUPf9 yWDIdb7xxGTDpmn3YVViqycKPYB60Wbm3it//g0cg88MCWWeuBTY+gGmQ1KwIvT0+zp1 ipkHk5MsS/CjZC9wUEBqKBWt+UB7l+soIWETb3lb0QALNEHsGWCKQuM+vIGKi9Wha5Uy /LJw== X-Gm-Message-State: AOAM531c+1zrtERNfpJMUGj1KcD8Fa3ehQi703ug38uv6/5uoXBCsFad ai+QZBwMP6knhxQDeJsNQ2zNw3LN3RxuHQ== X-Google-Smtp-Source: ABdhPJzFQk3V6t6IbYbbXNTtioG8b58pt2DLr8SuigWDCsGkJEvYQWjcqGKP18T+PLHqbouNnzHNIA== X-Received: by 2002:a5d:49c3:: with SMTP id t3mr8262314wrs.207.1637681891442; Tue, 23 Nov 2021 07:38:11 -0800 (PST) Received: from claire-ThinkPad-T470.localdomain (dynamic-2a01-0c23-b916-4400-b786-57bd-b8fa-4b8b.c23.pool.telefonica.de. [2a01:c23:b916:4400:b786:57bd:b8fa:4b8b]) by smtp.gmail.com with ESMTPSA id h15sm1959273wmq.32.2021.11.23.07.38.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 07:38:11 -0800 (PST) From: Fan Fei To: bjorn@helgaas.com Cc: Fan Fei , linux-pci@vger.kernel.org Subject: [PATCH 2/7] PCI: cadence: Prefer of_device_get_match_data() over of_match_device() Date: Tue, 23 Nov 2021 16:37:57 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The cadence PCI controller driver only needs "struct cdns_plat_pcie_of_data *" during probe(). Replace of_match_device(), which returns "struct of_device_id *", with of_device_get_match_data(), to get "struct cdns_plat_pcie_of_data *" directly. Signed-off-by: Fan Fei --- drivers/pci/controller/cadence/pcie-cadence-plat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/cadence/pcie-cadence-plat.c b/drivers/pci/controller/cadence/pcie-cadence-plat.c index a224afadbcc0..bac0541317c1 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-plat.c +++ b/drivers/pci/controller/cadence/pcie-cadence-plat.c @@ -45,7 +45,6 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev) { const struct cdns_plat_pcie_of_data *data; struct cdns_plat_pcie *cdns_plat_pcie; - const struct of_device_id *match; struct device *dev = &pdev->dev; struct pci_host_bridge *bridge; struct cdns_pcie_ep *ep; @@ -54,11 +53,10 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev) bool is_rc; int ret; - match = of_match_device(cdns_plat_pcie_of_match, dev); - if (!match) + data = of_device_get_match_data(dev); + if (!data) return -EINVAL; - data = (struct cdns_plat_pcie_of_data *)match->data; is_rc = data->is_rc; pr_debug(" Started %s with is_rc: %d\n", __func__, is_rc); From patchwork Tue Nov 23 15:37:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fan Fei X-Patchwork-Id: 12634491 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 8B4B2C433FE for ; Tue, 23 Nov 2021 15:38:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238477AbhKWPlW (ORCPT ); Tue, 23 Nov 2021 10:41:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238473AbhKWPlW (ORCPT ); Tue, 23 Nov 2021 10:41:22 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56608C061574 for ; Tue, 23 Nov 2021 07:38:14 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id i12so19113122wmq.4 for ; Tue, 23 Nov 2021 07:38:14 -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=i9wk5q1358/5Vlb56q2MYNKy0d2YBmk+eon1csfd8FM=; b=M2AX13dlw+7wLdodh5vsTckcKtzjf9M0ypxqromaa1VyajkbR2ekvrhMoz4CA1cZKV AH4os3AQczHrov14bjL7d6w8wvk0PoPrEBj996yuG6kHXhUxQjGCZ/BP/hCBYRSLeyJ2 IjgE/Tvw1JWs1NnVBR7AdpOXWnIA3CUEasgm8AiJfgrM8rW2u5JUAJwKfrcnj/pIoO5F 9V6n63pMw9SlR8ztUxap8Nd59FNwhyyuxX5kvvrQIHKkO+DXzDGudGqeynW0jRGAUzZ4 SCcj8JtcCNkTIao0GaQRD7J+bf1jzvOnCVCcnMXQvAG1y7H8P559JCegKxt2XJXUC7b+ dU1Q== 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=i9wk5q1358/5Vlb56q2MYNKy0d2YBmk+eon1csfd8FM=; b=UtnIO+7EPf2ptJ8tjPNAB96TcFV/RQCqjx6qPfr9NjC096kib69o0l/P5OVj7PcymK JHny3BEWhmPkHNxT3AQezPTeTAMrPX7sGn+62ubdC9x8SMYsPaMbPz7vQnHOcoXcqyw0 K8oGeuM80XGPxIguR5Mof1iHyLBjLS18u/OnQWaiGeklFoUkCv0OOjMEHM1U56UiAP5e +IM4A0hCyzo5qpGPNUGwu4ZPh1mmW03FyS8e28Zr+/TaipsNa8zzY4pjX6KXYfbLJsPQ 08GGWLvcUqA1zgLNWOjFxu36pAIo3C0E3lIUDNFZNR+HwENyquvjoUP+LoWV7EpMpk5C wxnw== X-Gm-Message-State: AOAM530mmHAdzVhmu4824dhdPgob1Ka22H4nMX86u73e83xbAEvYQ3Im Y4AlZUEAB5cu+LkOeMiLg8M= X-Google-Smtp-Source: ABdhPJyOGgpslq5R4gMR1MgO6MjdRE1S/WlNt6I5QD123/kUBIx0wctMwYzn5pgwZLMQcqJQHs2+kg== X-Received: by 2002:a1c:a592:: with SMTP id o140mr4326468wme.10.1637681892879; Tue, 23 Nov 2021 07:38:12 -0800 (PST) Received: from claire-ThinkPad-T470.localdomain (dynamic-2a01-0c23-b916-4400-b786-57bd-b8fa-4b8b.c23.pool.telefonica.de. [2a01:c23:b916:4400:b786:57bd:b8fa:4b8b]) by smtp.gmail.com with ESMTPSA id h15sm1959273wmq.32.2021.11.23.07.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 07:38:12 -0800 (PST) From: Fan Fei To: bjorn@helgaas.com Cc: Fan Fei , linux-pci@vger.kernel.org Subject: [PATCH 3/7] PCI: kirin: Prefer of_device_get_match_data() over of_match_device() Date: Tue, 23 Nov 2021 16:37:58 +0100 Message-Id: <68f844d7a481ade650c9bcce77f553efb9df01b4.1637678104.git.ffclaire1224@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The kirin PCI controller driver only needs "enum pcie_kirin_phy_type" during probe(). Replace of_match_device(), which returns "struct of_device_id *", with of_device_get_match_data(), and cast to long type, referring "enum pcie_kirin_phy_type". Signed-off-by: Fan Fei --- drivers/pci/controller/dwc/pcie-kirin.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c index 095afbccf9c1..8d6e241bd171 100644 --- a/drivers/pci/controller/dwc/pcie-kirin.c +++ b/drivers/pci/controller/dwc/pcie-kirin.c @@ -773,7 +773,6 @@ static const struct of_device_id kirin_pcie_match[] = { static int kirin_pcie_probe(struct platform_device *pdev) { enum pcie_kirin_phy_type phy_type; - const struct of_device_id *of_id; struct device *dev = &pdev->dev; struct kirin_pcie *kirin_pcie; struct dw_pcie *pci; @@ -784,13 +783,12 @@ static int kirin_pcie_probe(struct platform_device *pdev) return -EINVAL; } - of_id = of_match_device(kirin_pcie_match, dev); - if (!of_id) { + phy_type = (long)of_device_get_match_data(dev); + if (!phy_type) { dev_err(dev, "OF data missing\n"); return -EINVAL; } - phy_type = (long)of_id->data; kirin_pcie = devm_kzalloc(dev, sizeof(struct kirin_pcie), GFP_KERNEL); if (!kirin_pcie) From patchwork Tue Nov 23 15:37:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fan Fei X-Patchwork-Id: 12634493 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 14B23C433EF for ; Tue, 23 Nov 2021 15:38:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238473AbhKWPlY (ORCPT ); Tue, 23 Nov 2021 10:41:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236928AbhKWPlY (ORCPT ); Tue, 23 Nov 2021 10:41:24 -0500 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAA42C061574 for ; Tue, 23 Nov 2021 07:38:15 -0800 (PST) Received: by mail-wr1-x430.google.com with SMTP id i5so39733260wrb.2 for ; Tue, 23 Nov 2021 07:38:15 -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=ASSotiF2cSkOj3gpIahmP5n1YFsWO59L2r5BleZzS48=; b=m+dHVEqHiNpekRlEhfyDp4MU1D8mx8CoY52yMiUjeLZfdMJ2GWiIDqaqdLd5qp/68O 4fFbapNZ8wV819LdMOATSCym8ynRLNMGt3GqAT3reJPmcnrNeCpARJO3iZSM9pGg1xoY /nsn6zZoeLktqiqk0MjZo0TZHegfitUSH4Bf2ynUcaE7dS5EtDtF0aO/xQn+cAZvgw8R cMEhDonN1qq8tae0Wp9N1TarM3waZC7ktRzHEHHKhJ5tTRc85gDePt3pJZQEsEhN+xvi 2nsgGrZYZUKgRwAmoSNnJdxG/jvfsEqSrQayb/rfFvBhCNukWkes3Rq2MU9BRUl4M/vK Aiug== 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=ASSotiF2cSkOj3gpIahmP5n1YFsWO59L2r5BleZzS48=; b=B1GAX2tY+LaTeRlHoMJdI6Mkndl/g1V6Q+twLukyK9Dyc2qS6JeyK/uHBje/C8V+dp QgFgnG90O7iXEgJistwZVdi5+bfTx2FhYF81UlrAanqchAe2FVWV7bWEGiSHaCLw3zOR yBQIlwKcvliuG65EaIGFydN7fS6vh/NxBJmGWlJzrD/jfuR/SmNJHfa2WZ/kgjW51b33 pAzK4+BqYNAQkIkwaloaGPpBYsZGAFF3d8SGduZZX6qRrKzjurMN/kEuDQgz5LtCXKzz verMhJQLVxZWz8eWTBrWK7vK/NDJhxFI18pwNc2Bjwm9JsqPWokXtnDYF4eIDZd5W+Xa 8TIQ== X-Gm-Message-State: AOAM530jZ0ME32D8Gx8N5aMNQkocp8VxK3cSIrmX0yv3HajVJZ+Q6C0P RHyXvWqOy6xNF/C2AXKYqmivQDMtu7E0RQ== X-Google-Smtp-Source: ABdhPJyF+iq/I2z84C8f9HHsBQSJ2nVFChurV+kxciIEQQkcPMpYGFY0t1C/1JyAKHF3r0MZIOGGQQ== X-Received: by 2002:a5d:584e:: with SMTP id i14mr8690966wrf.386.1637681894202; Tue, 23 Nov 2021 07:38:14 -0800 (PST) Received: from claire-ThinkPad-T470.localdomain (dynamic-2a01-0c23-b916-4400-b786-57bd-b8fa-4b8b.c23.pool.telefonica.de. [2a01:c23:b916:4400:b786:57bd:b8fa:4b8b]) by smtp.gmail.com with ESMTPSA id h15sm1959273wmq.32.2021.11.23.07.38.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 07:38:13 -0800 (PST) From: Fan Fei To: bjorn@helgaas.com Cc: Fan Fei , linux-pci@vger.kernel.org Subject: [PATCH 4/7] PCI: dra7xx: Prefer of_device_get_match_data() over of_match_device() Date: Tue, 23 Nov 2021 16:37:59 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The dra7xx PCI controller driver only needs "struct dra7xx_pcie_of_data *" during probe(). Replace of_match_device(), which returns "struct of_device_id *", with of_device_get_match_data(), to get "struct dra7xx_pcie_of_data *" directly. Signed-off-by: Fan Fei --- drivers/pci/controller/dwc/pci-dra7xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c index a4221f6f3629..12d19183e746 100644 --- a/drivers/pci/controller/dwc/pci-dra7xx.c +++ b/drivers/pci/controller/dwc/pci-dra7xx.c @@ -697,16 +697,14 @@ static int dra7xx_pcie_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; char name[10]; struct gpio_desc *reset; - const struct of_device_id *match; const struct dra7xx_pcie_of_data *data; enum dw_pcie_device_mode mode; u32 b1co_mode_sel_mask; - match = of_match_device(of_match_ptr(of_dra7xx_pcie_match), dev); - if (!match) + data = of_device_get_match_data(dev); + if (!data) return -EINVAL; - data = (struct dra7xx_pcie_of_data *)match->data; mode = (enum dw_pcie_device_mode)data->mode; b1co_mode_sel_mask = data->b1co_mode_sel_mask; From patchwork Tue Nov 23 15:38:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fan Fei X-Patchwork-Id: 12634495 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 63E5AC433F5 for ; Tue, 23 Nov 2021 15:38:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238479AbhKWPlZ (ORCPT ); Tue, 23 Nov 2021 10:41:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238474AbhKWPlZ (ORCPT ); Tue, 23 Nov 2021 10:41:25 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3510FC061574 for ; Tue, 23 Nov 2021 07:38:17 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id ay10-20020a05600c1e0a00b0033aa12cdd33so2178831wmb.1 for ; Tue, 23 Nov 2021 07:38:17 -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=+KlMAHaUOUgQ3F2U2z8IWCKXJhS3v/qnFhjYKYTFmaU=; b=F05DtYWgK4h13mFNGjyhs9gUOLIOUcxRxHlFFe1vRUw+hKRfkwXC1h44tR+RB5p2nZ YfcLaamdzUKD0vCmg3bPtNn8RktNkFncGoeFQ04QuhK0eanGg6cUW8kO/7cy3kNT+hGq sh+G4b9zd0CWYeaJo9eWtD0bh8Bd99V8CR+1h2xMpZICfDzE6k78hP0Q4P5VV9mWsQOM K8hyg+TDbOC1fkZpxG2YKde1dJg1WQqRt8fE4JZY0GWs0HwgLqE9IqBmZQZUY8J/V8Nk SZWDRVAOsAf06A5k4jHuEGKebIyJcxCgLllcWjN1eypnaLP5K1yFFSrtRXLHQ+gAQnBl y8jg== 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=+KlMAHaUOUgQ3F2U2z8IWCKXJhS3v/qnFhjYKYTFmaU=; b=kdbTicxKQuMypkUOzxsUSwyPFf49lVDyVsM/6obiy+4ueqgMOQXl1GnRe2IIfp8sEE 8vP5ivKL7/0FgwpJIBD9SpAXH21t7QKDkzCRNspoqVvXaiSmSYNOWeLUX1f98FgpeosD ypX9wh6IKOL+DZr99Qs9oP+bj47EMOFYtnKp5+iNUu2CDQuvTanxQ2Huskrh47B3QQdw LIwOU5dJ70HN/AkTOwiGRKXbKNAeHUgCb9TH9Cx8g5N96ZV9EAkH1bkqpUCXlq2m+FX5 6qe+PPXAzFu+dSOK8urxTEA1WU4fy0fmprTXpFp5Ni3Nr87qj3ubIBJthRZIjspMArrM pGsA== X-Gm-Message-State: AOAM53394GURzdJHh1ESKhQJTOIwLTbatk6uXmThaS9/kQGWBrPMQywd 4a+WpM3HIZF34sbf0QHxfqZGFSG1FgzEZA== X-Google-Smtp-Source: ABdhPJxw5lBgkBurl2ZsHP6So+guw2VABKETKMqdLLgTlaLQxEnCr3UkYTtkW2n4b28i0ZFudGxzYw== X-Received: by 2002:a05:600c:896:: with SMTP id l22mr4131480wmp.127.1637681895623; Tue, 23 Nov 2021 07:38:15 -0800 (PST) Received: from claire-ThinkPad-T470.localdomain (dynamic-2a01-0c23-b916-4400-b786-57bd-b8fa-4b8b.c23.pool.telefonica.de. [2a01:c23:b916:4400:b786:57bd:b8fa:4b8b]) by smtp.gmail.com with ESMTPSA id h15sm1959273wmq.32.2021.11.23.07.38.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 07:38:15 -0800 (PST) From: Fan Fei To: bjorn@helgaas.com Cc: Fan Fei , linux-pci@vger.kernel.org Subject: [PATCH 5/7] PCI: keystone: Prefer of_device_get_match_data() over of_match_device() Date: Tue, 23 Nov 2021 16:38:00 +0100 Message-Id: <696b879b141c9ff6b2de21b6453be7999008f2d4.1637678104.git.ffclaire1224@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The keystone PCI controller driver only needs "struct ks_pcie_of_data *" during probe(). Replace of_match_device(), which returns "struct of_device_id *", with of_device_get_match_data(), to get "struct ks_pcie_of_data *" directly. Signed-off-by: Fan Fei --- drivers/pci/controller/dwc/pci-keystone.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c index 865258d8c53c..bf4755cb6c50 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -1087,7 +1087,6 @@ static int __init ks_pcie_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; const struct ks_pcie_of_data *data; - const struct of_device_id *match; enum dw_pcie_device_mode mode; struct dw_pcie *pci; struct keystone_pcie *ks_pcie; @@ -1104,8 +1103,7 @@ static int __init ks_pcie_probe(struct platform_device *pdev) int irq; int i; - match = of_match_device(of_match_ptr(ks_pcie_of_match), dev); - data = (struct ks_pcie_of_data *)match->data; + data = of_device_get_match_data(dev); if (!data) return -EINVAL; From patchwork Tue Nov 23 15:38:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fan Fei X-Patchwork-Id: 12634497 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 EA7EAC433FE for ; Tue, 23 Nov 2021 15:38:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236928AbhKWPl1 (ORCPT ); Tue, 23 Nov 2021 10:41:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235604AbhKWPl1 (ORCPT ); Tue, 23 Nov 2021 10:41:27 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAFDFC061574 for ; Tue, 23 Nov 2021 07:38:18 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id l16so1725084wrp.11 for ; Tue, 23 Nov 2021 07:38:18 -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=kOyOFHSB6oYKtXPvxxZdcgKTN+X0OKDN76Q1B//9ysI=; b=QCUwPlbzSszi9ly4glgcfjLd7c48fGUounsbby+cYxDBYVNyFw0FNoDNYssSne2Ohe nDN5cmnJaBWFZGc2Hhkbxnv3FGdG7Pk/2OwGVa6Mg3B2/uLBmH0dsotlSkOOvdSc6pig a4GjKrBQCT4iQn1BhpOmyRWVfyoJzpboU0EaoLuKh46pdFN0eUEiyGBQ8ORnrA2hqSHX VyDz4KD54EXpsSjaBcSVKhVtQwBKH2AfSJrzLAEVrS1LP35dzRAFEUwaf2tuBoHG9+fP Y2RUDRXU2gEM1DB+51ClIpCEFBw0vSP+fAPWL8VtjYc8M6kmUDQRlUTCE+ElrvAjo+GN eM4g== 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=kOyOFHSB6oYKtXPvxxZdcgKTN+X0OKDN76Q1B//9ysI=; b=Gc2P54DEMUG7K3VGGfD4UfdYDWTyVxrtyzEfvdKYoZ3zbuGvr+BNck9ixLP4ZyYebm 4KNmq8cqw7lRBNDfdu6x2nzr2juNvFAq7myUxCBo14J1arWLdkKGqsyeOkZBiQW/EJg+ Yc6G/+aXy3aUZntUBI/6au/tpGUJAFFv3f9Ys4Tz/zAvwIox+jS7DD5ZHbDtnGoJAU/e AdT10titJuAWz3d2lh2iCfJaQZfQoQs8yX+5ZMRNi415RZuISvRLtJWTnZNdJlaGtSrY XP/c1JTt7dA0Q4C7hr6lYj163+2i2Nf3nEg3k8+Odwgx8BE+KO3oIDr2amC7ZueKCzKH 3iZg== X-Gm-Message-State: AOAM532VkHOWtDLkVRzL2CploAxy/Iz8OXLx2CuQ28Osca5DVQJeLEqj EUmObxU+/Orkf5UGHQjmQMc= X-Google-Smtp-Source: ABdhPJz8rZJli9lsHIq5/ic2XRpKCSfGqQQjV9zclMz3HAyDwiw4wGAMjR4GFs0j6yNXM5O+vtTh+Q== X-Received: by 2002:adf:f88f:: with SMTP id u15mr6274088wrp.18.1637681897180; Tue, 23 Nov 2021 07:38:17 -0800 (PST) Received: from claire-ThinkPad-T470.localdomain (dynamic-2a01-0c23-b916-4400-b786-57bd-b8fa-4b8b.c23.pool.telefonica.de. [2a01:c23:b916:4400:b786:57bd:b8fa:4b8b]) by smtp.gmail.com with ESMTPSA id h15sm1959273wmq.32.2021.11.23.07.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 07:38:16 -0800 (PST) From: Fan Fei To: bjorn@helgaas.com Cc: Fan Fei , linux-pci@vger.kernel.org Subject: [PATCH 6/7] PCI: artpec6: Prefer of_device_get_match_data() over of_match_device() Date: Tue, 23 Nov 2021 16:38:01 +0100 Message-Id: <506cba227d09e1f94d9e34a81e7c2148fcaf5090.1637678104.git.ffclaire1224@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The artpec6 PCI controller driver only needs "struct artpec_pcie_of_data *" during probe(). Replace of_match_device(), which returns "struct of_device_id *", with of_device_get_match_data(), to get "struct artpec_pcie_of_data *" directly. Signed-off-by: Fan Fei --- drivers/pci/controller/dwc/pcie-artpec6.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-artpec6.c b/drivers/pci/controller/dwc/pcie-artpec6.c index c91fc1954432..2f15441770e1 100644 --- a/drivers/pci/controller/dwc/pcie-artpec6.c +++ b/drivers/pci/controller/dwc/pcie-artpec6.c @@ -380,17 +380,15 @@ static int artpec6_pcie_probe(struct platform_device *pdev) struct dw_pcie *pci; struct artpec6_pcie *artpec6_pcie; int ret; - const struct of_device_id *match; const struct artpec_pcie_of_data *data; enum artpec_pcie_variants variant; enum dw_pcie_device_mode mode; u32 val; - match = of_match_device(artpec6_pcie_of_match, dev); - if (!match) + data = of_device_get_match_data(dev); + if (!data) return -EINVAL; - data = (struct artpec_pcie_of_data *)match->data; variant = (enum artpec_pcie_variants)data->variant; mode = (enum dw_pcie_device_mode)data->mode; From patchwork Tue Nov 23 15:38:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fan Fei X-Patchwork-Id: 12634499 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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 6ABC3C433F5 for ; Tue, 23 Nov 2021 15:38:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235604AbhKWPl2 (ORCPT ); Tue, 23 Nov 2021 10:41:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237093AbhKWPl2 (ORCPT ); Tue, 23 Nov 2021 10:41:28 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2293EC061574 for ; Tue, 23 Nov 2021 07:38:20 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id r9-20020a7bc089000000b00332f4abf43fso2212976wmh.0 for ; Tue, 23 Nov 2021 07:38:20 -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=PkoKp/ZvjPVk5Z9+yOVdTSDtiH+0HB41JUhvuN2nIYQ=; b=VoIUS0MvsbnDKyiQWADq/97OPFhnhuORr68hhKIGt+0ngZmylLgUZVpym2dD5JscFL daJpZhKT9eqEQpv8tfy1QEwpaXXklN/F4iozOK66zKk7UAJXWK7XU8xi99dP/SVcJd8E BIvfBYFzT6+x9tcl7c+FkmIMe7ia8sWO76BJ12EHcC9qcQ3yRkvwubSrxcxGg5ENuwT1 S6foJ4OBkNumu4wO0KY9w8l3DkG7SgpYF1oqiGpHXysJrwMjhxQn658vyQxQkjUz/vwn AhxdL2rKf7CP5pqAORC3K2FWwpXGqBBKIaqFF6niiVOR1UDBrVpgFLouXkLepN2MBfNl mGPg== 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=PkoKp/ZvjPVk5Z9+yOVdTSDtiH+0HB41JUhvuN2nIYQ=; b=NsPhBddSWSbDHueGqFIq7v0B+HvT+plTW2dqUkfc1meNZ9me75Q4C8PsUnmH3uYvrh ZDL26s1SYpT63Xmha+dAPtdSI5rDMBSSelPD0HmBY1/3/x8qqus2kZJrDwXbLujsMsvd eHz4fLODK0YB40HGYhWHQqtdlDm4qVkHax5Vj6Uwv0i/n7OpCUG6Wob5f3z6FVMXAC3N Z6t0pZ6CMLWHrk5S0aP3Cc8wTdUYB3axr+IhSV+jh06ez6TDqrT8ctBPvnGe+TdBfG8q xyewaBgEWclGtxRDiqFKJ2mgVle87NQVtzT/3kIqitmkrBOxSc4BO7M6hVfB1prtnG9/ 2tRA== X-Gm-Message-State: AOAM5321Z6kZAxO2N0DkGqPiD3g/qzLsZynJjKjVstsUup/q9CE38sEV 4+tQ8e+6BYJRwIE//oxc0+hLHrKdEY5vYw== X-Google-Smtp-Source: ABdhPJx8RHEptXnKdVU5F54DGIx8IX93CoeCAAQ70U/KwUXDJeT4dPycXcEyoCA8GHUfosqG7TPxvg== X-Received: by 2002:a05:600c:17c3:: with SMTP id y3mr4042208wmo.136.1637681898693; Tue, 23 Nov 2021 07:38:18 -0800 (PST) Received: from claire-ThinkPad-T470.localdomain (dynamic-2a01-0c23-b916-4400-b786-57bd-b8fa-4b8b.c23.pool.telefonica.de. [2a01:c23:b916:4400:b786:57bd:b8fa:4b8b]) by smtp.gmail.com with ESMTPSA id h15sm1959273wmq.32.2021.11.23.07.38.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 07:38:18 -0800 (PST) From: Fan Fei To: bjorn@helgaas.com Cc: Fan Fei , linux-pci@vger.kernel.org Subject: [PATCH 7/7] PCI: dwc: Prefer of_device_get_match_data() over of_device_device() Date: Tue, 23 Nov 2021 16:38:02 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The dw_plat PCI controller driver only needs "struct dw_plat_pcie_of_data *" during probe(). Replace of_match_device(), which returns "struct of_device_id *", with of_device_get_match_data(), to get "struct dw_plat_pcie_of_data *" directly. Signed-off-by: Fan Fei --- drivers/pci/controller/dwc/pcie-designware-plat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-plat.c b/drivers/pci/controller/dwc/pcie-designware-plat.c index 8851eb161a0e..0c5de87d3cc6 100644 --- a/drivers/pci/controller/dwc/pcie-designware-plat.c +++ b/drivers/pci/controller/dwc/pcie-designware-plat.c @@ -122,15 +122,13 @@ static int dw_plat_pcie_probe(struct platform_device *pdev) struct dw_plat_pcie *dw_plat_pcie; struct dw_pcie *pci; int ret; - const struct of_device_id *match; const struct dw_plat_pcie_of_data *data; enum dw_pcie_device_mode mode; - match = of_match_device(dw_plat_pcie_of_match, dev); - if (!match) + data = of_device_get_match_data(dev); + if (!data) return -EINVAL; - data = (struct dw_plat_pcie_of_data *)match->data; mode = (enum dw_pcie_device_mode)data->mode; dw_plat_pcie = devm_kzalloc(dev, sizeof(*dw_plat_pcie), GFP_KERNEL);