.. | .. |
---|
29 | 29 | struct ipmi_user *user; |
---|
30 | 30 | spinlock_t recv_msg_lock; |
---|
31 | 31 | struct list_head recv_msgs; |
---|
32 | | - struct file *file; |
---|
33 | 32 | struct fasync_struct *fasync_queue; |
---|
34 | 33 | wait_queue_head_t wait; |
---|
35 | 34 | struct mutex recv_mutex; |
---|
.. | .. |
---|
94 | 93 | priv = kmalloc(sizeof(*priv), GFP_KERNEL); |
---|
95 | 94 | if (!priv) |
---|
96 | 95 | return -ENOMEM; |
---|
97 | | - |
---|
98 | | - priv->file = file; |
---|
99 | 96 | |
---|
100 | 97 | rv = ipmi_create_user(if_num, |
---|
101 | 98 | &ipmi_hndlrs, |
---|
.. | .. |
---|
207 | 204 | struct list_head *entry; |
---|
208 | 205 | struct ipmi_recv_msg *msg; |
---|
209 | 206 | unsigned long flags; |
---|
210 | | - int rv = 0; |
---|
| 207 | + int rv = 0, rv2 = 0; |
---|
211 | 208 | |
---|
212 | 209 | /* We claim a mutex because we don't want two |
---|
213 | 210 | users getting something from the queue at a time. |
---|
.. | .. |
---|
250 | 247 | |
---|
251 | 248 | if (msg->msg.data_len > 0) { |
---|
252 | 249 | if (rsp->msg.data_len < msg->msg.data_len) { |
---|
253 | | - rv = -EMSGSIZE; |
---|
| 250 | + rv2 = -EMSGSIZE; |
---|
254 | 251 | if (trunc) |
---|
255 | 252 | msg->msg.data_len = rsp->msg.data_len; |
---|
256 | 253 | else |
---|
.. | .. |
---|
274 | 271 | |
---|
275 | 272 | mutex_unlock(&priv->recv_mutex); |
---|
276 | 273 | ipmi_free_recv_msg(msg); |
---|
277 | | - return 0; |
---|
| 274 | + return rv2; |
---|
278 | 275 | |
---|
279 | 276 | recv_putback_on_err: |
---|
280 | 277 | /* If we got an error, put the message back onto |
---|
.. | .. |
---|
818 | 815 | |
---|
819 | 816 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); |
---|
820 | 817 | if (!entry) { |
---|
821 | | - printk(KERN_ERR "ipmi_devintf: Unable to create the" |
---|
822 | | - " ipmi class device link\n"); |
---|
| 818 | + pr_err("ipmi_devintf: Unable to create the ipmi class device link\n"); |
---|
823 | 819 | return; |
---|
824 | 820 | } |
---|
825 | 821 | entry->dev = dev; |
---|
.. | .. |
---|
861 | 857 | if (ipmi_major < 0) |
---|
862 | 858 | return -EINVAL; |
---|
863 | 859 | |
---|
864 | | - printk(KERN_INFO "ipmi device interface\n"); |
---|
| 860 | + pr_info("ipmi device interface\n"); |
---|
865 | 861 | |
---|
866 | 862 | ipmi_class = class_create(THIS_MODULE, "ipmi"); |
---|
867 | 863 | if (IS_ERR(ipmi_class)) { |
---|
868 | | - printk(KERN_ERR "ipmi: can't register device class\n"); |
---|
| 864 | + pr_err("ipmi: can't register device class\n"); |
---|
869 | 865 | return PTR_ERR(ipmi_class); |
---|
870 | 866 | } |
---|
871 | 867 | |
---|
872 | 868 | rv = register_chrdev(ipmi_major, DEVICE_NAME, &ipmi_fops); |
---|
873 | 869 | if (rv < 0) { |
---|
874 | 870 | class_destroy(ipmi_class); |
---|
875 | | - printk(KERN_ERR "ipmi: can't get major %d\n", ipmi_major); |
---|
| 871 | + pr_err("ipmi: can't get major %d\n", ipmi_major); |
---|
876 | 872 | return rv; |
---|
877 | 873 | } |
---|
878 | 874 | |
---|
.. | .. |
---|
884 | 880 | if (rv) { |
---|
885 | 881 | unregister_chrdev(ipmi_major, DEVICE_NAME); |
---|
886 | 882 | class_destroy(ipmi_class); |
---|
887 | | - printk(KERN_WARNING "ipmi: can't register smi watcher\n"); |
---|
| 883 | + pr_warn("ipmi: can't register smi watcher\n"); |
---|
888 | 884 | return rv; |
---|
889 | 885 | } |
---|
890 | 886 | |
---|