]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
serial: sh-sci: use driver core functions, not sysfs ones.
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Jul 2019 08:46:09 +0000 (10:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Sep 2019 10:43:49 +0000 (12:43 +0200)
This is a driver, do not call "raw" sysfs functions, instead call driver
core ones.  Specifically convert the use of sysfs_create_file() and
sysfs_remove_file() to use device_create_file() and device_remove_file()

Cc: Jiri Slaby <jslaby@suse.com>
Cc: linux-serial@vger.kernel.org
Link: https://lore.kernel.org/r/20190704084617.3602-4-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sh-sci.c

index d18c680aa64b34273075d9388413c954996d193f..91af4cd1ee03b0f7d578c1cb0473134883190044 100644 (file)
@@ -3152,14 +3152,10 @@ static int sci_remove(struct platform_device *dev)
 
        sci_cleanup_single(port);
 
-       if (port->port.fifosize > 1) {
-               sysfs_remove_file(&dev->dev.kobj,
-                                 &dev_attr_rx_fifo_trigger.attr);
-       }
-       if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF) {
-               sysfs_remove_file(&dev->dev.kobj,
-                                 &dev_attr_rx_fifo_timeout.attr);
-       }
+       if (port->port.fifosize > 1)
+               device_remove_file(&dev->dev, &dev_attr_rx_fifo_trigger);
+       if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF)
+               device_remove_file(&dev->dev, &dev_attr_rx_fifo_timeout);
 
        return 0;
 }
@@ -3347,19 +3343,17 @@ static int sci_probe(struct platform_device *dev)
                return ret;
 
        if (sp->port.fifosize > 1) {
-               ret = sysfs_create_file(&dev->dev.kobj,
-                               &dev_attr_rx_fifo_trigger.attr);
+               ret = device_create_file(&dev->dev, &dev_attr_rx_fifo_trigger);
                if (ret)
                        return ret;
        }
        if (sp->port.type == PORT_SCIFA || sp->port.type == PORT_SCIFB ||
            sp->port.type == PORT_HSCIF) {
-               ret = sysfs_create_file(&dev->dev.kobj,
-                               &dev_attr_rx_fifo_timeout.attr);
+               ret = device_create_file(&dev->dev, &dev_attr_rx_fifo_timeout);
                if (ret) {
                        if (sp->port.fifosize > 1) {
-                               sysfs_remove_file(&dev->dev.kobj,
-                                       &dev_attr_rx_fifo_trigger.attr);
+                               device_remove_file(&dev->dev,
+                                                  &dev_attr_rx_fifo_trigger);
                        }
                        return ret;
                }