Skip to content

Commit

Permalink
staging: dgnc: remove sysfs files
Browse files Browse the repository at this point in the history
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Dec 1, 2016
1 parent f1706cb commit 1eb388b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 770 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/dgnc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 3 additions & 11 deletions drivers/staging/dgnc/dgnc_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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]);
}
Expand All @@ -588,7 +581,7 @@ static void cleanup(bool sysfiles)
*/
static void __exit dgnc_cleanup_module(void)
{
cleanup(true);
cleanup();
pci_unregister_driver(&dgnc_driver);
}

Expand All @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion drivers/staging/dgnc/dgnc_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <linux/interrupt.h>

#include "digi.h" /* Digi specific ioctl header */
#include "dgnc_sysfs.h" /* Support for SYSFS */

/* Driver defines */

Expand Down
Loading

0 comments on commit 1eb388b

Please sign in to comment.