2 * Copyright 2004 Digi International (www.digi.com)
3 * Scott H Kilau <Scott_Kilau at digi dot com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the
12 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 * PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 * NOTE TO LINUX KERNEL HACKERS: DO NOT REFORMAT THIS CODE!
22 * This is shared code between Digi's CVS archive and the
23 * Linux Kernel sources.
24 * Changing the source just for reformatting needlessly breaks
25 * our CVS diff history.
27 * Send any bug fixes/changes to: Eng.Linux at digi dot com.
33 #include <linux/kernel.h>
34 #include <linux/module.h>
35 #include <linux/ctype.h>
36 #include <linux/string.h>
37 #include <linux/serial_reg.h>
38 #include <linux/device.h>
39 #include <linux/pci.h>
40 #include <linux/kdev_t.h>
42 #include "dgnc_driver.h"
43 #include "dgnc_mgmt.h"
46 static ssize_t dgnc_driver_version_show(struct device_driver *ddp, char *buf)
48 return snprintf(buf, PAGE_SIZE, "%s\n", DG_PART);
50 static DRIVER_ATTR(version, S_IRUSR, dgnc_driver_version_show, NULL);
53 static ssize_t dgnc_driver_boards_show(struct device_driver *ddp, char *buf)
55 return snprintf(buf, PAGE_SIZE, "%d\n", dgnc_NumBoards);
57 static DRIVER_ATTR(boards, S_IRUSR, dgnc_driver_boards_show, NULL);
60 static ssize_t dgnc_driver_maxboards_show(struct device_driver *ddp, char *buf)
62 return snprintf(buf, PAGE_SIZE, "%d\n", MAXBOARDS);
64 static DRIVER_ATTR(maxboards, S_IRUSR, dgnc_driver_maxboards_show, NULL);
67 static ssize_t dgnc_driver_pollcounter_show(struct device_driver *ddp, char *buf)
69 return snprintf(buf, PAGE_SIZE, "%ld\n", dgnc_poll_counter);
71 static DRIVER_ATTR(pollcounter, S_IRUSR, dgnc_driver_pollcounter_show, NULL);
74 static ssize_t dgnc_driver_state_show(struct device_driver *ddp, char *buf)
76 return snprintf(buf, PAGE_SIZE, "%s\n", dgnc_driver_state_text[dgnc_driver_state]);
78 static DRIVER_ATTR(state, S_IRUSR, dgnc_driver_state_show, NULL);
81 static ssize_t dgnc_driver_debug_show(struct device_driver *ddp, char *buf)
83 return snprintf(buf, PAGE_SIZE, "0x%x\n", dgnc_debug);
86 static ssize_t dgnc_driver_debug_store(struct device_driver *ddp, const char *buf, size_t count)
88 sscanf(buf, "0x%x\n", &dgnc_debug);
91 static DRIVER_ATTR(debug, (S_IRUSR | S_IWUSR), dgnc_driver_debug_show, dgnc_driver_debug_store);
94 static ssize_t dgnc_driver_rawreadok_show(struct device_driver *ddp, char *buf)
96 return snprintf(buf, PAGE_SIZE, "0x%x\n", dgnc_rawreadok);
99 static ssize_t dgnc_driver_rawreadok_store(struct device_driver *ddp, const char *buf, size_t count)
101 sscanf(buf, "0x%x\n", &dgnc_rawreadok);
104 static DRIVER_ATTR(rawreadok, (S_IRUSR | S_IWUSR), dgnc_driver_rawreadok_show, dgnc_driver_rawreadok_store);
107 static ssize_t dgnc_driver_pollrate_show(struct device_driver *ddp, char *buf)
109 return snprintf(buf, PAGE_SIZE, "%dms\n", dgnc_poll_tick);
112 static ssize_t dgnc_driver_pollrate_store(struct device_driver *ddp, const char *buf, size_t count)
114 sscanf(buf, "%d\n", &dgnc_poll_tick);
117 static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgnc_driver_pollrate_show, dgnc_driver_pollrate_store);
120 void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver)
123 struct device_driver *driverfs = &dgnc_driver->driver;
125 rc |= driver_create_file(driverfs, &driver_attr_version);
126 rc |= driver_create_file(driverfs, &driver_attr_boards);
127 rc |= driver_create_file(driverfs, &driver_attr_maxboards);
128 rc |= driver_create_file(driverfs, &driver_attr_debug);
129 rc |= driver_create_file(driverfs, &driver_attr_rawreadok);
130 rc |= driver_create_file(driverfs, &driver_attr_pollrate);
131 rc |= driver_create_file(driverfs, &driver_attr_pollcounter);
132 rc |= driver_create_file(driverfs, &driver_attr_state);
134 printk(KERN_ERR "DGNC: sysfs driver_create_file failed!\n");
139 void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
141 struct device_driver *driverfs = &dgnc_driver->driver;
142 driver_remove_file(driverfs, &driver_attr_version);
143 driver_remove_file(driverfs, &driver_attr_boards);
144 driver_remove_file(driverfs, &driver_attr_maxboards);
145 driver_remove_file(driverfs, &driver_attr_debug);
146 driver_remove_file(driverfs, &driver_attr_rawreadok);
147 driver_remove_file(driverfs, &driver_attr_pollrate);
148 driver_remove_file(driverfs, &driver_attr_pollcounter);
149 driver_remove_file(driverfs, &driver_attr_state);
153 #define DGNC_VERIFY_BOARD(p, bd) \
157 bd = dev_get_drvdata(p); \
158 if (!bd || bd->magic != DGNC_BOARD_MAGIC) \
160 if (bd->state != BOARD_READY) \
165 static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr, char *buf)
171 DGNC_VERIFY_BOARD(p, bd);
173 count += sprintf(buf + count, "\n 0 1 2 3 4 5 6 7 8 9 A B C D E F");
174 for (i = 0; i < 0x40 * 2; i++) {
176 count += sprintf(buf + count, "\n%04X ", i * 2);
177 count += sprintf(buf + count, "%02X ", bd->vpd[i]);
179 count += sprintf(buf + count, "\n");
183 static DEVICE_ATTR(vpd, S_IRUSR, dgnc_vpd_show, NULL);
185 static ssize_t dgnc_serial_number_show(struct device *p, struct device_attribute *attr, char *buf)
190 DGNC_VERIFY_BOARD(p, bd);
192 if (bd->serial_num[0] == '\0')
193 count += sprintf(buf + count, "<UNKNOWN>\n");
195 count += sprintf(buf + count, "%s\n", bd->serial_num);
199 static DEVICE_ATTR(serial_number, S_IRUSR, dgnc_serial_number_show, NULL);
202 static ssize_t dgnc_ports_state_show(struct device *p, struct device_attribute *attr, char *buf)
208 DGNC_VERIFY_BOARD(p, bd);
210 for (i = 0; i < bd->nasync; i++) {
211 count += snprintf(buf + count, PAGE_SIZE - count,
212 "%d %s\n", bd->channels[i]->ch_portnum,
213 bd->channels[i]->ch_open_count ? "Open" : "Closed");
217 static DEVICE_ATTR(ports_state, S_IRUSR, dgnc_ports_state_show, NULL);
220 static ssize_t dgnc_ports_baud_show(struct device *p, struct device_attribute *attr, char *buf)
226 DGNC_VERIFY_BOARD(p, bd);
228 for (i = 0; i < bd->nasync; i++) {
229 count += snprintf(buf + count, PAGE_SIZE - count,
230 "%d %d\n", bd->channels[i]->ch_portnum, bd->channels[i]->ch_old_baud);
234 static DEVICE_ATTR(ports_baud, S_IRUSR, dgnc_ports_baud_show, NULL);
237 static ssize_t dgnc_ports_msignals_show(struct device *p, struct device_attribute *attr, char *buf)
243 DGNC_VERIFY_BOARD(p, bd);
245 for (i = 0; i < bd->nasync; i++) {
246 if (bd->channels[i]->ch_open_count) {
247 count += snprintf(buf + count, PAGE_SIZE - count,
248 "%d %s %s %s %s %s %s\n", bd->channels[i]->ch_portnum,
249 (bd->channels[i]->ch_mostat & UART_MCR_RTS) ? "RTS" : "",
250 (bd->channels[i]->ch_mistat & UART_MSR_CTS) ? "CTS" : "",
251 (bd->channels[i]->ch_mostat & UART_MCR_DTR) ? "DTR" : "",
252 (bd->channels[i]->ch_mistat & UART_MSR_DSR) ? "DSR" : "",
253 (bd->channels[i]->ch_mistat & UART_MSR_DCD) ? "DCD" : "",
254 (bd->channels[i]->ch_mistat & UART_MSR_RI) ? "RI" : "");
256 count += snprintf(buf + count, PAGE_SIZE - count,
257 "%d\n", bd->channels[i]->ch_portnum);
262 static DEVICE_ATTR(ports_msignals, S_IRUSR, dgnc_ports_msignals_show, NULL);
265 static ssize_t dgnc_ports_iflag_show(struct device *p, struct device_attribute *attr, char *buf)
271 DGNC_VERIFY_BOARD(p, bd);
273 for (i = 0; i < bd->nasync; i++) {
274 count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
275 bd->channels[i]->ch_portnum, bd->channels[i]->ch_c_iflag);
279 static DEVICE_ATTR(ports_iflag, S_IRUSR, dgnc_ports_iflag_show, NULL);
282 static ssize_t dgnc_ports_cflag_show(struct device *p, struct device_attribute *attr, char *buf)
288 DGNC_VERIFY_BOARD(p, bd);
290 for (i = 0; i < bd->nasync; i++) {
291 count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
292 bd->channels[i]->ch_portnum, bd->channels[i]->ch_c_cflag);
296 static DEVICE_ATTR(ports_cflag, S_IRUSR, dgnc_ports_cflag_show, NULL);
299 static ssize_t dgnc_ports_oflag_show(struct device *p, struct device_attribute *attr, char *buf)
305 DGNC_VERIFY_BOARD(p, bd);
307 for (i = 0; i < bd->nasync; i++) {
308 count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
309 bd->channels[i]->ch_portnum, bd->channels[i]->ch_c_oflag);
313 static DEVICE_ATTR(ports_oflag, S_IRUSR, dgnc_ports_oflag_show, NULL);
316 static ssize_t dgnc_ports_lflag_show(struct device *p, struct device_attribute *attr, char *buf)
322 DGNC_VERIFY_BOARD(p, bd);
324 for (i = 0; i < bd->nasync; i++) {
325 count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
326 bd->channels[i]->ch_portnum, bd->channels[i]->ch_c_lflag);
330 static DEVICE_ATTR(ports_lflag, S_IRUSR, dgnc_ports_lflag_show, NULL);
333 static ssize_t dgnc_ports_digi_flag_show(struct device *p, struct device_attribute *attr, char *buf)
339 DGNC_VERIFY_BOARD(p, bd);
341 for (i = 0; i < bd->nasync; i++) {
342 count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
343 bd->channels[i]->ch_portnum, bd->channels[i]->ch_digi.digi_flags);
347 static DEVICE_ATTR(ports_digi_flag, S_IRUSR, dgnc_ports_digi_flag_show, NULL);
350 static ssize_t dgnc_ports_rxcount_show(struct device *p, struct device_attribute *attr, char *buf)
356 DGNC_VERIFY_BOARD(p, bd);
358 for (i = 0; i < bd->nasync; i++) {
359 count += snprintf(buf + count, PAGE_SIZE - count, "%d %ld\n",
360 bd->channels[i]->ch_portnum, bd->channels[i]->ch_rxcount);
364 static DEVICE_ATTR(ports_rxcount, S_IRUSR, dgnc_ports_rxcount_show, NULL);
367 static ssize_t dgnc_ports_txcount_show(struct device *p, struct device_attribute *attr, char *buf)
373 DGNC_VERIFY_BOARD(p, bd);
375 for (i = 0; i < bd->nasync; i++) {
376 count += snprintf(buf + count, PAGE_SIZE - count, "%d %ld\n",
377 bd->channels[i]->ch_portnum, bd->channels[i]->ch_txcount);
381 static DEVICE_ATTR(ports_txcount, S_IRUSR, dgnc_ports_txcount_show, NULL);
384 /* this function creates the sys files that will export each signal status
385 * to sysfs each value will be put in a separate filename
387 void dgnc_create_ports_sysfiles(struct board_t *bd)
391 dev_set_drvdata(&bd->pdev->dev, bd);
392 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_state);
393 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_baud);
394 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_msignals);
395 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_iflag);
396 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_cflag);
397 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_oflag);
398 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_lflag);
399 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_digi_flag);
400 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_rxcount);
401 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_txcount);
402 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_vpd);
403 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_serial_number);
405 printk(KERN_ERR "DGNC: sysfs device_create_file failed!\n");
410 /* removes all the sys files created for that port */
411 void dgnc_remove_ports_sysfiles(struct board_t *bd)
413 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_state);
414 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_baud);
415 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_msignals);
416 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_iflag);
417 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_cflag);
418 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_oflag);
419 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_lflag);
420 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_digi_flag);
421 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_rxcount);
422 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_txcount);
423 device_remove_file(&(bd->pdev->dev), &dev_attr_vpd);
424 device_remove_file(&(bd->pdev->dev), &dev_attr_serial_number);
428 static ssize_t dgnc_tty_state_show(struct device *d, struct device_attribute *attr, char *buf)
431 struct channel_t *ch;
436 un = (struct un_t *) dev_get_drvdata(d);
437 if (!un || un->magic != DGNC_UNIT_MAGIC)
440 if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
443 if (!bd || bd->magic != DGNC_BOARD_MAGIC)
445 if (bd->state != BOARD_READY)
448 return snprintf(buf, PAGE_SIZE, "%s", un->un_open_count ? "Open" : "Closed");
450 static DEVICE_ATTR(state, S_IRUSR, dgnc_tty_state_show, NULL);
453 static ssize_t dgnc_tty_baud_show(struct device *d, struct device_attribute *attr, char *buf)
456 struct channel_t *ch;
461 un = (struct un_t *) dev_get_drvdata(d);
462 if (!un || un->magic != DGNC_UNIT_MAGIC)
465 if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
468 if (!bd || bd->magic != DGNC_BOARD_MAGIC)
470 if (bd->state != BOARD_READY)
473 return snprintf(buf, PAGE_SIZE, "%d\n", ch->ch_old_baud);
475 static DEVICE_ATTR(baud, S_IRUSR, dgnc_tty_baud_show, NULL);
478 static ssize_t dgnc_tty_msignals_show(struct device *d, struct device_attribute *attr, char *buf)
481 struct channel_t *ch;
486 un = (struct un_t *) dev_get_drvdata(d);
487 if (!un || un->magic != DGNC_UNIT_MAGIC)
490 if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
493 if (!bd || bd->magic != DGNC_BOARD_MAGIC)
495 if (bd->state != BOARD_READY)
498 if (ch->ch_open_count) {
499 return snprintf(buf, PAGE_SIZE, "%s %s %s %s %s %s\n",
500 (ch->ch_mostat & UART_MCR_RTS) ? "RTS" : "",
501 (ch->ch_mistat & UART_MSR_CTS) ? "CTS" : "",
502 (ch->ch_mostat & UART_MCR_DTR) ? "DTR" : "",
503 (ch->ch_mistat & UART_MSR_DSR) ? "DSR" : "",
504 (ch->ch_mistat & UART_MSR_DCD) ? "DCD" : "",
505 (ch->ch_mistat & UART_MSR_RI) ? "RI" : "");
509 static DEVICE_ATTR(msignals, S_IRUSR, dgnc_tty_msignals_show, NULL);
512 static ssize_t dgnc_tty_iflag_show(struct device *d, struct device_attribute *attr, char *buf)
515 struct channel_t *ch;
520 un = (struct un_t *) dev_get_drvdata(d);
521 if (!un || un->magic != DGNC_UNIT_MAGIC)
524 if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
527 if (!bd || bd->magic != DGNC_BOARD_MAGIC)
529 if (bd->state != BOARD_READY)
532 return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_iflag);
534 static DEVICE_ATTR(iflag, S_IRUSR, dgnc_tty_iflag_show, NULL);
537 static ssize_t dgnc_tty_cflag_show(struct device *d, struct device_attribute *attr, char *buf)
540 struct channel_t *ch;
545 un = (struct un_t *) dev_get_drvdata(d);
546 if (!un || un->magic != DGNC_UNIT_MAGIC)
549 if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
552 if (!bd || bd->magic != DGNC_BOARD_MAGIC)
554 if (bd->state != BOARD_READY)
557 return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_cflag);
559 static DEVICE_ATTR(cflag, S_IRUSR, dgnc_tty_cflag_show, NULL);
562 static ssize_t dgnc_tty_oflag_show(struct device *d, struct device_attribute *attr, char *buf)
565 struct channel_t *ch;
570 un = (struct un_t *) dev_get_drvdata(d);
571 if (!un || un->magic != DGNC_UNIT_MAGIC)
574 if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
577 if (!bd || bd->magic != DGNC_BOARD_MAGIC)
579 if (bd->state != BOARD_READY)
582 return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_oflag);
584 static DEVICE_ATTR(oflag, S_IRUSR, dgnc_tty_oflag_show, NULL);
587 static ssize_t dgnc_tty_lflag_show(struct device *d, struct device_attribute *attr, char *buf)
590 struct channel_t *ch;
595 un = (struct un_t *) dev_get_drvdata(d);
596 if (!un || un->magic != DGNC_UNIT_MAGIC)
599 if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
602 if (!bd || bd->magic != DGNC_BOARD_MAGIC)
604 if (bd->state != BOARD_READY)
607 return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_lflag);
609 static DEVICE_ATTR(lflag, S_IRUSR, dgnc_tty_lflag_show, NULL);
612 static ssize_t dgnc_tty_digi_flag_show(struct device *d, struct device_attribute *attr, char *buf)
615 struct channel_t *ch;
620 un = (struct un_t *) dev_get_drvdata(d);
621 if (!un || un->magic != DGNC_UNIT_MAGIC)
624 if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
627 if (!bd || bd->magic != DGNC_BOARD_MAGIC)
629 if (bd->state != BOARD_READY)
632 return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_digi.digi_flags);
634 static DEVICE_ATTR(digi_flag, S_IRUSR, dgnc_tty_digi_flag_show, NULL);
637 static ssize_t dgnc_tty_rxcount_show(struct device *d, struct device_attribute *attr, char *buf)
640 struct channel_t *ch;
645 un = (struct un_t *) dev_get_drvdata(d);
646 if (!un || un->magic != DGNC_UNIT_MAGIC)
649 if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
652 if (!bd || bd->magic != DGNC_BOARD_MAGIC)
654 if (bd->state != BOARD_READY)
657 return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_rxcount);
659 static DEVICE_ATTR(rxcount, S_IRUSR, dgnc_tty_rxcount_show, NULL);
662 static ssize_t dgnc_tty_txcount_show(struct device *d, struct device_attribute *attr, char *buf)
665 struct channel_t *ch;
670 un = (struct un_t *) dev_get_drvdata(d);
671 if (!un || un->magic != DGNC_UNIT_MAGIC)
674 if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
677 if (!bd || bd->magic != DGNC_BOARD_MAGIC)
679 if (bd->state != BOARD_READY)
682 return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_txcount);
684 static DEVICE_ATTR(txcount, S_IRUSR, dgnc_tty_txcount_show, NULL);
687 static ssize_t dgnc_tty_name_show(struct device *d, struct device_attribute *attr, char *buf)
690 struct channel_t *ch;
695 un = (struct un_t *) dev_get_drvdata(d);
696 if (!un || un->magic != DGNC_UNIT_MAGIC)
699 if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
702 if (!bd || bd->magic != DGNC_BOARD_MAGIC)
704 if (bd->state != BOARD_READY)
707 return snprintf(buf, PAGE_SIZE, "%sn%d%c\n",
708 (un->un_type == DGNC_PRINT) ? "pr" : "tty",
709 bd->boardnum + 1, 'a' + ch->ch_portnum);
711 static DEVICE_ATTR(custom_name, S_IRUSR, dgnc_tty_name_show, NULL);
714 static struct attribute *dgnc_sysfs_tty_entries[] = {
715 &dev_attr_state.attr,
717 &dev_attr_msignals.attr,
718 &dev_attr_iflag.attr,
719 &dev_attr_cflag.attr,
720 &dev_attr_oflag.attr,
721 &dev_attr_lflag.attr,
722 &dev_attr_digi_flag.attr,
723 &dev_attr_rxcount.attr,
724 &dev_attr_txcount.attr,
725 &dev_attr_custom_name.attr,
730 static struct attribute_group dgnc_tty_attribute_group = {
732 .attrs = dgnc_sysfs_tty_entries,
736 void dgnc_create_tty_sysfs(struct un_t *un, struct device *c)
740 ret = sysfs_create_group(&c->kobj, &dgnc_tty_attribute_group);
742 printk(KERN_ERR "dgnc: failed to create sysfs tty device attributes.\n");
743 sysfs_remove_group(&c->kobj, &dgnc_tty_attribute_group);
747 dev_set_drvdata(c, un);
752 void dgnc_remove_tty_sysfs(struct device *c)
754 sysfs_remove_group(&c->kobj, &dgnc_tty_attribute_group);