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.
32 * $Id: dgap_sysfs.c,v 1.1 2009/10/23 14:01:57 markh Exp $
36 #include <linux/kernel.h>
37 #include <linux/module.h>
38 #include <linux/ctype.h>
39 #include <linux/string.h>
40 #include <linux/serial_reg.h>
41 #include <linux/device.h>
42 #include <linux/pci.h>
43 #include <linux/kdev_t.h>
45 #include "dgap_driver.h"
46 #include "dgap_conf.h"
47 #include "dgap_parse.h"
50 static ssize_t dgap_driver_version_show(struct device_driver *ddp, char *buf)
52 return snprintf(buf, PAGE_SIZE, "%s\n", DG_PART);
54 static DRIVER_ATTR(version, S_IRUSR, dgap_driver_version_show, NULL);
57 static ssize_t dgap_driver_boards_show(struct device_driver *ddp, char *buf)
59 return snprintf(buf, PAGE_SIZE, "%d\n", dgap_NumBoards);
61 static DRIVER_ATTR(boards, S_IRUSR, dgap_driver_boards_show, NULL);
64 static ssize_t dgap_driver_maxboards_show(struct device_driver *ddp, char *buf)
66 return snprintf(buf, PAGE_SIZE, "%d\n", MAXBOARDS);
68 static DRIVER_ATTR(maxboards, S_IRUSR, dgap_driver_maxboards_show, NULL);
71 static ssize_t dgap_driver_pollcounter_show(struct device_driver *ddp, char *buf)
73 return snprintf(buf, PAGE_SIZE, "%ld\n", dgap_poll_counter);
75 static DRIVER_ATTR(pollcounter, S_IRUSR, dgap_driver_pollcounter_show, NULL);
78 static ssize_t dgap_driver_state_show(struct device_driver *ddp, char *buf)
80 return snprintf(buf, PAGE_SIZE, "%s\n", dgap_driver_state_text[dgap_driver_state]);
82 static DRIVER_ATTR(state, S_IRUSR, dgap_driver_state_show, NULL);
85 static ssize_t dgap_driver_debug_show(struct device_driver *ddp, char *buf)
87 return snprintf(buf, PAGE_SIZE, "0x%x\n", dgap_debug);
90 static ssize_t dgap_driver_debug_store(struct device_driver *ddp, const char *buf, size_t count)
92 sscanf(buf, "0x%x\n", &dgap_debug);
95 static DRIVER_ATTR(debug, (S_IRUSR | S_IWUSR), dgap_driver_debug_show, dgap_driver_debug_store);
98 static ssize_t dgap_driver_rawreadok_show(struct device_driver *ddp, char *buf)
100 return snprintf(buf, PAGE_SIZE, "0x%x\n", dgap_rawreadok);
103 static ssize_t dgap_driver_rawreadok_store(struct device_driver *ddp, const char *buf, size_t count)
105 sscanf(buf, "0x%x\n", &dgap_rawreadok);
108 static DRIVER_ATTR(rawreadok, (S_IRUSR | S_IWUSR), dgap_driver_rawreadok_show, dgap_driver_rawreadok_store);
111 static ssize_t dgap_driver_pollrate_show(struct device_driver *ddp, char *buf)
113 return snprintf(buf, PAGE_SIZE, "%dms\n", dgap_poll_tick);
116 static ssize_t dgap_driver_pollrate_store(struct device_driver *ddp, const char *buf, size_t count)
118 sscanf(buf, "%d\n", &dgap_poll_tick);
121 static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgap_driver_pollrate_show, dgap_driver_pollrate_store);
124 void dgap_create_driver_sysfiles(struct pci_driver *dgap_driver)
127 struct device_driver *driverfs = &dgap_driver->driver;
129 rc |= driver_create_file(driverfs, &driver_attr_version);
130 rc |= driver_create_file(driverfs, &driver_attr_boards);
131 rc |= driver_create_file(driverfs, &driver_attr_maxboards);
132 rc |= driver_create_file(driverfs, &driver_attr_debug);
133 rc |= driver_create_file(driverfs, &driver_attr_rawreadok);
134 rc |= driver_create_file(driverfs, &driver_attr_pollrate);
135 rc |= driver_create_file(driverfs, &driver_attr_pollcounter);
136 rc |= driver_create_file(driverfs, &driver_attr_state);
138 printk(KERN_ERR "DGAP: sysfs driver_create_file failed!\n");
143 void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
145 struct device_driver *driverfs = &dgap_driver->driver;
146 driver_remove_file(driverfs, &driver_attr_version);
147 driver_remove_file(driverfs, &driver_attr_boards);
148 driver_remove_file(driverfs, &driver_attr_maxboards);
149 driver_remove_file(driverfs, &driver_attr_debug);
150 driver_remove_file(driverfs, &driver_attr_rawreadok);
151 driver_remove_file(driverfs, &driver_attr_pollrate);
152 driver_remove_file(driverfs, &driver_attr_pollcounter);
153 driver_remove_file(driverfs, &driver_attr_state);
157 #define DGAP_VERIFY_BOARD(p, bd) \
161 bd = dev_get_drvdata(p); \
162 if (!bd || bd->magic != DGAP_BOARD_MAGIC) \
164 if (bd->state != BOARD_READY) \
168 static ssize_t dgap_ports_state_show(struct device *p, struct device_attribute *attr, char *buf)
174 DGAP_VERIFY_BOARD(p, bd);
176 for (i = 0; i < bd->nasync; i++) {
177 count += snprintf(buf + count, PAGE_SIZE - count,
178 "%d %s\n", bd->channels[i]->ch_portnum,
179 bd->channels[i]->ch_open_count ? "Open" : "Closed");
183 static DEVICE_ATTR(ports_state, S_IRUSR, dgap_ports_state_show, NULL);
186 static ssize_t dgap_ports_baud_show(struct device *p, struct device_attribute *attr, char *buf)
192 DGAP_VERIFY_BOARD(p, bd);
194 for (i = 0; i < bd->nasync; i++) {
195 count += snprintf(buf + count, PAGE_SIZE - count,
196 "%d %d\n", bd->channels[i]->ch_portnum, bd->channels[i]->ch_baud_info);
200 static DEVICE_ATTR(ports_baud, S_IRUSR, dgap_ports_baud_show, NULL);
203 static ssize_t dgap_ports_msignals_show(struct device *p, struct device_attribute *attr, char *buf)
209 DGAP_VERIFY_BOARD(p, bd);
211 for (i = 0; i < bd->nasync; i++) {
212 if (bd->channels[i]->ch_open_count) {
213 count += snprintf(buf + count, PAGE_SIZE - count,
214 "%d %s %s %s %s %s %s\n", bd->channels[i]->ch_portnum,
215 (bd->channels[i]->ch_mostat & UART_MCR_RTS) ? "RTS" : "",
216 (bd->channels[i]->ch_mistat & UART_MSR_CTS) ? "CTS" : "",
217 (bd->channels[i]->ch_mostat & UART_MCR_DTR) ? "DTR" : "",
218 (bd->channels[i]->ch_mistat & UART_MSR_DSR) ? "DSR" : "",
219 (bd->channels[i]->ch_mistat & UART_MSR_DCD) ? "DCD" : "",
220 (bd->channels[i]->ch_mistat & UART_MSR_RI) ? "RI" : "");
222 count += snprintf(buf + count, PAGE_SIZE - count,
223 "%d\n", bd->channels[i]->ch_portnum);
228 static DEVICE_ATTR(ports_msignals, S_IRUSR, dgap_ports_msignals_show, NULL);
231 static ssize_t dgap_ports_iflag_show(struct device *p, struct device_attribute *attr, char *buf)
237 DGAP_VERIFY_BOARD(p, bd);
239 for (i = 0; i < bd->nasync; i++) {
240 count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
241 bd->channels[i]->ch_portnum, bd->channels[i]->ch_c_iflag);
245 static DEVICE_ATTR(ports_iflag, S_IRUSR, dgap_ports_iflag_show, NULL);
248 static ssize_t dgap_ports_cflag_show(struct device *p, struct device_attribute *attr, char *buf)
254 DGAP_VERIFY_BOARD(p, bd);
256 for (i = 0; i < bd->nasync; i++) {
257 count += snprintf(buf + count, PAGE_SIZE - count, "%d %x\n",
258 bd->channels[i]->ch_portnum, bd->channels[i]->ch_c_cflag);
262 static DEVICE_ATTR(ports_cflag, S_IRUSR, dgap_ports_cflag_show, NULL);
265 static ssize_t dgap_ports_oflag_show(struct device *p, struct device_attribute *attr, char *buf)
271 DGAP_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_oflag);
279 static DEVICE_ATTR(ports_oflag, S_IRUSR, dgap_ports_oflag_show, NULL);
282 static ssize_t dgap_ports_lflag_show(struct device *p, struct device_attribute *attr, char *buf)
288 DGAP_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_lflag);
296 static DEVICE_ATTR(ports_lflag, S_IRUSR, dgap_ports_lflag_show, NULL);
299 static ssize_t dgap_ports_digi_flag_show(struct device *p, struct device_attribute *attr, char *buf)
305 DGAP_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_digi.digi_flags);
313 static DEVICE_ATTR(ports_digi_flag, S_IRUSR, dgap_ports_digi_flag_show, NULL);
316 static ssize_t dgap_ports_rxcount_show(struct device *p, struct device_attribute *attr, char *buf)
322 DGAP_VERIFY_BOARD(p, bd);
324 for (i = 0; i < bd->nasync; i++) {
325 count += snprintf(buf + count, PAGE_SIZE - count, "%d %ld\n",
326 bd->channels[i]->ch_portnum, bd->channels[i]->ch_rxcount);
330 static DEVICE_ATTR(ports_rxcount, S_IRUSR, dgap_ports_rxcount_show, NULL);
333 static ssize_t dgap_ports_txcount_show(struct device *p, struct device_attribute *attr, char *buf)
339 DGAP_VERIFY_BOARD(p, bd);
341 for (i = 0; i < bd->nasync; i++) {
342 count += snprintf(buf + count, PAGE_SIZE - count, "%d %ld\n",
343 bd->channels[i]->ch_portnum, bd->channels[i]->ch_txcount);
347 static DEVICE_ATTR(ports_txcount, S_IRUSR, dgap_ports_txcount_show, NULL);
350 /* this function creates the sys files that will export each signal status
351 * to sysfs each value will be put in a separate filename
353 void dgap_create_ports_sysfiles(struct board_t *bd)
357 dev_set_drvdata(&bd->pdev->dev, bd);
358 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_state);
359 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_baud);
360 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_msignals);
361 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_iflag);
362 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_cflag);
363 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_oflag);
364 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_lflag);
365 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_digi_flag);
366 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_rxcount);
367 rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_txcount);
369 printk(KERN_ERR "DGAP: sysfs device_create_file failed!\n");
374 /* removes all the sys files created for that port */
375 void dgap_remove_ports_sysfiles(struct board_t *bd)
377 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_state);
378 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_baud);
379 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_msignals);
380 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_iflag);
381 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_cflag);
382 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_oflag);
383 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_lflag);
384 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_digi_flag);
385 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_rxcount);
386 device_remove_file(&(bd->pdev->dev), &dev_attr_ports_txcount);
390 static ssize_t dgap_tty_state_show(struct device *d, struct device_attribute *attr, char *buf)
393 struct channel_t *ch;
398 un = dev_get_drvdata(d);
399 if (!un || un->magic != DGAP_UNIT_MAGIC)
402 if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
405 if (!bd || bd->magic != DGAP_BOARD_MAGIC)
407 if (bd->state != BOARD_READY)
410 return snprintf(buf, PAGE_SIZE, "%s", un->un_open_count ? "Open" : "Closed");
412 static DEVICE_ATTR(state, S_IRUSR, dgap_tty_state_show, NULL);
415 static ssize_t dgap_tty_baud_show(struct device *d, struct device_attribute *attr, char *buf)
418 struct channel_t *ch;
423 un = dev_get_drvdata(d);
424 if (!un || un->magic != DGAP_UNIT_MAGIC)
427 if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
430 if (!bd || bd->magic != DGAP_BOARD_MAGIC)
432 if (bd->state != BOARD_READY)
435 return snprintf(buf, PAGE_SIZE, "%d\n", ch->ch_baud_info);
437 static DEVICE_ATTR(baud, S_IRUSR, dgap_tty_baud_show, NULL);
440 static ssize_t dgap_tty_msignals_show(struct device *d, struct device_attribute *attr, char *buf)
443 struct channel_t *ch;
448 un = dev_get_drvdata(d);
449 if (!un || un->magic != DGAP_UNIT_MAGIC)
452 if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
455 if (!bd || bd->magic != DGAP_BOARD_MAGIC)
457 if (bd->state != BOARD_READY)
460 if (ch->ch_open_count) {
461 return snprintf(buf, PAGE_SIZE, "%s %s %s %s %s %s\n",
462 (ch->ch_mostat & UART_MCR_RTS) ? "RTS" : "",
463 (ch->ch_mistat & UART_MSR_CTS) ? "CTS" : "",
464 (ch->ch_mostat & UART_MCR_DTR) ? "DTR" : "",
465 (ch->ch_mistat & UART_MSR_DSR) ? "DSR" : "",
466 (ch->ch_mistat & UART_MSR_DCD) ? "DCD" : "",
467 (ch->ch_mistat & UART_MSR_RI) ? "RI" : "");
471 static DEVICE_ATTR(msignals, S_IRUSR, dgap_tty_msignals_show, NULL);
474 static ssize_t dgap_tty_iflag_show(struct device *d, struct device_attribute *attr, char *buf)
477 struct channel_t *ch;
482 un = dev_get_drvdata(d);
483 if (!un || un->magic != DGAP_UNIT_MAGIC)
486 if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
489 if (!bd || bd->magic != DGAP_BOARD_MAGIC)
491 if (bd->state != BOARD_READY)
494 return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_iflag);
496 static DEVICE_ATTR(iflag, S_IRUSR, dgap_tty_iflag_show, NULL);
499 static ssize_t dgap_tty_cflag_show(struct device *d, struct device_attribute *attr, char *buf)
502 struct channel_t *ch;
507 un = dev_get_drvdata(d);
508 if (!un || un->magic != DGAP_UNIT_MAGIC)
511 if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
514 if (!bd || bd->magic != DGAP_BOARD_MAGIC)
516 if (bd->state != BOARD_READY)
519 return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_cflag);
521 static DEVICE_ATTR(cflag, S_IRUSR, dgap_tty_cflag_show, NULL);
524 static ssize_t dgap_tty_oflag_show(struct device *d, struct device_attribute *attr, char *buf)
527 struct channel_t *ch;
532 un = dev_get_drvdata(d);
533 if (!un || un->magic != DGAP_UNIT_MAGIC)
536 if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
539 if (!bd || bd->magic != DGAP_BOARD_MAGIC)
541 if (bd->state != BOARD_READY)
544 return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_oflag);
546 static DEVICE_ATTR(oflag, S_IRUSR, dgap_tty_oflag_show, NULL);
549 static ssize_t dgap_tty_lflag_show(struct device *d, struct device_attribute *attr, char *buf)
552 struct channel_t *ch;
557 un = dev_get_drvdata(d);
558 if (!un || un->magic != DGAP_UNIT_MAGIC)
561 if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
564 if (!bd || bd->magic != DGAP_BOARD_MAGIC)
566 if (bd->state != BOARD_READY)
569 return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_lflag);
571 static DEVICE_ATTR(lflag, S_IRUSR, dgap_tty_lflag_show, NULL);
574 static ssize_t dgap_tty_digi_flag_show(struct device *d, struct device_attribute *attr, char *buf)
577 struct channel_t *ch;
582 un = dev_get_drvdata(d);
583 if (!un || un->magic != DGAP_UNIT_MAGIC)
586 if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
589 if (!bd || bd->magic != DGAP_BOARD_MAGIC)
591 if (bd->state != BOARD_READY)
594 return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_digi.digi_flags);
596 static DEVICE_ATTR(digi_flag, S_IRUSR, dgap_tty_digi_flag_show, NULL);
599 static ssize_t dgap_tty_rxcount_show(struct device *d, struct device_attribute *attr, char *buf)
602 struct channel_t *ch;
607 un = dev_get_drvdata(d);
608 if (!un || un->magic != DGAP_UNIT_MAGIC)
611 if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
614 if (!bd || bd->magic != DGAP_BOARD_MAGIC)
616 if (bd->state != BOARD_READY)
619 return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_rxcount);
621 static DEVICE_ATTR(rxcount, S_IRUSR, dgap_tty_rxcount_show, NULL);
624 static ssize_t dgap_tty_txcount_show(struct device *d, struct device_attribute *attr, char *buf)
627 struct channel_t *ch;
632 un = dev_get_drvdata(d);
633 if (!un || un->magic != DGAP_UNIT_MAGIC)
636 if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
639 if (!bd || bd->magic != DGAP_BOARD_MAGIC)
641 if (bd->state != BOARD_READY)
644 return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_txcount);
646 static DEVICE_ATTR(txcount, S_IRUSR, dgap_tty_txcount_show, NULL);
649 static ssize_t dgap_tty_name_show(struct device *d, struct device_attribute *attr, char *buf)
652 struct channel_t *ch;
656 struct cnode *cptr = NULL;
664 un = dev_get_drvdata(d);
665 if (!un || un->magic != DGAP_UNIT_MAGIC)
668 if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
671 if (!bd || bd->magic != DGAP_BOARD_MAGIC)
673 if (bd->state != BOARD_READY)
679 for (cptr = bd->bd_config; cptr; cptr = cptr->next) {
681 if ((cptr->type == BNODE) &&
682 ((cptr->u.board.type == APORT2_920P) || (cptr->u.board.type == APORT4_920P) ||
683 (cptr->u.board.type == APORT8_920P) || (cptr->u.board.type == PAPORT4) ||
684 (cptr->u.board.type == PAPORT8))) {
687 if (cptr->u.board.v_start)
688 starto = cptr->u.board.start;
693 if (cptr->type == TNODE && found == TRUE) {
695 if (strstr(cptr->u.ttyname, "tty")) {
696 ptr1 = cptr->u.ttyname;
700 ptr1 = cptr->u.ttyname;
703 for (i = 0; i < dgap_config_get_number_of_ports(bd); i++) {
705 return snprintf(buf, PAGE_SIZE, "%s%s%02d\n",
706 (un->un_type == DGAP_PRINT) ? "pr" : "tty",
712 if (cptr->type == CNODE) {
714 for (i = 0; i < cptr->u.conc.nport; i++) {
715 if (cn == (i + ncount)) {
717 return snprintf(buf, PAGE_SIZE, "%s%s%02d\n",
718 (un->un_type == DGAP_PRINT) ? "pr" : "tty",
720 i + (cptr->u.conc.v_start ? cptr->u.conc.start : 1));
724 ncount += cptr->u.conc.nport;
727 if (cptr->type == MNODE) {
729 for (i = 0; i < cptr->u.module.nport; i++) {
730 if (cn == (i + ncount)) {
731 return snprintf(buf, PAGE_SIZE, "%s%s%02d\n",
732 (un->un_type == DGAP_PRINT) ? "pr" : "tty",
734 i + (cptr->u.module.v_start ? cptr->u.module.start : 1));
738 ncount += cptr->u.module.nport;
743 return snprintf(buf, PAGE_SIZE, "%s_dgap_%d_%d\n",
744 (un->un_type == DGAP_PRINT) ? "pr" : "tty", bn, cn);
747 static DEVICE_ATTR(custom_name, S_IRUSR, dgap_tty_name_show, NULL);
750 static struct attribute *dgap_sysfs_tty_entries[] = {
751 &dev_attr_state.attr,
753 &dev_attr_msignals.attr,
754 &dev_attr_iflag.attr,
755 &dev_attr_cflag.attr,
756 &dev_attr_oflag.attr,
757 &dev_attr_lflag.attr,
758 &dev_attr_digi_flag.attr,
759 &dev_attr_rxcount.attr,
760 &dev_attr_txcount.attr,
761 &dev_attr_custom_name.attr,
766 static struct attribute_group dgap_tty_attribute_group = {
768 .attrs = dgap_sysfs_tty_entries,
774 void dgap_create_tty_sysfs(struct un_t *un, struct device *c)
778 ret = sysfs_create_group(&c->kobj, &dgap_tty_attribute_group);
780 printk(KERN_ERR "dgap: failed to create sysfs tty device attributes.\n");
781 sysfs_remove_group(&c->kobj, &dgap_tty_attribute_group);
785 dev_set_drvdata(c, un);
790 void dgap_remove_tty_sysfs(struct device *c)
792 sysfs_remove_group(&c->kobj, &dgap_tty_attribute_group);