This reverts commit
978400b45fef7148d1633bbd47d5166b4dd46da9. The idea
to make write method mandatory was flawed as several client drivers
(such as atkbd) check for presence of write() method to adjust behavior
of the driver.
Reported-by: Nathan Chancellor <nathan@kernel.org>
Reported-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
return IRQ_HANDLED;
}
-static int ams_delta_serio_write(struct serio *serio, u8 data)
-{
- return -EINVAL;
-}
-
static int ams_delta_serio_open(struct serio *serio)
{
struct ams_delta_serio *priv = serio->port_data;
priv->serio = serio;
serio->id.type = SERIO_8042;
- serio->write = ams_delta_serio_write;
serio->open = ams_delta_serio_open;
serio->close = ams_delta_serio_close;
strlcpy(serio->name, "AMS DELTA keyboard adapter", sizeof(serio->name));
*/
void __serio_register_port(struct serio *serio, struct module *owner)
{
- if (!serio->write) {
- pr_err("%s: refusing to register %s without write method\n",
- __func__, serio->name);
- return;
- }
serio_init_port(serio);
serio_queue_event(serio, owner, SERIO_REGISTER_PORT);
}
static inline int serio_write(struct serio *serio, unsigned char data)
{
- return serio->write(serio, data);
+ if (serio->write)
+ return serio->write(serio, data);
+ else
+ return -1;
}
static inline void serio_drv_write_wakeup(struct serio *serio)