revert android-tegra-2.6.36-honeycomb-mr1-9001adc to v2.6.36
[firefly-linux-kernel-4.4.55.git] / drivers / char / ipmi / ipmi_si_intf.c
index 501f115333ed8fdc9cfa07e8b022b7d0190094f1..7bd7c45b53efc849225f7f0a604c41f2f0a4fded 100644 (file)
@@ -1665,17 +1665,6 @@ static int check_hotmod_int_op(const char *curr, const char *option,
        return 0;
 }
 
-static struct smi_info *smi_info_alloc(void)
-{
-       struct smi_info *info = kzalloc(sizeof(*info), GFP_KERNEL);
-
-       if (info) {
-               spin_lock_init(&info->si_lock);
-               spin_lock_init(&info->msg_lock);
-       }
-       return info;
-}
-
 static int hotmod_handler(const char *val, struct kernel_param *kp)
 {
        char *str = kstrdup(val, GFP_KERNEL);
@@ -1790,7 +1779,7 @@ static int hotmod_handler(const char *val, struct kernel_param *kp)
                }
 
                if (op == HM_ADD) {
-                       info = smi_info_alloc();
+                       info = kzalloc(sizeof(*info), GFP_KERNEL);
                        if (!info) {
                                rv = -ENOMEM;
                                goto out;
@@ -1855,7 +1844,7 @@ static __devinit void hardcode_find_bmc(void)
                if (!ports[i] && !addrs[i])
                        continue;
 
-               info = smi_info_alloc();
+               info = kzalloc(sizeof(*info), GFP_KERNEL);
                if (!info)
                        return;
 
@@ -2039,7 +2028,7 @@ static __devinit int try_init_spmi(struct SPMITable *spmi)
                return -ENODEV;
        }
 
-       info = smi_info_alloc();
+       info = kzalloc(sizeof(*info), GFP_KERNEL);
        if (!info) {
                printk(KERN_ERR PFX "Could not allocate SI data (3)\n");
                return -ENOMEM;
@@ -2149,7 +2138,7 @@ static int __devinit ipmi_pnp_probe(struct pnp_dev *dev,
        if (!acpi_dev)
                return -ENODEV;
 
-       info = smi_info_alloc();
+       info = kzalloc(sizeof(*info), GFP_KERNEL);
        if (!info)
                return -ENOMEM;
 
@@ -2330,7 +2319,7 @@ static __devinit void try_init_dmi(struct dmi_ipmi_data *ipmi_data)
 {
        struct smi_info *info;
 
-       info = smi_info_alloc();
+       info = kzalloc(sizeof(*info), GFP_KERNEL);
        if (!info) {
                printk(KERN_ERR PFX "Could not allocate SI data\n");
                return;
@@ -2437,7 +2426,7 @@ static int __devinit ipmi_pci_probe(struct pci_dev *pdev,
        int class_type = pdev->class & PCI_ERMC_CLASSCODE_TYPE_MASK;
        struct smi_info *info;
 
-       info = smi_info_alloc();
+       info = kzalloc(sizeof(*info), GFP_KERNEL);
        if (!info)
                return -ENOMEM;
 
@@ -2578,7 +2567,7 @@ static int __devinit ipmi_of_probe(struct platform_device *dev,
                return -EINVAL;
        }
 
-       info = smi_info_alloc();
+       info = kzalloc(sizeof(*info), GFP_KERNEL);
 
        if (!info) {
                dev_err(&dev->dev,
@@ -3025,7 +3014,7 @@ static __devinit void default_find_bmc(void)
                if (check_legacy_ioport(ipmi_defaults[i].port))
                        continue;
 #endif
-               info = smi_info_alloc();
+               info = kzalloc(sizeof(*info), GFP_KERNEL);
                if (!info)
                        return;
 
@@ -3150,6 +3139,9 @@ static int try_smi_init(struct smi_info *new_smi)
                goto out_err;
        }
 
+       spin_lock_init(&(new_smi->si_lock));
+       spin_lock_init(&(new_smi->msg_lock));
+
        /* Do low-level detection first. */
        if (new_smi->handlers->detect(new_smi->si_sm)) {
                if (new_smi->addr_source)