static void sci_remove(struct platform_device *dev)
{
struct sci_port *s = platform_get_drvdata(dev);
- unsigned int type = s->type; /* uart_remove_... clears it */
sci_ports_in_use &= ~BIT(s->port.line);
uart_remove_one_port(&sci_uart_driver, &s->port);
- if (s->port.fifosize > 1)
+ if (s->port.fifosize > 1) {
device_remove_file(&dev->dev, &dev_attr_rx_fifo_trigger);
- if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF ||
- type == SCI_PORT_RSCI)
device_remove_file(&dev->dev, &dev_attr_rx_fifo_timeout);
+ }
}
static const struct sci_of_data of_sci_scif_sh2 = {
ret = device_create_file(&dev->dev, &dev_attr_rx_fifo_trigger);
if (ret)
return ret;
- }
- if (sp->type == PORT_SCIFA || sp->type == PORT_SCIFB ||
- sp->type == PORT_HSCIF || sp->type == SCI_PORT_RSCI) {
+
ret = device_create_file(&dev->dev, &dev_attr_rx_fifo_timeout);
if (ret) {
- if (sp->port.fifosize > 1) {
- device_remove_file(&dev->dev,
- &dev_attr_rx_fifo_trigger);
- }
+ device_remove_file(&dev->dev, &dev_attr_rx_fifo_trigger);
return ret;
}
}