diff mbox

[v6,20/20] cxl: Remove cxl_get_phys_dev() kernel API

Message ID 1457090804-9719-21-git-send-email-fbarrat@linux.vnet.ibm.com (mailing list archive)
State Accepted
Headers show

Commit Message

Frederic Barrat March 4, 2016, 11:26 a.m. UTC
The cxl_get_phys_dev() API returns a struct device pointer which could
belong to either a struct pci_dev (bare-metal) or platform_device
(powerVM). To avoid potential problems in drivers, remove that API. It
was introduced to allow drivers to read the VPD of the adapter, but
the cxl driver now provides the cxl_pci_read_adapter_vpd() API for
that purpose.

Co-authored-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
---
 drivers/misc/cxl/api.c | 1 -
 include/misc/cxl.h     | 3 ---
 2 files changed, 4 deletions(-)

Comments

Ian Munsie March 7, 2016, 5:25 a.m. UTC | #1
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Michael Ellerman March 9, 2016, 11:09 a.m. UTC | #2
On Fri, 2016-04-03 at 11:26:44 UTC, Frederic Barrat wrote:
> The cxl_get_phys_dev() API returns a struct device pointer which could
> belong to either a struct pci_dev (bare-metal) or platform_device
> (powerVM). To avoid potential problems in drivers, remove that API. It
> was introduced to allow drivers to read the VPD of the adapter, but
> the cxl driver now provides the cxl_pci_read_adapter_vpd() API for
> that purpose.
> 
> diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c
> index 75ec2f9..2107c94 100644
> --- a/drivers/misc/cxl/api.c
> +++ b/drivers/misc/cxl/api.c
> @@ -76,7 +76,6 @@ struct device *cxl_get_phys_dev(struct pci_dev *dev)
>  
>  	return afu->adapter->dev.parent;
>  }
> -EXPORT_SYMBOL_GPL(cxl_get_phys_dev);

This appears to make cxl_get_phys_dev() completely unused, doesn't it?

If so, please send me a follow-up patch to remove it entirely.

cheers
Frederic Barrat March 9, 2016, 11:35 a.m. UTC | #3
Le 09/03/2016 12:09, Michael Ellerman a écrit :
> This appears to make cxl_get_phys_dev() completely unused, doesn't it?
>
> If so, please send me a follow-up patch to remove it entirely.


I would have sworn there was one internal call to it, but I was confused 
by some older version.

Follow-up patch on the way.

   Fred
diff mbox

Patch

diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c
index 75ec2f9..2107c94 100644
--- a/drivers/misc/cxl/api.c
+++ b/drivers/misc/cxl/api.c
@@ -76,7 +76,6 @@  struct device *cxl_get_phys_dev(struct pci_dev *dev)
 
 	return afu->adapter->dev.parent;
 }
-EXPORT_SYMBOL_GPL(cxl_get_phys_dev);
 
 int cxl_release_context(struct cxl_context *ctx)
 {
diff --git a/include/misc/cxl.h b/include/misc/cxl.h
index 5bcf11a..7d5e261 100644
--- a/include/misc/cxl.h
+++ b/include/misc/cxl.h
@@ -30,9 +30,6 @@  struct cxl_afu *cxl_pci_to_afu(struct pci_dev *dev);
 /* Get the AFU conf record number associated with a pci_dev */
 unsigned int cxl_pci_to_cfg_record(struct pci_dev *dev);
 
-/* Get the physical device (ie. the PCIe card) which the AFU is attached */
-struct device *cxl_get_phys_dev(struct pci_dev *dev);
-
 
 /*
  * Context lifetime overview: