Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1436477rdb; Mon, 2 Oct 2023 09:24:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFoDiobG3lyUW5NnvCvia4sZk9OXsLHrWMtWR8Gv45TMbRSebxq4BpjIamVcCVNgFhHG9lo X-Received: by 2002:a05:6808:1b06:b0:3a8:5fd6:f4d0 with SMTP id bx6-20020a0568081b0600b003a85fd6f4d0mr13804924oib.49.1696263895196; Mon, 02 Oct 2023 09:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696263895; cv=none; d=google.com; s=arc-20160816; b=xLjIO1Cphb28J/9SKMYI9xuhDJL2FdstUZ1gfPbUipo5B35wrLrKEtsqrmR6l+FzWb zpH8UgrYxuLAHL0wvT4GXcPLAQusKY8Z44ncbaj2gQDVAuH4gQT5a/+fq6Oa6ez68Qxo 17zTvEAXtbKCt7Xjeynp8xLD8DrUlBTCpbZKGyGoKLgnAVE2Kz2Aq4rvQhyYLkccv36Y mXmpw26vbEO6ObPAqgHVPdlmiiBhlZSEG4MbmrIjuEMGw3OKhxpiTpQVQDgu0ymRCWHa hLzUQS8UCK/EzA+woFyfqUqdY/zuD8nlV3uQZ5h7TJrBsXWA8K8c7925ARQTSl6Wc5oV 50sg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=HglsRUxf3vCoXV+FBpjGeQWGPF3QTAqsKDlaH7bKsvI=; fh=6T4zZ8HeN4FNvjm5k4DIT/y7+At3BG9x6FXMDOBhu9c=; b=f5NdKflbkbwdOELenimOSEP7ukWc4cHqh3oZKuGTMFvBmzE4ON8zM0+0e6DtRZMa57 2rw78tFZq/gBvJjo/iEcpOBaXp3//Bi41Y1G8SyjKaUqkwADqRDWsp/Hyzzsvs3Xq/Ow hkjFMkkilya2a7at5EewuGmhNplW/NDDn6EjoVLLy4mRb8sPjBT16MoM5u5EVxDd2MeM 0Jzn86K2rpNHmR/ekoEbLmu1TyCiCcLB/JuNGkZUKYrRTFH0pzQCX/HOShDpIo35Y7sH YM+pAMeAjF6yGIf5BIBumPCLhDpBVBMfMIwcN9xKMrslKfFhG757ZMXq2yUCtHbbHr+X s5og== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id l10-20020a65560a000000b00573f9d916fbsi27759191pgs.784.2023.10.02.09.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 09:24:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id A247F80746AE; Mon, 2 Oct 2023 08:01:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237940AbjJBPBa (ORCPT + 99 others); Mon, 2 Oct 2023 11:01:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237950AbjJBPB3 (ORCPT ); Mon, 2 Oct 2023 11:01:29 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 642E49F; Mon, 2 Oct 2023 08:01:24 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RzkdK54sXz6K62g; Mon, 2 Oct 2023 22:59:49 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 2 Oct 2023 16:01:21 +0100 Date: Mon, 2 Oct 2023 16:01:20 +0100 From: Jonathan Cameron To: Robert Richter CC: Alison Schofield , Vishal Verma , Ira Weiny , Ben Widawsky , Dan Williams , "Davidlohr Bueso" , Dave Jiang , , , Bjorn Helgaas , Terry Bowman Subject: Re: [PATCH v11 20/20] cxl/core/regs: Rework cxl_map_pmu_regs() to use map->dev for devm Message-ID: <20231002160120.000002a2@Huawei.com> In-Reply-To: <20230927154339.1600738-21-rrichter@amd.com> References: <20230927154339.1600738-1-rrichter@amd.com> <20230927154339.1600738-21-rrichter@amd.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 08:01:43 -0700 (PDT) On Wed, 27 Sep 2023 17:43:39 +0200 Robert Richter wrote: > struct cxl_register_map carries a @dev parameter for devm operations. > Simplify the function interface to use that instead of a separate @dev > argument. > > Signed-off-by: Terry Bowman > Signed-off-by: Robert Richter Seems reasonable. Reviewed-by: Jonathan Cameron > --- > drivers/cxl/core/regs.c | 5 ++--- > drivers/cxl/cxl.h | 3 +-- > drivers/cxl/pci.c | 2 +- > 3 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/cxl/core/regs.c b/drivers/cxl/core/regs.c > index 7b56f6f28ab1..b668be617fd7 100644 > --- a/drivers/cxl/core/regs.c > +++ b/drivers/cxl/core/regs.c > @@ -386,10 +386,9 @@ int cxl_count_regblock(struct pci_dev *pdev, enum cxl_regloc_type type) > } > EXPORT_SYMBOL_NS_GPL(cxl_count_regblock, CXL); > > -int cxl_map_pmu_regs(struct pci_dev *pdev, struct cxl_pmu_regs *regs, > - struct cxl_register_map *map) > +int cxl_map_pmu_regs(struct cxl_register_map *map, struct cxl_pmu_regs *regs) > { > - struct device *dev = &pdev->dev; > + struct device *dev = map->host; > resource_size_t phys_addr; > > phys_addr = map->resource; > diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h > index 7c2c195592d6..ed90ca8ed79e 100644 > --- a/drivers/cxl/cxl.h > +++ b/drivers/cxl/cxl.h > @@ -286,8 +286,7 @@ int cxl_map_component_regs(const struct cxl_register_map *map, > unsigned long map_mask); > int cxl_map_device_regs(const struct cxl_register_map *map, > struct cxl_device_regs *regs); > -int cxl_map_pmu_regs(struct pci_dev *pdev, struct cxl_pmu_regs *regs, > - struct cxl_register_map *map); > +int cxl_map_pmu_regs(struct cxl_register_map *map, struct cxl_pmu_regs *regs); > > enum cxl_regloc_type; > int cxl_count_regblock(struct pci_dev *pdev, enum cxl_regloc_type type); > diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c > index 037792e941f2..fa94bc61af25 100644 > --- a/drivers/cxl/pci.c > +++ b/drivers/cxl/pci.c > @@ -898,7 +898,7 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) > break; > } > > - rc = cxl_map_pmu_regs(pdev, &pmu_regs, &map); > + rc = cxl_map_pmu_regs(&map, &pmu_regs); > if (rc) { > dev_dbg(&pdev->dev, "Could not map PMU regs\n"); > break;