Commit 1eb388b6 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: dgnc: remove sysfs files

The dgnc driver has no business creating "custom" sysfs files just for a
single tty driver.  Combined with the odd way they are created, it's
just a mess, so remove them entirely as I am tired of tripping over them
when doing driver core changes.

Cc: Lidza Louina <lidza.louina@gmail.com>
Cc: Mark Hounschell <markh@compro.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f1706cb7
......@@ -2,5 +2,4 @@ obj-$(CONFIG_DGNC) += dgnc.o
dgnc-objs := dgnc_cls.o dgnc_driver.o\
dgnc_mgmt.o dgnc_neo.o\
dgnc_tty.o dgnc_sysfs.o\
dgnc_utils.o
dgnc_tty.o dgnc_utils.o
......@@ -24,7 +24,6 @@
#include "dgnc_tty.h"
#include "dgnc_cls.h"
#include "dgnc_neo.h"
#include "dgnc_sysfs.h"
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Digi International, http://www.digi.com");
......@@ -419,8 +418,6 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
brd->state = BOARD_READY;
brd->dpastatus = BD_RUNNING;
dgnc_create_ports_sysfiles(brd);
dgnc_board[dgnc_num_boards++] = brd;
return 0;
......@@ -555,7 +552,7 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
/* Driver load/unload functions */
static void cleanup(bool sysfiles)
static void cleanup(void)
{
int i;
unsigned long flags;
......@@ -567,15 +564,11 @@ static void cleanup(bool sysfiles)
/* Turn off poller right away. */
del_timer_sync(&dgnc_poll_timer);
if (sysfiles)
dgnc_remove_driver_sysfiles(&dgnc_driver);
device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
class_destroy(dgnc_class);
unregister_chrdev(dgnc_major, "dgnc");
for (i = 0; i < dgnc_num_boards; ++i) {
dgnc_remove_ports_sysfiles(dgnc_board[i]);
dgnc_cleanup_tty(dgnc_board[i]);
dgnc_cleanup_board(dgnc_board[i]);
}
......@@ -588,7 +581,7 @@ static void cleanup(bool sysfiles)
*/
static void __exit dgnc_cleanup_module(void)
{
cleanup(true);
cleanup();
pci_unregister_driver(&dgnc_driver);
}
......@@ -613,10 +606,9 @@ static int __init dgnc_init_module(void)
rc = pci_register_driver(&dgnc_driver);
if (rc) {
pr_warn("WARNING: dgnc driver load failed. No Digi Neo or Classic boards found.\n");
cleanup(false);
cleanup();
return rc;
}
dgnc_create_driver_sysfiles(&dgnc_driver);
return 0;
}
......
......@@ -23,7 +23,6 @@
#include <linux/interrupt.h>
#include "digi.h" /* Digi specific ioctl header */
#include "dgnc_sysfs.h" /* Support for SYSFS */
/* Driver defines */
......
This diff is collapsed.
/*
* Copyright 2003 Digi International (www.digi.com)
* Scott H Kilau <Scott_Kilau at digi dot com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*/
#ifndef __DGNC_SYSFS_H
#define __DGNC_SYSFS_H
#include <linux/device.h>
#include "dgnc_driver.h"
struct dgnc_board;
struct channel_t;
struct un_t;
struct pci_driver;
struct class_device;
void dgnc_create_ports_sysfiles(struct dgnc_board *bd);
void dgnc_remove_ports_sysfiles(struct dgnc_board *bd);
void dgnc_create_driver_sysfiles(struct pci_driver *);
void dgnc_remove_driver_sysfiles(struct pci_driver *);
int dgnc_tty_class_init(void);
int dgnc_tty_class_destroy(void);
void dgnc_create_tty_sysfs(struct un_t *un, struct device *c);
void dgnc_remove_tty_sysfs(struct device *c);
#endif
......@@ -35,7 +35,6 @@
#include "dgnc_tty.h"
#include "dgnc_neo.h"
#include "dgnc_cls.h"
#include "dgnc_sysfs.h"
#include "dgnc_utils.h"
/* Default transparent print information. */
......@@ -304,12 +303,10 @@ int dgnc_tty_init(struct dgnc_board *brd)
classp = tty_register_device(brd->serial_driver, i,
&ch->ch_bd->pdev->dev);
ch->ch_tun.un_sysfs = classp;
dgnc_create_tty_sysfs(&ch->ch_tun, classp);
classp = tty_register_device(brd->print_driver, i,
&ch->ch_bd->pdev->dev);
ch->ch_pun.un_sysfs = classp;
dgnc_create_tty_sysfs(&ch->ch_pun, classp);
}
}
......@@ -333,20 +330,14 @@ void dgnc_cleanup_tty(struct dgnc_board *brd)
{
int i = 0;
for (i = 0; i < brd->nasync; i++) {
if (brd->channels[i])
dgnc_remove_tty_sysfs(brd->channels[i]->
ch_tun.un_sysfs);
for (i = 0; i < brd->nasync; i++)
tty_unregister_device(brd->serial_driver, i);
}
tty_unregister_driver(brd->serial_driver);
for (i = 0; i < brd->nasync; i++) {
if (brd->channels[i])
dgnc_remove_tty_sysfs(brd->channels[i]->
ch_pun.un_sysfs);
for (i = 0; i < brd->nasync; i++)
tty_unregister_device(brd->print_driver, i);
}
tty_unregister_driver(brd->print_driver);
put_tty_driver(brd->serial_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment