summaryrefslogtreecommitdiff
path: root/drivers/input/mouse/psmouse-base.c
diff options
context:
space:
mode:
authorDeepak Saxena <dsaxena@laptop.org>2008-09-22 15:19:35 -0700
committerDeepak Saxena <dsaxena@laptop.org>2008-09-22 15:19:35 -0700
commit38b5fedf917fc36d68f9712541d46dbccb4d7cb1 (patch)
treecf2f00872e3b5329d3de69e4ad04012588129c58 /drivers/input/mouse/psmouse-base.c
parentf2c3fe6773a10211fb125a493d061d7365ec8e68 (diff)
downloadlwn-761.tar.gz
lwn-761.zip
Revert "psmouse: upstream sync, fix low power toggle bugs"763762761
This reverts commit 93970329291a9ff73301a96a27c4af274f096835. The original commit contains changes to psmouse-base.c and olpc.c that mention an upstream fix and fixing a low power toggle bug but the commit does not point to an upstream source or describe what the bug is. Upon searching lkml, it looks like this commit is a merge of several patches sent upstream. As this has not received wide-spread testing yet, I am reverting for now and we can add the changes back in properly as separate commits after the 8.2 release. Signed-off-by: Deepak Saxena <dsaxena@laptop.org>
Diffstat (limited to 'drivers/input/mouse/psmouse-base.c')
-rw-r--r--drivers/input/mouse/psmouse-base.c44
1 files changed, 17 insertions, 27 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index eb999580058b..28aa38db166b 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -202,12 +202,6 @@ static psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse)
return PSMOUSE_FULL_PACKET;
}
-void psmouse_queue_work(struct psmouse *psmouse, struct delayed_work *work,
- unsigned long delay)
-{
- queue_delayed_work(kpsmoused_wq, work, delay);
-}
-
/*
* __psmouse_set_state() sets new psmouse state and resets all flags.
*/
@@ -312,7 +306,7 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
psmouse->name, psmouse->phys, psmouse->pktcnt);
psmouse->badbyte = psmouse->packet[0];
__psmouse_set_state(psmouse, PSMOUSE_RESYNCING);
- psmouse_queue_work(psmouse, &psmouse->resync_work, 0);
+ queue_work(kpsmoused_wq, &psmouse->resync_work);
goto out;
}
@@ -350,7 +344,7 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
time_after(jiffies, psmouse->last + psmouse->resync_time * HZ)) {
psmouse->badbyte = psmouse->packet[0];
__psmouse_set_state(psmouse, PSMOUSE_RESYNCING);
- psmouse_queue_work(psmouse, &psmouse->resync_work, 0);
+ queue_work(kpsmoused_wq, &psmouse->resync_work);
goto out;
}
@@ -964,7 +958,7 @@ static int psmouse_poll(struct psmouse *psmouse)
static void psmouse_resync(struct work_struct *work)
{
struct psmouse *parent = NULL, *psmouse =
- container_of(work, struct psmouse, resync_work.work);
+ container_of(work, struct psmouse, resync_work);
struct serio *serio = psmouse->ps2dev.serio;
psmouse_ret_t rc = PSMOUSE_GOOD_DATA;
int failed = 0, enabled = 0;
@@ -1223,7 +1217,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)
goto err_free;
ps2_init(&psmouse->ps2dev, serio);
- INIT_DELAYED_WORK(&psmouse->resync_work, psmouse_resync);
+ INIT_WORK(&psmouse->resync_work, psmouse_resync);
psmouse->dev = input_dev;
snprintf(psmouse->phys, sizeof(psmouse->phys), "%s/input0", serio->phys);
@@ -1424,29 +1418,25 @@ ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *dev
psmouse = serio_get_drvdata(serio);
- if (attr->protect) {
- if (psmouse->state == PSMOUSE_IGNORE) {
- retval = -ENODEV;
- goto out_unlock;
- }
-
- if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
- parent = serio_get_drvdata(serio->parent);
- psmouse_deactivate(parent);
- }
+ if (psmouse->state == PSMOUSE_IGNORE) {
+ retval = -ENODEV;
+ goto out_unlock;
+ }
- psmouse_deactivate(psmouse);
+ if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
+ parent = serio_get_drvdata(serio->parent);
+ psmouse_deactivate(parent);
}
+ psmouse_deactivate(psmouse);
+
retval = attr->set(psmouse, attr->data, buf, count);
- if (attr->protect) {
- if (retval != -ENODEV)
- psmouse_activate(psmouse);
+ if (retval != -ENODEV)
+ psmouse_activate(psmouse);
- if (parent)
- psmouse_activate(parent);
- }
+ if (parent)
+ psmouse_activate(parent);
out_unlock:
mutex_unlock(&psmouse_mutex);