@@ -1192,15 +1192,15 @@ static void dpm_superior_set_must_resume(struct device *dev)
1192
1192
}
1193
1193
1194
1194
/**
1195
- * __device_suspend_noirq - Execute a "noirq suspend" callback for given device.
1195
+ * device_suspend_noirq - Execute a "noirq suspend" callback for given device.
1196
1196
* @dev: Device to handle.
1197
1197
* @state: PM transition of the system being carried out.
1198
1198
* @async: If true, the device is being suspended asynchronously.
1199
1199
*
1200
1200
* The driver of @dev will not receive interrupts while this function is being
1201
1201
* executed.
1202
1202
*/
1203
- static int __device_suspend_noirq (struct device * dev , pm_message_t state , bool async )
1203
+ static int device_suspend_noirq (struct device * dev , pm_message_t state , bool async )
1204
1204
{
1205
1205
pm_callback_t callback = NULL ;
1206
1206
const char * info = NULL ;
@@ -1277,18 +1277,10 @@ static void async_suspend_noirq(void *data, async_cookie_t cookie)
1277
1277
{
1278
1278
struct device * dev = data ;
1279
1279
1280
- __device_suspend_noirq (dev , pm_transition , true);
1280
+ device_suspend_noirq (dev , pm_transition , true);
1281
1281
put_device (dev );
1282
1282
}
1283
1283
1284
- static int device_suspend_noirq (struct device * dev )
1285
- {
1286
- if (dpm_async_fn (dev , async_suspend_noirq ))
1287
- return 0 ;
1288
-
1289
- return __device_suspend_noirq (dev , pm_transition , false);
1290
- }
1291
-
1292
1284
static int dpm_noirq_suspend_devices (pm_message_t state )
1293
1285
{
1294
1286
ktime_t starttime = ktime_get ();
@@ -1305,10 +1297,15 @@ static int dpm_noirq_suspend_devices(pm_message_t state)
1305
1297
struct device * dev = to_device (dpm_late_early_list .prev );
1306
1298
1307
1299
list_move (& dev -> power .entry , & dpm_noirq_list );
1300
+
1301
+ if (dpm_async_fn (dev , async_suspend_noirq ))
1302
+ continue ;
1303
+
1308
1304
get_device (dev );
1305
+
1309
1306
mutex_unlock (& dpm_list_mtx );
1310
1307
1311
- error = device_suspend_noirq (dev );
1308
+ error = device_suspend_noirq (dev , state , false );
1312
1309
1313
1310
put_device (dev );
1314
1311
@@ -1369,14 +1366,14 @@ static void dpm_propagate_wakeup_to_parent(struct device *dev)
1369
1366
}
1370
1367
1371
1368
/**
1372
- * __device_suspend_late - Execute a "late suspend" callback for given device.
1369
+ * device_suspend_late - Execute a "late suspend" callback for given device.
1373
1370
* @dev: Device to handle.
1374
1371
* @state: PM transition of the system being carried out.
1375
1372
* @async: If true, the device is being suspended asynchronously.
1376
1373
*
1377
1374
* Runtime PM is disabled for @dev while this function is being executed.
1378
1375
*/
1379
- static int __device_suspend_late (struct device * dev , pm_message_t state , bool async )
1376
+ static int device_suspend_late (struct device * dev , pm_message_t state , bool async )
1380
1377
{
1381
1378
pm_callback_t callback = NULL ;
1382
1379
const char * info = NULL ;
@@ -1447,18 +1444,10 @@ static void async_suspend_late(void *data, async_cookie_t cookie)
1447
1444
{
1448
1445
struct device * dev = data ;
1449
1446
1450
- __device_suspend_late (dev , pm_transition , true);
1447
+ device_suspend_late (dev , pm_transition , true);
1451
1448
put_device (dev );
1452
1449
}
1453
1450
1454
- static int device_suspend_late (struct device * dev )
1455
- {
1456
- if (dpm_async_fn (dev , async_suspend_late ))
1457
- return 0 ;
1458
-
1459
- return __device_suspend_late (dev , pm_transition , false);
1460
- }
1461
-
1462
1451
/**
1463
1452
* dpm_suspend_late - Execute "late suspend" callbacks for all devices.
1464
1453
* @state: PM transition of the system being carried out.
@@ -1481,11 +1470,15 @@ int dpm_suspend_late(pm_message_t state)
1481
1470
struct device * dev = to_device (dpm_suspended_list .prev );
1482
1471
1483
1472
list_move (& dev -> power .entry , & dpm_late_early_list );
1473
+
1474
+ if (dpm_async_fn (dev , async_suspend_late ))
1475
+ continue ;
1476
+
1484
1477
get_device (dev );
1485
1478
1486
1479
mutex_unlock (& dpm_list_mtx );
1487
1480
1488
- error = device_suspend_late (dev );
1481
+ error = device_suspend_late (dev , state , false );
1489
1482
1490
1483
put_device (dev );
1491
1484
@@ -1582,12 +1575,12 @@ static void dpm_clear_superiors_direct_complete(struct device *dev)
1582
1575
}
1583
1576
1584
1577
/**
1585
- * __device_suspend - Execute "suspend" callbacks for given device.
1578
+ * device_suspend - Execute "suspend" callbacks for given device.
1586
1579
* @dev: Device to handle.
1587
1580
* @state: PM transition of the system being carried out.
1588
1581
* @async: If true, the device is being suspended asynchronously.
1589
1582
*/
1590
- static int __device_suspend (struct device * dev , pm_message_t state , bool async )
1583
+ static int device_suspend (struct device * dev , pm_message_t state , bool async )
1591
1584
{
1592
1585
pm_callback_t callback = NULL ;
1593
1586
const char * info = NULL ;
@@ -1716,18 +1709,10 @@ static void async_suspend(void *data, async_cookie_t cookie)
1716
1709
{
1717
1710
struct device * dev = data ;
1718
1711
1719
- __device_suspend (dev , pm_transition , true);
1712
+ device_suspend (dev , pm_transition , true);
1720
1713
put_device (dev );
1721
1714
}
1722
1715
1723
- static int device_suspend (struct device * dev )
1724
- {
1725
- if (dpm_async_fn (dev , async_suspend ))
1726
- return 0 ;
1727
-
1728
- return __device_suspend (dev , pm_transition , false);
1729
- }
1730
-
1731
1716
/**
1732
1717
* dpm_suspend - Execute "suspend" callbacks for all non-sysdev devices.
1733
1718
* @state: PM transition of the system being carried out.
@@ -1752,11 +1737,15 @@ int dpm_suspend(pm_message_t state)
1752
1737
struct device * dev = to_device (dpm_prepared_list .prev );
1753
1738
1754
1739
list_move (& dev -> power .entry , & dpm_suspended_list );
1740
+
1741
+ if (dpm_async_fn (dev , async_suspend ))
1742
+ continue ;
1743
+
1755
1744
get_device (dev );
1756
1745
1757
1746
mutex_unlock (& dpm_list_mtx );
1758
1747
1759
- error = device_suspend (dev );
1748
+ error = device_suspend (dev , state , false );
1760
1749
1761
1750
put_device (dev );
1762
1751
0 commit comments