serial: xuartps: Get rid of register access macros.
[firefly-linux-kernel-4.4.55.git] / drivers / tty / tty_io.c
index 2bb4dfc028734079f29a89bfb779bfdc7e0079eb..3949d9527e6de6ce026dbf423bd52f7db8040cf0 100644 (file)
@@ -3593,6 +3593,13 @@ static ssize_t show_cons_active(struct device *dev,
 }
 static DEVICE_ATTR(active, S_IRUGO, show_cons_active, NULL);
 
+static struct attribute *cons_dev_attrs[] = {
+       &dev_attr_active.attr,
+       NULL
+};
+
+ATTRIBUTE_GROUPS(cons_dev);
+
 static struct device *consdev;
 
 void console_sysfs_notify(void)
@@ -3617,12 +3624,11 @@ int __init tty_init(void)
        if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) ||
            register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0)
                panic("Couldn't register /dev/console driver\n");
-       consdev = device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL,
-                             "console");
+       consdev = device_create_with_groups(tty_class, NULL,
+                                           MKDEV(TTYAUX_MAJOR, 1), NULL,
+                                           cons_dev_groups, "console");
        if (IS_ERR(consdev))
                consdev = NULL;
-       else
-               WARN_ON(device_create_file(consdev, &dev_attr_active) < 0);
 
 #ifdef CONFIG_VT
        vty_init(&console_fops);