mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-04 20:19:47 +08:00 
			
		
		
		
	i2c: i801: make p2sb_spinlock a mutex
p2sb_spinlock is used in i801_add_tco_spt() only, and in process context only. Therefore a mutex is sufficient, and we can make the definition local to i801_add_tco_spt(). Reviewed-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
		
							parent
							
								
									4e60d5dd10
								
							
						
					
					
						commit
						1a987c69ce
					
				| @ -110,6 +110,7 @@ | |||||||
| #include <linux/platform_device.h> | #include <linux/platform_device.h> | ||||||
| #include <linux/platform_data/itco_wdt.h> | #include <linux/platform_data/itco_wdt.h> | ||||||
| #include <linux/pm_runtime.h> | #include <linux/pm_runtime.h> | ||||||
|  | #include <linux/mutex.h> | ||||||
| 
 | 
 | ||||||
| #if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI | #if IS_ENABLED(CONFIG_I2C_MUX_GPIO) && defined CONFIG_DMI | ||||||
| #include <linux/gpio/machine.h> | #include <linux/gpio/machine.h> | ||||||
| @ -1492,12 +1493,11 @@ static const struct itco_wdt_platform_data spt_tco_platform_data = { | |||||||
| 	.version = 4, | 	.version = 4, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| static DEFINE_SPINLOCK(p2sb_spinlock); |  | ||||||
| 
 |  | ||||||
| static struct platform_device * | static struct platform_device * | ||||||
| i801_add_tco_spt(struct i801_priv *priv, struct pci_dev *pci_dev, | i801_add_tco_spt(struct i801_priv *priv, struct pci_dev *pci_dev, | ||||||
| 		 struct resource *tco_res) | 		 struct resource *tco_res) | ||||||
| { | { | ||||||
|  | 	static DEFINE_MUTEX(p2sb_mutex); | ||||||
| 	struct resource *res; | 	struct resource *res; | ||||||
| 	unsigned int devfn; | 	unsigned int devfn; | ||||||
| 	u64 base64_addr; | 	u64 base64_addr; | ||||||
| @ -1510,7 +1510,7 @@ i801_add_tco_spt(struct i801_priv *priv, struct pci_dev *pci_dev, | |||||||
| 	 * enumerated by the PCI subsystem, so we need to unhide/hide it | 	 * enumerated by the PCI subsystem, so we need to unhide/hide it | ||||||
| 	 * to lookup the P2SB BAR. | 	 * to lookup the P2SB BAR. | ||||||
| 	 */ | 	 */ | ||||||
| 	spin_lock(&p2sb_spinlock); | 	mutex_lock(&p2sb_mutex); | ||||||
| 
 | 
 | ||||||
| 	devfn = PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 1); | 	devfn = PCI_DEVFN(PCI_SLOT(pci_dev->devfn), 1); | ||||||
| 
 | 
 | ||||||
| @ -1528,7 +1528,7 @@ i801_add_tco_spt(struct i801_priv *priv, struct pci_dev *pci_dev, | |||||||
| 	/* Hide the P2SB device, if it was hidden before */ | 	/* Hide the P2SB device, if it was hidden before */ | ||||||
| 	if (hidden) | 	if (hidden) | ||||||
| 		pci_bus_write_config_byte(pci_dev->bus, devfn, 0xe1, hidden); | 		pci_bus_write_config_byte(pci_dev->bus, devfn, 0xe1, hidden); | ||||||
| 	spin_unlock(&p2sb_spinlock); | 	mutex_unlock(&p2sb_mutex); | ||||||
| 
 | 
 | ||||||
| 	res = &tco_res[1]; | 	res = &tco_res[1]; | ||||||
| 	if (pci_dev->device == PCI_DEVICE_ID_INTEL_DNV_SMBUS) | 	if (pci_dev->device == PCI_DEVICE_ID_INTEL_DNV_SMBUS) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Heiner Kallweit
						Heiner Kallweit