From: Dmitry Torokhov Date: Wed, 6 Jan 2010 01:56:04 +0000 (-0800) Subject: Input: serio - let device core tell us if device was registered X-Git-Tag: upstream/snapshot3+hdmi~14653^2~44^2~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddf1ffbd40c92ff1e58c45fa96d309788f7beb60;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Input: serio - let device core tell us if device was registered No need to keep track of it by ourselves. Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 0a278f9..d898804 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -577,8 +577,6 @@ static void serio_add_port(struct serio *serio) printk(KERN_ERR "serio: device_add() failed for %s (%s), error: %d\n", serio->phys, serio->name, error); - else - serio->registered = true; } /* @@ -605,10 +603,8 @@ static void serio_destroy_port(struct serio *serio) serio->parent = NULL; } - if (serio->registered) { + if (device_is_registered(&serio->dev)) device_del(&serio->dev); - serio->registered = false; - } list_del_init(&serio->node); serio_remove_pending_events(serio); @@ -995,7 +991,7 @@ irqreturn_t serio_interrupt(struct serio *serio, if (likely(serio->drv)) { ret = serio->drv->interrupt(serio, data, dfl); - } else if (!dfl && serio->registered) { + } else if (!dfl && device_is_registered(&serio->dev)) { serio_rescan(serio); ret = IRQ_HANDLED; } diff --git a/include/linux/serio.h b/include/linux/serio.h index e2f3044..d0fb702 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h @@ -30,7 +30,6 @@ struct serio { char phys[32]; bool manual_bind; - bool registered; /* port has been fully registered with driver core */ struct serio_device_id id;