···723723 * Temporarily disable automatic binding because probing724724 * takes long time and we are better off doing it in kgameportd725725 */726726- drv->ignore = 1;726726+ drv->ignore = true;727727728728 error = driver_register(&drv->driver);729729 if (error) {···736736 /*737737 * Reset ignore flag and let kgameportd bind the driver to free ports738738 */739739- drv->ignore = 0;739739+ drv->ignore = false;740740 error = gameport_queue_event(drv, NULL, GAMEPORT_ATTACH_DRIVER);741741 if (error) {742742 driver_unregister(&drv->driver);···753753754754 mutex_lock(&gameport_mutex);755755756756- drv->ignore = 1; /* so gameport_find_driver ignores it */756756+ drv->ignore = true; /* so gameport_find_driver ignores it */757757 gameport_remove_pending_events(drv);758758759759start_over:
+9-8
drivers/input/serio/i8042.c
···1010 * the Free Software Foundation.1111 */12121313+#include <linux/types.h>1314#include <linux/delay.h>1415#include <linux/module.h>1516#include <linux/interrupt.h>···922921#endif923922924923#ifdef CONFIG_PM924924+925925+static bool i8042_suspended;926926+925927/*926928 * Here we try to restore the original BIOS settings. We only want to927929 * do that once, when we really suspend, not when we taking memory···934930935931static int i8042_suspend(struct platform_device *dev, pm_message_t state)936932{937937- if (dev->dev.power.power_state.event != state.event) {938938- if (state.event == PM_EVENT_SUSPEND)939939- i8042_controller_reset();940940-941941- dev->dev.power.power_state = state;933933+ if (!i8042_suspended && state.event == PM_EVENT_SUSPEND) {934934+ i8042_controller_reset();935935+ i8042_suspended = true;942936 }943937944938 return 0;···954952/*955953 * Do not bother with restoring state if we haven't suspened yet956954 */957957- if (dev->dev.power.power_state.event == PM_EVENT_ON)955955+ if (!i8042_suspended)958956 return 0;959957960958 error = i8042_controller_check();···1000998 if (i8042_ports[I8042_KBD_PORT_NO].serio)1001999 i8042_enable_kbd_port();1002100010011001+ i8042_suspended = false;10031002 i8042_interrupt(0, NULL);10041004-10051005- dev->dev.power.power_state = PMSG_ON;1006100310071004 return 0;10081005}
+19-18
drivers/input/serio/serio.c
···495495496496 retval = count;497497 if (!strncmp(buf, "manual", count)) {498498- serio->manual_bind = 1;498498+ serio->manual_bind = true;499499 } else if (!strncmp(buf, "auto", count)) {500500- serio->manual_bind = 0;500500+ serio->manual_bind = false;501501 } else {502502 retval = -EINVAL;503503 }···570570 "serio: device_add() failed for %s (%s), error: %d\n",571571 serio->phys, serio->name, error);572572 else {573573- serio->registered = 1;573573+ serio->registered = true;574574 error = sysfs_create_group(&serio->dev.kobj, &serio_id_attr_group);575575 if (error)576576 printk(KERN_ERR···606606 if (serio->registered) {607607 sysfs_remove_group(&serio->dev.kobj, &serio_id_attr_group);608608 device_del(&serio->dev);609609- serio->registered = 0;609609+ serio->registered = false;610610 }611611612612 list_del_init(&serio->node);···750750751751 retval = count;752752 if (!strncmp(buf, "manual", count)) {753753- serio_drv->manual_bind = 1;753753+ serio_drv->manual_bind = true;754754 } else if (!strncmp(buf, "auto", count)) {755755- serio_drv->manual_bind = 0;755755+ serio_drv->manual_bind = false;756756 } else {757757 retval = -EINVAL;758758 }···812812813813int __serio_register_driver(struct serio_driver *drv, struct module *owner, const char *mod_name)814814{815815- int manual_bind = drv->manual_bind;815815+ bool manual_bind = drv->manual_bind;816816 int error;817817818818 drv->driver.bus = &serio_bus;···823823 * Temporarily disable automatic binding because probing824824 * takes long time and we are better off doing it in kseriod825825 */826826- drv->manual_bind = 1;826826+ drv->manual_bind = true;827827828828 error = driver_register(&drv->driver);829829 if (error) {···838838 * driver to free ports839839 */840840 if (!manual_bind) {841841- drv->manual_bind = 0;841841+ drv->manual_bind = false;842842 error = serio_queue_event(drv, NULL, SERIO_ATTACH_DRIVER);843843 if (error) {844844 driver_unregister(&drv->driver);···856856857857 mutex_lock(&serio_mutex);858858859859- drv->manual_bind = 1; /* so serio_find_driver ignores it */859859+ drv->manual_bind = true; /* so serio_find_driver ignores it */860860 serio_remove_pending_events(drv);861861862862start_over:···933933#ifdef CONFIG_PM934934static int serio_suspend(struct device *dev, pm_message_t state)935935{936936- if (dev->power.power_state.event != state.event) {937937- if (state.event == PM_EVENT_SUSPEND)938938- serio_cleanup(to_serio_port(dev));936936+ struct serio *serio = to_serio_port(dev);939937940940- dev->power.power_state = state;938938+ if (!serio->suspended && state.event == PM_EVENT_SUSPEND) {939939+ serio_cleanup(serio);940940+ serio->suspended = true;941941 }942942943943 return 0;···945945946946static int serio_resume(struct device *dev)947947{948948+ struct serio *serio = to_serio_port(dev);949949+948950 /*949951 * Driver reconnect can take a while, so better let kseriod950952 * deal with it.951953 */952952- if (dev->power.power_state.event != PM_EVENT_ON) {953953- dev->power.power_state = PMSG_ON;954954- serio_queue_event(to_serio_port(dev), NULL,955955- SERIO_RECONNECT_PORT);954954+ if (serio->suspended) {955955+ serio->suspended = false;956956+ serio_queue_event(serio, NULL, SERIO_RECONNECT_PORT);956957 }957958958959 return 0;