Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: max7359 - convert to dev_pm_ops

There is a general move to convert drivers to use dev_pm_ops rather than
bus specific ops to facilitate core work. Do this conversion for max7359.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Mark Brown and committed by
Dmitry Torokhov
76e2c68f 65b0c038

+10 -7
+10 -7
drivers/input/keyboard/max7359_keypad.c
··· 17 17 #include <linux/i2c.h> 18 18 #include <linux/slab.h> 19 19 #include <linux/interrupt.h> 20 + #include <linux/pm.h> 20 21 #include <linux/input.h> 21 22 #include <linux/input/matrix_keypad.h> 22 23 ··· 272 271 } 273 272 274 273 #ifdef CONFIG_PM 275 - static int max7359_suspend(struct i2c_client *client, pm_message_t mesg) 274 + static int max7359_suspend(struct device *dev) 276 275 { 276 + struct i2c_client *client = to_i2c_client(dev); 277 + 277 278 max7359_fall_deepsleep(client); 278 279 279 280 if (device_may_wakeup(&client->dev)) ··· 284 281 return 0; 285 282 } 286 283 287 - static int max7359_resume(struct i2c_client *client) 284 + static int max7359_resume(struct device *dev) 288 285 { 286 + struct i2c_client *client = to_i2c_client(dev); 287 + 289 288 if (device_may_wakeup(&client->dev)) 290 289 disable_irq_wake(client->irq); 291 290 ··· 296 291 297 292 return 0; 298 293 } 299 - #else 300 - #define max7359_suspend NULL 301 - #define max7359_resume NULL 302 294 #endif 295 + 296 + static SIMPLE_DEV_PM_OPS(max7359_pm, max7359_suspend, max7359_resume); 303 297 304 298 static const struct i2c_device_id max7359_ids[] = { 305 299 { "max7359", 0 }, ··· 309 305 static struct i2c_driver max7359_i2c_driver = { 310 306 .driver = { 311 307 .name = "max7359", 308 + .pm = &max7359_pm, 312 309 }, 313 310 .probe = max7359_probe, 314 311 .remove = __devexit_p(max7359_remove), 315 - .suspend = max7359_suspend, 316 - .resume = max7359_resume, 317 312 .id_table = max7359_ids, 318 313 }; 319 314