@@ -125,18 +125,19 @@ static int mmc_bus_remove(struct device *dev)
125
125
return 0 ;
126
126
}
127
127
128
- static int mmc_bus_suspend (struct device * dev , pm_message_t state )
128
+ static int mmc_bus_pm_suspend (struct device * dev )
129
129
{
130
130
struct mmc_driver * drv = to_mmc_driver (dev -> driver );
131
131
struct mmc_card * card = mmc_dev_to_card (dev );
132
132
int ret = 0 ;
133
+ pm_message_t state = { PM_EVENT_SUSPEND };
133
134
134
135
if (dev -> driver && drv -> suspend )
135
136
ret = drv -> suspend (card , state );
136
137
return ret ;
137
138
}
138
139
139
- static int mmc_bus_resume (struct device * dev )
140
+ static int mmc_bus_pm_resume (struct device * dev )
140
141
{
141
142
struct mmc_driver * drv = to_mmc_driver (dev -> driver );
142
143
struct mmc_card * card = mmc_dev_to_card (dev );
@@ -148,7 +149,6 @@ static int mmc_bus_resume(struct device *dev)
148
149
}
149
150
150
151
#ifdef CONFIG_PM_RUNTIME
151
-
152
152
static int mmc_runtime_suspend (struct device * dev )
153
153
{
154
154
struct mmc_card * card = mmc_dev_to_card (dev );
@@ -167,31 +167,21 @@ static int mmc_runtime_idle(struct device *dev)
167
167
{
168
168
return pm_runtime_suspend (dev );
169
169
}
170
+ #endif /* CONFIG_PM_RUNTIME */
170
171
171
172
static const struct dev_pm_ops mmc_bus_pm_ops = {
172
- .runtime_suspend = mmc_runtime_suspend ,
173
- .runtime_resume = mmc_runtime_resume ,
174
- .runtime_idle = mmc_runtime_idle ,
173
+ SET_SYSTEM_SLEEP_PM_OPS (mmc_bus_pm_suspend , mmc_bus_pm_resume )
174
+ SET_RUNTIME_PM_OPS (mmc_runtime_suspend , mmc_runtime_resume , mmc_runtime_idle )
175
175
};
176
176
177
- #define MMC_PM_OPS_PTR (&mmc_bus_pm_ops)
178
-
179
- #else /* !CONFIG_PM_RUNTIME */
180
-
181
- #define MMC_PM_OPS_PTR NULL
182
-
183
- #endif /* !CONFIG_PM_RUNTIME */
184
-
185
177
static struct bus_type mmc_bus_type = {
186
178
.name = "mmc" ,
187
179
.dev_attrs = mmc_dev_attrs ,
188
180
.match = mmc_bus_match ,
189
181
.uevent = mmc_bus_uevent ,
190
182
.probe = mmc_bus_probe ,
191
183
.remove = mmc_bus_remove ,
192
- .suspend = mmc_bus_suspend ,
193
- .resume = mmc_bus_resume ,
194
- .pm = MMC_PM_OPS_PTR ,
184
+ .pm = & mmc_bus_pm_ops ,
195
185
};
196
186
197
187
int mmc_register_bus (void )
0 commit comments