projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Char: moxa, do not initialize global static
[powerpc.git]
/
drivers
/
char
/
specialix.c
diff --git
a/drivers/char/specialix.c
b/drivers/char/specialix.c
index
7e1bd95
..
92043c8
100644
(file)
--- a/
drivers/char/specialix.c
+++ b/
drivers/char/specialix.c
@@
-2261,9
+2261,10
@@
static void sx_start(struct tty_struct * tty)
* do_sx_hangup() -> tty->hangup() -> sx_hangup()
*
*/
* do_sx_hangup() -> tty->hangup() -> sx_hangup()
*
*/
-static void do_sx_hangup(
void *private_
)
+static void do_sx_hangup(
struct work_struct *work
)
{
{
- struct specialix_port *port = (struct specialix_port *) private_;
+ struct specialix_port *port =
+ container_of(work, struct specialix_port, tqueue_hangup);
struct tty_struct *tty;
func_enter();
struct tty_struct *tty;
func_enter();
@@
-2310,7
+2311,7
@@
static void sx_hangup(struct tty_struct * tty)
}
}
-static void sx_set_termios(struct tty_struct * tty, struct termios * old_termios)
+static void sx_set_termios(struct tty_struct * tty, struct
k
termios * old_termios)
{
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
unsigned long flags;
{
struct specialix_port *port = (struct specialix_port *)tty->driver_data;
unsigned long flags;
@@
-2336,9
+2337,10
@@
static void sx_set_termios(struct tty_struct * tty, struct termios * old_termios
}
}
-static void do_softint(
void *private_
)
+static void do_softint(
struct work_struct *work
)
{
{
- struct specialix_port *port = (struct specialix_port *) private_;
+ struct specialix_port *port =
+ container_of(work, struct specialix_port, tqueue);
struct tty_struct *tty;
func_enter();
struct tty_struct *tty;
func_enter();
@@
-2348,10
+2350,8
@@
static void do_softint(void *private_)
return;
}
return;
}
- if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &port->event))
{
+ if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &port->event))
tty_wakeup(tty);
tty_wakeup(tty);
- //wake_up_interruptible(&tty->write_wait);
- }
func_exit();
}
func_exit();
}
@@
-2398,6
+2398,8
@@
static int sx_init_drivers(void)
specialix_driver->init_termios = tty_std_termios;
specialix_driver->init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
specialix_driver->init_termios = tty_std_termios;
specialix_driver->init_termios.c_cflag =
B9600 | CS8 | CREAD | HUPCL | CLOCAL;
+ specialix_driver->init_termios.c_ispeed = 9600;
+ specialix_driver->init_termios.c_ospeed = 9600;
specialix_driver->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(specialix_driver, &sx_ops);
specialix_driver->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(specialix_driver, &sx_ops);
@@
-2411,8
+2413,8
@@
static int sx_init_drivers(void)
memset(sx_port, 0, sizeof(sx_port));
for (i = 0; i < SX_NPORT * SX_NBOARD; i++) {
sx_port[i].magic = SPECIALIX_MAGIC;
memset(sx_port, 0, sizeof(sx_port));
for (i = 0; i < SX_NPORT * SX_NBOARD; i++) {
sx_port[i].magic = SPECIALIX_MAGIC;
- INIT_WORK(&sx_port[i].tqueue, do_softint
, &sx_port[i]
);
- INIT_WORK(&sx_port[i].tqueue_hangup, do_sx_hangup
, &sx_port[i]
);
+ INIT_WORK(&sx_port[i].tqueue, do_softint);
+ INIT_WORK(&sx_port[i].tqueue_hangup, do_sx_hangup);
sx_port[i].close_delay = 50 * HZ/100;
sx_port[i].closing_wait = 3000 * HZ/100;
init_waitqueue_head(&sx_port[i].open_wait);
sx_port[i].close_delay = 50 * HZ/100;
sx_port[i].closing_wait = 3000 * HZ/100;
init_waitqueue_head(&sx_port[i].open_wait);
@@
-2473,7
+2475,7
@@
static int __init specialix_init(void)
i++;
continue;
}
i++;
continue;
}
- pdev = pci_
find
_device (PCI_VENDOR_ID_SPECIALIX,
+ pdev = pci_
get
_device (PCI_VENDOR_ID_SPECIALIX,
PCI_DEVICE_ID_SPECIALIX_IO8,
pdev);
if (!pdev) break;
PCI_DEVICE_ID_SPECIALIX_IO8,
pdev);
if (!pdev) break;
@@
-2489,6
+2491,9
@@
static int __init specialix_init(void)
if (!sx_probe(&sx_board[i]))
found ++;
}
if (!sx_probe(&sx_board[i]))
found ++;
}
+ /* May exit pci_get sequence early with lots of boards */
+ if (pdev != NULL)
+ pci_dev_put(pdev);
}
#endif
}
#endif