tty: core: Add driver name to invalid device registration message
authorPeter Hurley <peter@hurleysoftware.com>
Sun, 8 Nov 2015 18:01:15 +0000 (13:01 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Dec 2015 03:59:48 +0000 (19:59 -0800)
Include the driver name in the tty_register_device_attr() error
message for invalid index.

Note that tty_err() cannot be used here because there is no tty;
use pr_err().

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c

index b64cd64..86e379a 100644 (file)
@@ -3249,8 +3249,8 @@ struct device *tty_register_device_attr(struct tty_driver *driver,
        bool cdev = false;
 
        if (index >= driver->num) {
-               printk(KERN_ERR "Attempt to register invalid tty line number "
-                      " (%d).\n", index);
+               pr_err("%s: Attempt to register invalid tty line number (%d)\n",
+                      driver->name, index);
                return ERR_PTR(-EINVAL);
        }