public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 11/30] hwmon: (coretemp) deprecate pci_get_bus_and_slot()
       [not found] <1511328675-21981-1-git-send-email-okaya@codeaurora.org>
@ 2017-11-22  5:30 ` Sinan Kaya
  2017-11-22 15:07   ` [11/30] " Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Sinan Kaya @ 2017-11-22  5:30 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, Sinan Kaya, Fenghua Yu,
	Jean Delvare, Guenter Roeck,
	open list:CORETEMP HARDWARE MONITORING DRIVER, open list

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't
extract the domain number. Other places, use the actual domain number from
the device.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/hwmon/coretemp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index c13a4fd..4bdbf77 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -246,7 +246,8 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
 	int err;
 	u32 eax, edx;
 	int i;
-	struct pci_dev *host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	u16 devfn = PCI_DEVFN(0, 0);
+	struct pci_dev *host_bridge = pci_get_domain_bus_and_slot(0, 0, devfn);
 
 	/*
 	 * Explicit tjmax table entries override heuristics.
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [11/30] hwmon: (coretemp) deprecate pci_get_bus_and_slot()
  2017-11-22  5:30 ` [PATCH 11/30] hwmon: (coretemp) deprecate pci_get_bus_and_slot() Sinan Kaya
@ 2017-11-22 15:07   ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2017-11-22 15:07 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: linux-pci, timur, linux-arm-msm, linux-arm-kernel, Fenghua Yu,
	Jean Delvare, open list:CORETEMP HARDWARE MONITORING DRIVER,
	open list

On Wed, Nov 22, 2017 at 12:30:56AM -0500, Sinan Kaya wrote:
> pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
> where a PCI device is present. This restricts the device drivers to be
> reused for other domain numbers.
> 
> Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't
> extract the domain number. Other places, use the actual domain number from
> the device.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/coretemp.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
> index c13a4fd..4bdbf77 100644
> --- a/drivers/hwmon/coretemp.c
> +++ b/drivers/hwmon/coretemp.c
> @@ -246,7 +246,8 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
>  	int err;
>  	u32 eax, edx;
>  	int i;
> -	struct pci_dev *host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	u16 devfn = PCI_DEVFN(0, 0);
> +	struct pci_dev *host_bridge = pci_get_domain_bus_and_slot(0, 0, devfn);
>  
>  	/*
>  	 * Explicit tjmax table entries override heuristics.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-22 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1511328675-21981-1-git-send-email-okaya@codeaurora.org>
2017-11-22  5:30 ` [PATCH 11/30] hwmon: (coretemp) deprecate pci_get_bus_and_slot() Sinan Kaya
2017-11-22 15:07   ` [11/30] " Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox