+ /* Translate PM_SUSPEND_xx states to PCI device states */
+ static u32 state_conversion[] = {
+ [PM_SUSPEND_ON] = 0,
+ [PM_SUSPEND_STANDBY] = 1,
+ [PM_SUSPEND_MEM] = 3,
+ [PM_SUSPEND_DISK] = 3,
+ };
+
+ if (state >= sizeof(state_conversion) / sizeof(state_conversion[1]))
+ return -EINVAL;
+
+ dev_state = state_conversion[state];