Skip to contentSkip to conversation

serial_cs with devfs

PATCH _N3X_ 2 participants 2 messages Feb 27, 2003 Char and misc drivers

lore
Share & tools
lore

_N3X_

author
#0 lore raw

in serial_cs.c there is a hardcoded device name in the code, stating ttySx, that's not the right thing with devfs..
here's a patch of my own (should work also on the latest prepatch), just to show the problem, i think that the defines around it could be more carefully chosen, but what's the deal.. have a nice day. _N3X_ <[email protected]>

drivers/char/pcmcia/serial_cs.c +4 -0
diff -ru linux-2.4.19/drivers/char/pcmcia/serial_cs.c linux-2.4.19-fix/drivers/char/pcmcia/serial_cs.c
@@ -256,7 +256,11 @@
     }
     
     info->line[info->ndev] = line;
+#ifdef CONFIG_DEVFS_FS
+    sprintf(info->node[info->ndev].dev_name, "tts/%d", line);
+#else
     sprintf(info->node[info->ndev].dev_name, "ttyS%d", line);
+#endif /* CONFIG_DEVFS_FS */
     info->node[info->ndev].major = TTY_MAJOR;
     info->node[info->ndev].minor = 0x40+line;
     if (info->ndev > 0)
#1 lore raw
Quoted 12 lines · On Thu, 27 Feb 2003, _N3X_ wrote:

in serial_cs.c there is a hardcoded device name in the code, stating ttySx, that's not the right thing with devfs..
here's a patch of my own (should work also on the latest prepatch), just to show the problem, i think that the defines around it could be more carefully chosen, but what's the deal.. have a nice day. _N3X_ <[email protected]>

diff -ru linux-2.4.19/drivers/char/pcmcia/serial_cs.c linux-2.4.19-fix/drivers/char/pcmcia/serial_cs.c

drivers/char/pcmcia/serial_cs.c +0 -0
@@ -256,7 +256,11 @@
     }

drivers/char/pcmcia/serial_cs.c line 266

Quoted 10 lines
drivers/char/pcmcia/serial_cs.c +4 -0
 
     info->line[info->ndev] = line;
+#ifdef CONFIG_DEVFS_FS
+    sprintf(info->node[info->ndev].dev_name, "tts/%d", line);
+#else
     sprintf(info->node[info->ndev].dev_name, "ttyS%d", line);
+#endif /* CONFIG_DEVFS_FS */
     info->node[info->ndev].major = TTY_MAJOR;
     info->node[info->ndev].minor = 0x40+line;
     if (info->ndev > 0)

*cough* All that patch does is accentuate is one thing...

Zwane

Signature · 1 line
function.linuxpower.ca