Skip to content

Commit e8043a4

Browse files
tomgud3jhedberg
authored andcommitted
drivers: modem: use pm_device_driver_init() in modem_cellular.c
Remove Device Runtime PM "hack" used for modem cellular driver initialization and use pm_device_driver_init() instead. Signed-off-by: Tomas Gudelevičius <[email protected]>
1 parent 45bfe06 commit e8043a4

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/modem/modem_cellular.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2133,7 +2133,6 @@ static DEVICE_API(cellular, modem_cellular_api) = {
21332133
.set_callback = modem_cellular_set_callback,
21342134
};
21352135

2136-
#ifdef CONFIG_PM_DEVICE
21372136
static int modem_cellular_pm_action(const struct device *dev, enum pm_device_action action)
21382137
{
21392138
struct modem_cellular_data *data = (struct modem_cellular_data *)dev->data;
@@ -2157,7 +2156,6 @@ static int modem_cellular_pm_action(const struct device *dev, enum pm_device_act
21572156

21582157
return ret;
21592158
}
2160-
#endif /* CONFIG_PM_DEVICE */
21612159

21622160
static void net_mgmt_event_handler(struct net_mgmt_event_callback *cb, uint64_t mgmt_event,
21632161
struct net_if *iface)
@@ -2311,13 +2309,7 @@ static int modem_cellular_init(const struct device *dev)
23112309

23122310
modem_cellular_init_apn(data);
23132311

2314-
#ifndef CONFIG_PM_DEVICE
2315-
modem_cellular_delegate_event(data, MODEM_CELLULAR_EVENT_RESUME);
2316-
#else
2317-
pm_device_init_suspended(dev);
2318-
#endif /* CONFIG_PM_DEVICE */
2319-
2320-
return 0;
2312+
return pm_device_driver_init(dev, modem_cellular_pm_action);
23212313
}
23222314

23232315
/*

0 commit comments

Comments
 (0)