From patchwork Thu Jan 7 09:11:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 12003255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34D6BC433DB for ; Thu, 7 Jan 2021 09:05:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BAF9B23120 for ; Thu, 7 Jan 2021 09:05:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAF9B23120 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SwclUk6k5EyE8TfPZbzAs/TvVDyZnk6uIdfcnVWJYHk=; b=yUMBNsVYZKbLjmJWEeDC+o2k/ kVKzniliSZ6+Axa4U/iT33BL8QSkA6FMYyLSZHzWK2t0MWRfDog2leBlqwpNOGIRSbM8+pJF/E8x6 OqLUAHA8Ara7qXBWWEAw8BU6VEl6VpVAIJZn7K6lGjor+n1vmTjXcGbm85c9LzKXXgjWzhBGVKQmn Gp4PN4ls8wEHEtGa3ulTvkTo+QPE1z52gvK1EV6NjtQCSlpRL+x9kzAGOonKrXnTxJoeS5sw7lnge aTdK1kF0lfEPOrnNe4UkHGSqISgprrC6K/Xxn2MiBrmHh49P6P4E39mwvwhG9uKiBdnyNLJTLONNi LBbKZA1dQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxRCM-0004If-QG; Thu, 07 Jan 2021 09:03:14 +0000 Received: from mail-eopbgr00077.outbound.protection.outlook.com ([40.107.0.77] helo=EUR02-AM5-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxRC4-0004Ba-58 for linux-arm-kernel@lists.infradead.org; Thu, 07 Jan 2021 09:02:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e2E2yTjx+eX9nev9F1wdOC/EsVLuTXoSrwvX2dr3MMW6Re8WRb3Vty5iKlrooANU7TO26tJqq3hFIJnra7L8ltoAs+wZmjUFcepNG7nc29QUSec3ivLnYpVflJ76NlKYX69MCrTk07faFQFF+wPY0IED4QcwO82Ldbx0CkmwYeiLuxPQHaKpxTKuijffJLZxIdwwqBRG/CkBM6f7ARWOUO/IG6GoWCYLmvMvhSOR8VWaGqHkS1wSGlx0MBwbWs+UUMsNIAM3gAphACOFaSruuwi0Kqc0fxl0Q3gv7CTaNQiACcra/Dpv3gnw0DngPWaHjIzPtd3br6UtzeFyGW6fiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xlvHZfJZIwzcSkOnZnqPa3+7Mf5EUr5UIPNkC9HD+Yw=; b=VtjLZTYeE1L7XZ9mHaRGA/sasu2VZIQVrSsO/wQXemdi/qGzCNjP0bjw0xUt6Q3LY0v/DGZjmMqMNXsbP+MIfUCz6PNZWxqyLgC3c08wHMFcQe/y3Dzcqq/yVvoSzTLT/SHWpdrmtVpjFH9h0ZZyEECm7yJJDSnmdQeDsuuBYJgkuWJdwBZgvKGpJdO+E3yiPjyT57g4zmbsRCSnzErvaVHsoJjdR7emPsDvTsEdnCkZ2lyZ1sxvScH9HIXBgHNVRbVYkov2bY/7TRSUc/kqB/YzlFixbor5BRSwQL09PIrFRRnZEXTXIck3knZVaLpqR8vt82J0/d8dJMk2bxUqmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xlvHZfJZIwzcSkOnZnqPa3+7Mf5EUr5UIPNkC9HD+Yw=; b=Z9MHZ/szCDVOOIMlVKVfMfTYkTYB2drLrK9dtx07r8yp9vJ8uJv0Cz8OCB/lTTufD0Red76sm/JE+HTQea16vSYjgWZTtlvZPMuWE7Zdi7hA+0Ish2kIMueyvuBc0xI8Bp0FzE2Cd9utjYzvAUS5yfBwDMME4L/mhTiJh6iddb4= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from HE1PR0402MB3371.eurprd04.prod.outlook.com (2603:10a6:7:85::27) by HE1PR0402MB2731.eurprd04.prod.outlook.com (2603:10a6:3:d7::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Thu, 7 Jan 2021 09:02:53 +0000 Received: from HE1PR0402MB3371.eurprd04.prod.outlook.com ([fe80::3194:64d6:5a70:a91d]) by HE1PR0402MB3371.eurprd04.prod.outlook.com ([fe80::3194:64d6:5a70:a91d%4]) with mapi id 15.20.3721.024; Thu, 7 Jan 2021 09:02:53 +0000 From: Zhiqiang Hou To: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@axis.com, lorenzo.pieralisi@arm.com, robh@kernel.org, bhelgaas@google.com Subject: [PATCH 3/4] PCI: dwc: Rename callback function func_conf_select and its instance Date: Thu, 7 Jan 2021 17:11:22 +0800 Message-Id: <20210107091123.8616-4-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210107091123.8616-1-Zhiqiang.Hou@nxp.com> References: <20210107091123.8616-1-Zhiqiang.Hou@nxp.com> X-Originating-IP: [119.31.174.73] X-ClientProxiedBy: SG2PR06CA0085.apcprd06.prod.outlook.com (2603:1096:3:14::11) To HE1PR0402MB3371.eurprd04.prod.outlook.com (2603:10a6:7:85::27) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.73) by SG2PR06CA0085.apcprd06.prod.outlook.com (2603:1096:3:14::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Thu, 7 Jan 2021 09:02:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 033fc5b0-3f56-4867-355d-08d8b2eb0491 X-MS-TrafficTypeDiagnostic: HE1PR0402MB2731: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mmzCs2hLhybv6TZX7IGklhFTw9AJvvHJ+d7xkcvvzFWHb7lxDKRWr+18nTB3bzZowwOhBYNn0OOjbGjNAMtGawSrxmO3BMmR+IiuW4nzK/X4tXuFoffRcPhboLu+lavu5Y1Xz6CndC/WE52EbbcpoEvHQqJaBy1Zu8xbOiMcx+VuYMH9XUJCz1Y01QU2G4XgUPhjvH2Om7l7kyT8Ulp1gu56ufxT4JIPo1ZIZCHC0EyXZQFy0nyoJhaKTFH7+LSmU2RKgMQbnNBtwJRZeP//v8aszQSNcP2XFcjjRomol6Zsc2g74mi6ywaQ5bf7PlSIPyVqzZjcNqg8v7EVtmQnAzeK6cdVB1Y+QTkf1LkhKy+Nvg1/mEmtI/Qd4FvPXxRAeF32ejAi+ds4Rgpf5sCrsU0ICXRGx1xfCP/I406CDZJwhM8I5YbwDrAQfHVDl0YKT/rXBlp3ljTdWQZA3VDrxw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HE1PR0402MB3371.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(366004)(376002)(396003)(346002)(2616005)(66946007)(16526019)(66476007)(66556008)(186003)(52116002)(86362001)(69590400011)(478600001)(956004)(7416002)(2906002)(26005)(8676002)(316002)(6486002)(8936002)(4326008)(6506007)(6666004)(1076003)(83380400001)(5660300002)(6512007)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 7toAhuEU6OWYCbPOGksaIIBr0nNKNgFdD5g1N4+hQg5lZji0mZUV34KSfvqE9G2b3uIJqvvtTGFsjGccKYRSLy8BMnbVTnHKBrebmKNF/oXclTB1r6vO/eakLFobVV1cF0G9XdyT2gKWVCFFR1jAWpXOw2QW/mygmajS9HMUvz22yRliisnN09C4lxtcNHnvmOsc/L/awk/5uhmgAb8hS+y1Qqt319lRIk6UrGrnnx8/2cUokGDbZ5e7bEnQAjAh9dxGShVJnao0pNwlvTyP8psitrWjTiWKtiN6A3t7q5fjjyAkw71j43ganXO7zAGPY5Q2kt0ffhKM965ZKAAPyj/qTaQDjeWCJQd1FaMokjNjwjauZWD6Ps1MGPgRQZBaGk2K4fQy4RtT2PBv7QNkRlNCtYCGXHGoviOYIarqp/hBNfd2t7pOjPVa3ElxNFMGfOOcjAn46+ifIB7VQ3HXn64lOcJrecdCQrhf0YIRvrDJUrLfknLUp6kiCRvZtkfBipyPOy+1U4pQ+kUh2sjEIWIpxsEjNnxPdzcZamaqwJuvPc4T8SDbV0rkplUCtalhUzyX+EWyzbgLxiFMVpmXMrIosPDnn5DsI8SKSTL9CfsxKgiAEWVQQNUVUC2ASjY+WvwwrCofhgyFkkny7QOLl1gyGHr+mCN0A5fmxfLO+4rbGqkhNqxhKY1Vg1qe0jjqdAfmiSnI7lrZ+KENCNhp3WWVfKOcZVgBL+ZlNtLu4MePuVIzGzXyMJ7G6HpoLcISinFGv+h1MllPdRYCtR6Zh4aAPRAMqHNf26ujTZQi+zs2LO7dDh6bB2If7EyyN8y1MLXlpkB18C9YzyXHEEWSoYhIjsMMnhRI22XmyLtW3OGQkXd+DIUmVitPQwTyUav0yhSWUjzMuvocvLa2dvhAaNXpduz534VLLXjFUZLWYOrJL/syJHSMwzF75Qsv4zmCwYIzGukKvnm3y0bHvJ+zU4LJRbFtmjDJa2nsnuY6mlgBaqGMw/ekEOfrUEOKz7DN X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthSource: HE1PR0402MB3371.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2021 09:02:53.5799 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 033fc5b0-3f56-4867-355d-08d8b2eb0491 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GTjQGytZK04Q/riacG0M93mb6YJA0cX96aPBhCFMWVGWMrqxjUXge2fY3jFgk0W2qXi0EKqd5dCI/r0nP2b2Pw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0402MB2731 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210107_040256_274227_6EFE7B6E X-CRM114-Status: GOOD ( 17.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jesper.nilsson@axis.com, hayashi.kunihiko@socionext.com, jingoohan1@gmail.com, Hou Zhiqiang , kishon@ti.com, minghuan.Lian@nxp.com, gustavo.pimentel@synopsys.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Hou Zhiqiang Rename the callback func_conf_select() and its instance and wrapper to *get_func_cfg_addr(), such that the code becomes more readable. Signed-off-by: Hou Zhiqiang --- drivers/pci/controller/dwc/pci-layerscape-ep.c | 6 +++--- drivers/pci/controller/dwc/pcie-designware-ep.c | 9 +++++---- drivers/pci/controller/dwc/pcie-designware.h | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-layerscape-ep.c b/drivers/pci/controller/dwc/pci-layerscape-ep.c index 4d12efdacd2f..0f5e4104c06c 100644 --- a/drivers/pci/controller/dwc/pci-layerscape-ep.c +++ b/drivers/pci/controller/dwc/pci-layerscape-ep.c @@ -87,8 +87,8 @@ static int ls_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no, } } -static unsigned int ls_pcie_ep_func_conf_select(struct dw_pcie_ep *ep, - u8 func_no) +static unsigned int ls_pcie_ep_get_func_cfg_addr(struct dw_pcie_ep *ep, + u8 func_no) { struct dw_pcie *pci = to_dw_pcie_from_ep(ep); struct ls_pcie_ep *pcie = to_ls_pcie_ep(pci); @@ -101,7 +101,7 @@ static const struct dw_pcie_ep_ops ls_pcie_ep_ops = { .ep_init = ls_pcie_ep_init, .raise_irq = ls_pcie_ep_raise_irq, .get_features = ls_pcie_ep_get_features, - .func_conf_select = ls_pcie_ep_func_conf_select, + .get_func_cfg_addr = ls_pcie_ep_get_func_cfg_addr, }; static const struct ls_pcie_ep_drvdata ls1_ep_drvdata = { diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index bc6ad1f96a48..d8eb9a984547 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -40,10 +40,11 @@ dw_pcie_ep_get_func_from_ep(struct dw_pcie_ep *ep, u8 func_no) return NULL; } -static unsigned int dw_pcie_ep_func_select(struct dw_pcie_ep *ep, u8 func_no) +static unsigned int dw_pcie_ep_get_func_cfg_addr(struct dw_pcie_ep *ep, + u8 func_no) { - if (ep->ops->func_conf_select) - return ep->ops->func_conf_select(ep, func_no); + if (ep->ops->get_func_cfg_addr) + return ep->ops->get_func_cfg_addr(ep, func_no); return 0; } @@ -730,7 +731,7 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) for (i = 0; i < epc->max_functions; i++) { funcs[i].func_no = i; - funcs[i].cfg_off = dw_pcie_ep_func_select(ep, i); + funcs[i].cfg_off = dw_pcie_ep_get_func_cfg_addr(ep, i); funcs[i].msi_cap = dw_pcie_ep_find_capability(ep, i, PCI_CAP_ID_MSI); funcs[i].msix_cap = dw_pcie_ep_find_capability(ep, i, diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index 8ee67d4b8109..b8cbe266e01c 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -217,7 +217,7 @@ struct dw_pcie_ep_ops { * return a 0, and implement code in callback function of platform * driver. */ - unsigned int (*func_conf_select)(struct dw_pcie_ep *ep, u8 func_no); + unsigned int (*get_func_cfg_addr)(struct dw_pcie_ep *ep, u8 func_no); }; struct dw_pcie_ep_func {