aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/serio.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-05-09 19:08:05 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-05-09 19:10:18 -0400
commit7e044e056a6aa0dc695db50461d7b326fde15e8b (patch)
treebc0a26dbd140e54e1cfa9d67ad93ad890f50775f /drivers/input/serio/serio.c
parent6f660f12d703fa23069317f0a64c6b75d08c15c2 (diff)
Input: serio - do not use deprecated dev.power.power_state
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio/serio.c')
-rw-r--r--drivers/input/serio/serio.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 8d2df5d2d5a..fb17573f8f2 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -495,9 +495,9 @@ static ssize_t serio_set_bind_mode(struct device *dev, struct device_attribute *
495 495
496 retval = count; 496 retval = count;
497 if (!strncmp(buf, "manual", count)) { 497 if (!strncmp(buf, "manual", count)) {
498 serio->manual_bind = 1; 498 serio->manual_bind = true;
499 } else if (!strncmp(buf, "auto", count)) { 499 } else if (!strncmp(buf, "auto", count)) {
500 serio->manual_bind = 0; 500 serio->manual_bind = false;
501 } else { 501 } else {
502 retval = -EINVAL; 502 retval = -EINVAL;
503 } 503 }
@@ -570,7 +570,7 @@ static void serio_add_port(struct serio *serio)
570 "serio: device_add() failed for %s (%s), error: %d\n", 570 "serio: device_add() failed for %s (%s), error: %d\n",
571 serio->phys, serio->name, error); 571 serio->phys, serio->name, error);
572 else { 572 else {
573 serio->registered = 1; 573 serio->registered = true;
574 error = sysfs_create_group(&serio->dev.kobj, &serio_id_attr_group); 574 error = sysfs_create_group(&serio->dev.kobj, &serio_id_attr_group);
575 if (error) 575 if (error)
576 printk(KERN_ERR 576 printk(KERN_ERR
@@ -606,7 +606,7 @@ static void serio_destroy_port(struct serio *serio)
606 if (serio->registered) { 606 if (serio->registered) {
607 sysfs_remove_group(&serio->dev.kobj, &serio_id_attr_group); 607 sysfs_remove_group(&serio->dev.kobj, &serio_id_attr_group);
608 device_del(&serio->dev); 608 device_del(&serio->dev);
609 serio->registered = 0; 609 serio->registered = false;
610 } 610 }
611 611
612 list_del_init(&serio->node); 612 list_del_init(&serio->node);
@@ -750,9 +750,9 @@ static ssize_t serio_driver_set_bind_mode(struct device_driver *drv, const char
750 750
751 retval = count; 751 retval = count;
752 if (!strncmp(buf, "manual", count)) { 752 if (!strncmp(buf, "manual", count)) {
753 serio_drv->manual_bind = 1; 753 serio_drv->manual_bind = true;
754 } else if (!strncmp(buf, "auto", count)) { 754 } else if (!strncmp(buf, "auto", count)) {
755 serio_drv->manual_bind = 0; 755 serio_drv->manual_bind = false;
756 } else { 756 } else {
757 retval = -EINVAL; 757 retval = -EINVAL;
758 } 758 }
@@ -812,7 +812,7 @@ static void serio_attach_driver(struct serio_driver *drv)
812 812
813int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name) 813int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name)
814{ 814{
815 int manual_bind = drv->manual_bind; 815 bool manual_bind = drv->manual_bind;
816 int error; 816 int error;
817 817
818 drv->driver.bus = &serio_bus; 818 drv->driver.bus = &serio_bus;
@@ -823,7 +823,7 @@ int __serio_register_driver(struct serio_driver *drv, struct module *owner, cons
823 * Temporarily disable automatic binding because probing 823 * Temporarily disable automatic binding because probing
824 * takes long time and we are better off doing it in kseriod 824 * takes long time and we are better off doing it in kseriod
825 */ 825 */
826 drv->manual_bind = 1; 826 drv->manual_bind = true;
827 827
828 error = driver_register(&drv->driver); 828 error = driver_register(&drv->driver);
829 if (error) { 829 if (error) {
@@ -838,7 +838,7 @@ int __serio_register_driver(struct serio_driver *drv, struct module *owner, cons
838 * driver to free ports 838 * driver to free ports
839 */ 839 */
840 if (!manual_bind) { 840 if (!manual_bind) {
841 drv->manual_bind = 0; 841 drv->manual_bind = false;
842 error = serio_queue_event(drv, NULL, SERIO_ATTACH_DRIVER); 842 error = serio_queue_event(drv, NULL, SERIO_ATTACH_DRIVER);
843 if (error) { 843 if (error) {
844 driver_unregister(&drv->driver); 844 driver_unregister(&drv->driver);
@@ -856,7 +856,7 @@ void serio_unregister_driver(struct serio_driver *drv)
856 856
857 mutex_lock(&serio_mutex); 857 mutex_lock(&serio_mutex);
858 858
859 drv->manual_bind = 1; /* so serio_find_driver ignores it */ 859 drv->manual_bind = true; /* so serio_find_driver ignores it */
860 serio_remove_pending_events(drv); 860 serio_remove_pending_events(drv);
861 861
862start_over: 862start_over:
@@ -933,11 +933,11 @@ static int serio_uevent(struct device *dev, struct kobj_uevent_env *env)
933#ifdef CONFIG_PM 933#ifdef CONFIG_PM
934static int serio_suspend(struct device *dev, pm_message_t state) 934static int serio_suspend(struct device *dev, pm_message_t state)
935{ 935{
936 if (dev->power.power_state.event != state.event) { 936 struct serio *serio = to_serio_port(dev);
937 if (state.event == PM_EVENT_SUSPEND)
938 serio_cleanup(to_serio_port(dev));
939 937
940 dev->power.power_state = state; 938 if (!serio->suspended && state.event == PM_EVENT_SUSPEND) {
939 serio_cleanup(serio);
940 serio->suspended = true;
941 } 941 }
942 942
943 return 0; 943 return 0;
@@ -945,14 +945,15 @@ static int serio_suspend(struct device *dev, pm_message_t state)
945 945
946static int serio_resume(struct device *dev) 946static int serio_resume(struct device *dev)
947{ 947{
948 struct serio *serio = to_serio_port(dev);
949
948 /* 950 /*
949 * Driver reconnect can take a while, so better let kseriod 951 * Driver reconnect can take a while, so better let kseriod
950 * deal with it. 952 * deal with it.
951 */ 953 */
952 if (dev->power.power_state.event != PM_EVENT_ON) { 954 if (serio->suspended) {
953 dev->power.power_state = PMSG_ON; 955 serio->suspended = false;
954 serio_queue_event(to_serio_port(dev), NULL, 956 serio_queue_event(serio, NULL, SERIO_RECONNECT_PORT);
955 SERIO_RECONNECT_PORT);
956 } 957 }
957 958
958 return 0; 959 return 0;