summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hvc_iseries.c7
-rw-r--r--drivers/char/ip2/ip2main.c2
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c22
-rw-r--r--drivers/char/tipar.c6
-rw-r--r--drivers/char/vt.c39
5 files changed, 49 insertions, 27 deletions
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index 4747729459c..8b6f197e5f8 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -153,9 +153,7 @@ static int put_chars(uint32_t vtermno, const char *buf, int count)
spin_lock_irqsave(&consolelock, flags);
if (viochar_is_console(pi) && !viopath_isactive(pi->lp)) {
- spin_lock_irqsave(&consoleloglock, flags);
HvCall_writeLogBuffer(buf, count);
- spin_unlock_irqrestore(&consoleloglock, flags);
sent = count;
goto done;
}
@@ -171,11 +169,8 @@ static int put_chars(uint32_t vtermno, const char *buf, int count)
len = (count > VIOCHAR_MAX_DATA) ? VIOCHAR_MAX_DATA : count;
- if (viochar_is_console(pi)) {
- spin_lock_irqsave(&consoleloglock, flags);
+ if (viochar_is_console(pi))
HvCall_writeLogBuffer(buf, len);
- spin_unlock_irqrestore(&consoleloglock, flags);
- }
init_data_event(viochar, pi->lp);
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c
index 4828bc914ce..62ef511d143 100644
--- a/drivers/char/ip2/ip2main.c
+++ b/drivers/char/ip2/ip2main.c
@@ -779,8 +779,6 @@ retry:
ip2trace (ITRC_NO_PORT, ITRC_INIT, ITRC_RETURN, 0 );
goto out;
-out_class:
- class_destroy(ip2_class);
out_chrdev:
unregister_chrdev(IP2_IPL_MAJOR, "ip2");
out:
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 908521e36d8..b106c45abfc 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -217,6 +217,11 @@ struct smi_info
struct list_head link;
};
+#define SI_MAX_PARMS 4
+
+static int force_kipmid[SI_MAX_PARMS];
+static int num_force_kipmid;
+
static int try_smi_init(struct smi_info *smi);
static ATOMIC_NOTIFIER_HEAD(xaction_notifier_list);
@@ -908,6 +913,7 @@ static int smi_start_processing(void *send_info,
ipmi_smi_t intf)
{
struct smi_info *new_smi = send_info;
+ int enable = 0;
new_smi->intf = intf;
@@ -917,10 +923,18 @@ static int smi_start_processing(void *send_info,
mod_timer(&new_smi->si_timer, jiffies + SI_TIMEOUT_JIFFIES);
/*
+ * Check if the user forcefully enabled the daemon.
+ */
+ if (new_smi->intf_num < num_force_kipmid)
+ enable = force_kipmid[new_smi->intf_num];
+ /*
* The BT interface is efficient enough to not need a thread,
* and there is no need for a thread if we have interrupts.
*/
- if ((new_smi->si_type != SI_BT) && (!new_smi->irq)) {
+ else if ((new_smi->si_type != SI_BT) && (!new_smi->irq))
+ enable = 1;
+
+ if (enable) {
new_smi->thread = kthread_run(ipmi_thread, new_smi,
"kipmi%d", new_smi->intf_num);
if (IS_ERR(new_smi->thread)) {
@@ -948,7 +962,6 @@ static struct ipmi_smi_handlers handlers =
/* There can be 4 IO ports passed in (with or without IRQs), 4 addresses,
a default IO port, and 1 ACPI/SPMI address. That sets SI_MAX_DRIVERS */
-#define SI_MAX_PARMS 4
static LIST_HEAD(smi_infos);
static DEFINE_MUTEX(smi_infos_lock);
static int smi_num; /* Used to sequence the SMIs */
@@ -1021,6 +1034,10 @@ MODULE_PARM_DESC(slave_addrs, "Set the default IPMB slave address for"
" the controller. Normally this is 0x20, but can be"
" overridden by this parm. This is an array indexed"
" by interface number.");
+module_param_array(force_kipmid, int, &num_force_kipmid, 0);
+MODULE_PARM_DESC(force_kipmid, "Force the kipmi daemon to be enabled (1) or"
+ " disabled(0). Normally the IPMI driver auto-detects"
+ " this, but the value may be overridden by this parm.");
#define IPMI_IO_ADDR_SPACE 0
@@ -1734,6 +1751,7 @@ static void __devinit dmi_find_bmc(void)
int rv;
while ((dev = dmi_find_device(DMI_DEV_TYPE_IPMI, NULL, dev))) {
+ memset(&data, 0, sizeof(data));
rv = decode_dmi((struct dmi_header *) dev->device_data, &data);
if (!rv)
try_init_dmi(&data);
diff --git a/drivers/char/tipar.c b/drivers/char/tipar.c
index d30dc09dbbc..9df0ca1be0e 100644
--- a/drivers/char/tipar.c
+++ b/drivers/char/tipar.c
@@ -224,14 +224,16 @@ probe_ti_parallel(int minor)
{
int i;
int seq[] = { 0x00, 0x20, 0x10, 0x30 };
+ int data;
for (i = 3; i >= 0; i--) {
outbyte(3, minor);
outbyte(i, minor);
udelay(delay);
+ data = inbyte(minor) & 0x30;
pr_debug("tipar: Probing -> %i: 0x%02x 0x%02x\n", i,
- data & 0x30, seq[i]);
- if ((inbyte(minor) & 0x30) != seq[i]) {
+ data, seq[i]);
+ if (data != seq[i]) {
outbyte(3, minor);
return -1;
}
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index ec0c070bf15..8e4413f6fba 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -106,7 +106,8 @@
#define MAX_NR_CON_DRIVER 16
#define CON_DRIVER_FLAG_MODULE 1
-#define CON_DRIVER_FLAG_INIT 2
+#define CON_DRIVER_FLAG_INIT 2
+#define CON_DRIVER_FLAG_ATTR 4
struct con_driver {
const struct consw *con;
@@ -138,14 +139,6 @@ const struct consw *conswitchp;
extern void vcs_make_sysfs(struct tty_struct *tty);
extern void vcs_remove_sysfs(struct tty_struct *tty);
-extern void console_map_init(void);
-#ifdef CONFIG_PROM_CONSOLE
-extern void prom_con_init(void);
-#endif
-#ifdef CONFIG_MDA_CONSOLE
-extern int mda_console_init(void);
-#endif
-
struct vc vc_cons [MAX_NR_CONSOLES];
#ifndef VT_SINGLE_DRIVER
@@ -3070,22 +3063,37 @@ static struct class_device_attribute class_device_attrs[] = {
static int vtconsole_init_class_device(struct con_driver *con)
{
int i;
+ int error = 0;
+ con->flag |= CON_DRIVER_FLAG_ATTR;
class_set_devdata(con->class_dev, con);
- for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++)
- class_device_create_file(con->class_dev,
+ for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++) {
+ error = class_device_create_file(con->class_dev,
+ &class_device_attrs[i]);
+ if (error)
+ break;
+ }
+
+ if (error) {
+ while (--i >= 0)
+ class_device_remove_file(con->class_dev,
&class_device_attrs[i]);
+ con->flag &= ~CON_DRIVER_FLAG_ATTR;
+ }
- return 0;
+ return error;
}
static void vtconsole_deinit_class_device(struct con_driver *con)
{
int i;
- for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++)
- class_device_remove_file(con->class_dev,
- &class_device_attrs[i]);
+ if (con->flag & CON_DRIVER_FLAG_ATTR) {
+ for (i = 0; i < ARRAY_SIZE(class_device_attrs); i++)
+ class_device_remove_file(con->class_dev,
+ &class_device_attrs[i]);
+ con->flag &= ~CON_DRIVER_FLAG_ATTR;
+ }
}
/**
@@ -3184,6 +3192,7 @@ int register_con_driver(const struct consw *csw, int first, int last)
} else {
vtconsole_init_class_device(con_driver);
}
+
err:
release_console_sem();
module_put(owner);