diff mbox series

[V2,02/16] PCI/PME: Export pcie_pme_disable_msi() API

Message ID 1554407683-31580-3-git-send-email-vidyas@nvidia.com (mailing list archive)
State New, archived
Headers show
Series Add Tegra194 PCIe support | expand

Commit Message

Vidya Sagar April 4, 2019, 7:54 p.m. UTC
Export pcie_pme_disable_msi() API to enable drivers using this API be able to
build as loadable modules

Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
---
Changes from [v1]:
* This is a new patch in v2 series

 drivers/pci/pcie/pme.c     | 6 ++++++
 drivers/pci/pcie/portdrv.h | 5 +----
 2 files changed, 7 insertions(+), 4 deletions(-)

Comments

Thierry Reding April 11, 2019, 10:16 a.m. UTC | #1
On Fri, Apr 05, 2019 at 01:24:29AM +0530, Vidya Sagar wrote:
> Export pcie_pme_disable_msi() API to enable drivers using this API be able to
> build as loadable modules
> 
> Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
> ---
> Changes from [v1]:
> * This is a new patch in v2 series
> 
>  drivers/pci/pcie/pme.c     | 6 ++++++
>  drivers/pci/pcie/portdrv.h | 5 +----
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
> index 54d593d10396..18e815c1e3c9 100644
> --- a/drivers/pci/pcie/pme.c
> +++ b/drivers/pci/pcie/pme.c
> @@ -27,6 +27,12 @@
>   */
>  bool pcie_pme_msi_disabled;
>  
> +void pcie_pme_disable_msi(void)
> +{
> +	pcie_pme_msi_disabled = true;
> +}
> +EXPORT_SYMBOL_GPL(pcie_pme_disable_msi);
> +
>  static int __init pcie_pme_setup(char *str)
>  {
>  	if (!strncmp(str, "nomsi", 5))
> diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
> index 1d50dc58ac40..2be7b7e9a784 100644
> --- a/drivers/pci/pcie/portdrv.h
> +++ b/drivers/pci/pcie/portdrv.h
> @@ -127,10 +127,7 @@ struct pci_dev;
>  #ifdef CONFIG_PCIE_PME
>  extern bool pcie_pme_msi_disabled;
>  
> -static inline void pcie_pme_disable_msi(void)
> -{
> -	pcie_pme_msi_disabled = true;
> -}
> +void pcie_pme_disable_msi(void);
>  
>  static inline bool pcie_pme_no_msi(void)
>  {

Perhaps also export pcie_pme_no_msi()? That way you could get rid of the
extern declaration of the pcie_pme_msi_disabled variable and make it
static to drivers/pci/pcie/pme.c?

Thierry
Vidya Sagar April 16, 2019, 1:30 p.m. UTC | #2
On 4/11/2019 3:46 PM, Thierry Reding wrote:
> On Fri, Apr 05, 2019 at 01:24:29AM +0530, Vidya Sagar wrote:
>> Export pcie_pme_disable_msi() API to enable drivers using this API be able to
>> build as loadable modules
>>
>> Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
>> ---
>> Changes from [v1]:
>> * This is a new patch in v2 series
>>
>>   drivers/pci/pcie/pme.c     | 6 ++++++
>>   drivers/pci/pcie/portdrv.h | 5 +----
>>   2 files changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
>> index 54d593d10396..18e815c1e3c9 100644
>> --- a/drivers/pci/pcie/pme.c
>> +++ b/drivers/pci/pcie/pme.c
>> @@ -27,6 +27,12 @@
>>    */
>>   bool pcie_pme_msi_disabled;
>>   
>> +void pcie_pme_disable_msi(void)
>> +{
>> +	pcie_pme_msi_disabled = true;
>> +}
>> +EXPORT_SYMBOL_GPL(pcie_pme_disable_msi);
>> +
>>   static int __init pcie_pme_setup(char *str)
>>   {
>>   	if (!strncmp(str, "nomsi", 5))
>> diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
>> index 1d50dc58ac40..2be7b7e9a784 100644
>> --- a/drivers/pci/pcie/portdrv.h
>> +++ b/drivers/pci/pcie/portdrv.h
>> @@ -127,10 +127,7 @@ struct pci_dev;
>>   #ifdef CONFIG_PCIE_PME
>>   extern bool pcie_pme_msi_disabled;
>>   
>> -static inline void pcie_pme_disable_msi(void)
>> -{
>> -	pcie_pme_msi_disabled = true;
>> -}
>> +void pcie_pme_disable_msi(void);
>>   
>>   static inline bool pcie_pme_no_msi(void)
>>   {
> 
> Perhaps also export pcie_pme_no_msi()? That way you could get rid of the
> extern declaration of the pcie_pme_msi_disabled variable and make it
> static to drivers/pci/pcie/pme.c?
Agree. I'll take care of this in V3 patch series.

> 
> Thierry
>
diff mbox series

Patch

diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
index 54d593d10396..18e815c1e3c9 100644
--- a/drivers/pci/pcie/pme.c
+++ b/drivers/pci/pcie/pme.c
@@ -27,6 +27,12 @@ 
  */
 bool pcie_pme_msi_disabled;
 
+void pcie_pme_disable_msi(void)
+{
+	pcie_pme_msi_disabled = true;
+}
+EXPORT_SYMBOL_GPL(pcie_pme_disable_msi);
+
 static int __init pcie_pme_setup(char *str)
 {
 	if (!strncmp(str, "nomsi", 5))
diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h
index 1d50dc58ac40..2be7b7e9a784 100644
--- a/drivers/pci/pcie/portdrv.h
+++ b/drivers/pci/pcie/portdrv.h
@@ -127,10 +127,7 @@  struct pci_dev;
 #ifdef CONFIG_PCIE_PME
 extern bool pcie_pme_msi_disabled;
 
-static inline void pcie_pme_disable_msi(void)
-{
-	pcie_pme_msi_disabled = true;
-}
+void pcie_pme_disable_msi(void);
 
 static inline bool pcie_pme_no_msi(void)
 {