aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c22
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c14
2 files changed, 24 insertions, 12 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 34a4fd13fa81..c47add8e47df 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -376,13 +376,23 @@ static void free_recv_msg_list(struct list_head *q)
376 } 376 }
377} 377}
378 378
379static void free_smi_msg_list(struct list_head *q)
380{
381 struct ipmi_smi_msg *msg, *msg2;
382
383 list_for_each_entry_safe(msg, msg2, q, link) {
384 list_del(&msg->link);
385 ipmi_free_smi_msg(msg);
386 }
387}
388
379static void clean_up_interface_data(ipmi_smi_t intf) 389static void clean_up_interface_data(ipmi_smi_t intf)
380{ 390{
381 int i; 391 int i;
382 struct cmd_rcvr *rcvr, *rcvr2; 392 struct cmd_rcvr *rcvr, *rcvr2;
383 struct list_head list; 393 struct list_head list;
384 394
385 free_recv_msg_list(&intf->waiting_msgs); 395 free_smi_msg_list(&intf->waiting_msgs);
386 free_recv_msg_list(&intf->waiting_events); 396 free_recv_msg_list(&intf->waiting_events);
387 397
388 /* Wholesale remove all the entries from the list in the 398 /* Wholesale remove all the entries from the list in the
@@ -1844,7 +1854,7 @@ static ssize_t provides_dev_sdrs_show(struct device *dev,
1844 struct bmc_device *bmc = dev_get_drvdata(dev); 1854 struct bmc_device *bmc = dev_get_drvdata(dev);
1845 1855
1846 return snprintf(buf, 10, "%u\n", 1856 return snprintf(buf, 10, "%u\n",
1847 bmc->id.device_revision && 0x80 >> 7); 1857 (bmc->id.device_revision & 0x80) >> 7);
1848} 1858}
1849 1859
1850static ssize_t revision_show(struct device *dev, struct device_attribute *attr, 1860static ssize_t revision_show(struct device *dev, struct device_attribute *attr,
@@ -1853,7 +1863,7 @@ static ssize_t revision_show(struct device *dev, struct device_attribute *attr,
1853 struct bmc_device *bmc = dev_get_drvdata(dev); 1863 struct bmc_device *bmc = dev_get_drvdata(dev);
1854 1864
1855 return snprintf(buf, 20, "%u\n", 1865 return snprintf(buf, 20, "%u\n",
1856 bmc->id.device_revision && 0x0F); 1866 bmc->id.device_revision & 0x0F);
1857} 1867}
1858 1868
1859static ssize_t firmware_rev_show(struct device *dev, 1869static ssize_t firmware_rev_show(struct device *dev,
@@ -2108,7 +2118,7 @@ static int ipmi_bmc_register(ipmi_smi_t intf)
2108 dev_set_drvdata(&bmc->dev->dev, bmc); 2118 dev_set_drvdata(&bmc->dev->dev, bmc);
2109 kref_init(&bmc->refcount); 2119 kref_init(&bmc->refcount);
2110 2120
2111 rv = platform_device_register(bmc->dev); 2121 rv = platform_device_add(bmc->dev);
2112 mutex_unlock(&ipmidriver_mutex); 2122 mutex_unlock(&ipmidriver_mutex);
2113 if (rv) { 2123 if (rv) {
2114 printk(KERN_ERR 2124 printk(KERN_ERR
@@ -3232,7 +3242,9 @@ void ipmi_smi_msg_received(ipmi_smi_t intf,
3232 report the error immediately. */ 3242 report the error immediately. */
3233 if ((msg->rsp_size >= 3) && (msg->rsp[2] != 0) 3243 if ((msg->rsp_size >= 3) && (msg->rsp[2] != 0)
3234 && (msg->rsp[2] != IPMI_NODE_BUSY_ERR) 3244 && (msg->rsp[2] != IPMI_NODE_BUSY_ERR)
3235 && (msg->rsp[2] != IPMI_LOST_ARBITRATION_ERR)) 3245 && (msg->rsp[2] != IPMI_LOST_ARBITRATION_ERR)
3246 && (msg->rsp[2] != IPMI_BUS_ERR)
3247 && (msg->rsp[2] != IPMI_NAK_ON_WRITE_ERR))
3236 { 3248 {
3237 int chan = msg->rsp[3] & 0xf; 3249 int chan = msg->rsp[3] & 0xf;
3238 3250
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 24825bdca8f4..bb1fac104fda 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -1211,7 +1211,7 @@ static void intf_mem_outb(struct si_sm_io *io, unsigned int offset,
1211static unsigned char intf_mem_inw(struct si_sm_io *io, unsigned int offset) 1211static unsigned char intf_mem_inw(struct si_sm_io *io, unsigned int offset)
1212{ 1212{
1213 return (readw((io->addr)+(offset * io->regspacing)) >> io->regshift) 1213 return (readw((io->addr)+(offset * io->regspacing)) >> io->regshift)
1214 && 0xff; 1214 & 0xff;
1215} 1215}
1216 1216
1217static void intf_mem_outw(struct si_sm_io *io, unsigned int offset, 1217static void intf_mem_outw(struct si_sm_io *io, unsigned int offset,
@@ -1223,7 +1223,7 @@ static void intf_mem_outw(struct si_sm_io *io, unsigned int offset,
1223static unsigned char intf_mem_inl(struct si_sm_io *io, unsigned int offset) 1223static unsigned char intf_mem_inl(struct si_sm_io *io, unsigned int offset)
1224{ 1224{
1225 return (readl((io->addr)+(offset * io->regspacing)) >> io->regshift) 1225 return (readl((io->addr)+(offset * io->regspacing)) >> io->regshift)
1226 && 0xff; 1226 & 0xff;
1227} 1227}
1228 1228
1229static void intf_mem_outl(struct si_sm_io *io, unsigned int offset, 1229static void intf_mem_outl(struct si_sm_io *io, unsigned int offset,
@@ -1236,7 +1236,7 @@ static void intf_mem_outl(struct si_sm_io *io, unsigned int offset,
1236static unsigned char mem_inq(struct si_sm_io *io, unsigned int offset) 1236static unsigned char mem_inq(struct si_sm_io *io, unsigned int offset)
1237{ 1237{
1238 return (readq((io->addr)+(offset * io->regspacing)) >> io->regshift) 1238 return (readq((io->addr)+(offset * io->regspacing)) >> io->regshift)
1239 && 0xff; 1239 & 0xff;
1240} 1240}
1241 1241
1242static void mem_outq(struct si_sm_io *io, unsigned int offset, 1242static void mem_outq(struct si_sm_io *io, unsigned int offset,
@@ -1789,7 +1789,7 @@ static int __devinit ipmi_pci_probe(struct pci_dev *pdev,
1789 1789
1790 info = kzalloc(sizeof(*info), GFP_KERNEL); 1790 info = kzalloc(sizeof(*info), GFP_KERNEL);
1791 if (!info) 1791 if (!info)
1792 return ENOMEM; 1792 return -ENOMEM;
1793 1793
1794 info->addr_source = "PCI"; 1794 info->addr_source = "PCI";
1795 1795
@@ -1810,7 +1810,7 @@ static int __devinit ipmi_pci_probe(struct pci_dev *pdev,
1810 kfree(info); 1810 kfree(info);
1811 printk(KERN_INFO "ipmi_si: %s: Unknown IPMI type: %d\n", 1811 printk(KERN_INFO "ipmi_si: %s: Unknown IPMI type: %d\n",
1812 pci_name(pdev), class_type); 1812 pci_name(pdev), class_type);
1813 return ENOMEM; 1813 return -ENOMEM;
1814 } 1814 }
1815 1815
1816 rv = pci_enable_device(pdev); 1816 rv = pci_enable_device(pdev);
@@ -1867,7 +1867,7 @@ static int ipmi_pci_resume(struct pci_dev *pdev)
1867 1867
1868static struct pci_device_id ipmi_pci_devices[] = { 1868static struct pci_device_id ipmi_pci_devices[] = {
1869 { PCI_DEVICE(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID) }, 1869 { PCI_DEVICE(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID) },
1870 { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE) } 1870 { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) }
1871}; 1871};
1872MODULE_DEVICE_TABLE(pci, ipmi_pci_devices); 1872MODULE_DEVICE_TABLE(pci, ipmi_pci_devices);
1873 1873
@@ -2346,7 +2346,7 @@ static int try_smi_init(struct smi_info *new_smi)
2346 new_smi->dev = &new_smi->pdev->dev; 2346 new_smi->dev = &new_smi->pdev->dev;
2347 new_smi->dev->driver = &ipmi_driver; 2347 new_smi->dev->driver = &ipmi_driver;
2348 2348
2349 rv = platform_device_register(new_smi->pdev); 2349 rv = platform_device_add(new_smi->pdev);
2350 if (rv) { 2350 if (rv) {
2351 printk(KERN_ERR 2351 printk(KERN_ERR
2352 "ipmi_si_intf:" 2352 "ipmi_si_intf:"