power: support _noirq actions on device types and classes
The new-style dev_pm_ops provide callbacks for both IRQs enabled and disabled. However, the _noirq variants were only called for buses registered with a device, not for classes and types. In order to properly use dev_pm_ops in class pcmcia_socket_class, support _noirq actions also on classes and types. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
This commit is contained in:
		
							parent
							
								
									7d7ba8d31e
								
							
						
					
					
						commit
						e7176a37d4
					
				| @ -439,8 +439,23 @@ static int device_resume_noirq(struct device *dev, pm_message_t state) | ||||
| 	if (dev->bus && dev->bus->pm) { | ||||
| 		pm_dev_dbg(dev, state, "EARLY "); | ||||
| 		error = pm_noirq_op(dev, dev->bus->pm, state); | ||||
| 		if (error) | ||||
| 			goto End; | ||||
| 	} | ||||
| 
 | ||||
| 	if (dev->type && dev->type->pm) { | ||||
| 		pm_dev_dbg(dev, state, "EARLY type "); | ||||
| 		error = pm_noirq_op(dev, dev->type->pm, state); | ||||
| 		if (error) | ||||
| 			goto End; | ||||
| 	} | ||||
| 
 | ||||
| 	if (dev->class && dev->class->pm) { | ||||
| 		pm_dev_dbg(dev, state, "EARLY class "); | ||||
| 		error = pm_noirq_op(dev, dev->class->pm, state); | ||||
| 	} | ||||
| 
 | ||||
| End: | ||||
| 	TRACE_RESUME(error); | ||||
| 	return error; | ||||
| } | ||||
| @ -735,10 +750,26 @@ static int device_suspend_noirq(struct device *dev, pm_message_t state) | ||||
| { | ||||
| 	int error = 0; | ||||
| 
 | ||||
| 	if (dev->class && dev->class->pm) { | ||||
| 		pm_dev_dbg(dev, state, "LATE class "); | ||||
| 		error = pm_noirq_op(dev, dev->class->pm, state); | ||||
| 		if (error) | ||||
| 			goto End; | ||||
| 	} | ||||
| 
 | ||||
| 	if (dev->type && dev->type->pm) { | ||||
| 		pm_dev_dbg(dev, state, "LATE type "); | ||||
| 		error = pm_noirq_op(dev, dev->type->pm, state); | ||||
| 		if (error) | ||||
| 			goto End; | ||||
| 	} | ||||
| 
 | ||||
| 	if (dev->bus && dev->bus->pm) { | ||||
| 		pm_dev_dbg(dev, state, "LATE "); | ||||
| 		error = pm_noirq_op(dev, dev->bus->pm, state); | ||||
| 	} | ||||
| 
 | ||||
| End: | ||||
| 	return error; | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user