aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/ipmi/ipmi_msghandler.c15
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c12
2 files changed, 18 insertions, 9 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index e6db9381b2c7..f816211f062f 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -2796,7 +2796,6 @@ channel_handler(ipmi_smi_t intf, struct ipmi_recv_msg *msg)
2796 = IPMI_CHANNEL_MEDIUM_IPMB; 2796 = IPMI_CHANNEL_MEDIUM_IPMB;
2797 intf->channels[0].protocol 2797 intf->channels[0].protocol
2798 = IPMI_CHANNEL_PROTOCOL_IPMB; 2798 = IPMI_CHANNEL_PROTOCOL_IPMB;
2799 rv = -ENOSYS;
2800 2799
2801 intf->curr_channel = IPMI_MAX_CHANNELS; 2800 intf->curr_channel = IPMI_MAX_CHANNELS;
2802 wake_up(&intf->waitq); 2801 wake_up(&intf->waitq);
@@ -2821,12 +2820,12 @@ channel_handler(ipmi_smi_t intf, struct ipmi_recv_msg *msg)
2821 2820
2822 if (rv) { 2821 if (rv) {
2823 /* Got an error somehow, just give up. */ 2822 /* Got an error somehow, just give up. */
2823 printk(KERN_WARNING PFX
2824 "Error sending channel information for channel"
2825 " %d: %d\n", intf->curr_channel, rv);
2826
2824 intf->curr_channel = IPMI_MAX_CHANNELS; 2827 intf->curr_channel = IPMI_MAX_CHANNELS;
2825 wake_up(&intf->waitq); 2828 wake_up(&intf->waitq);
2826
2827 printk(KERN_WARNING PFX
2828 "Error sending channel information: %d\n",
2829 rv);
2830 } 2829 }
2831 } 2830 }
2832 out: 2831 out:
@@ -2964,8 +2963,12 @@ int ipmi_register_smi(struct ipmi_smi_handlers *handlers,
2964 intf->null_user_handler = channel_handler; 2963 intf->null_user_handler = channel_handler;
2965 intf->curr_channel = 0; 2964 intf->curr_channel = 0;
2966 rv = send_channel_info_cmd(intf, 0); 2965 rv = send_channel_info_cmd(intf, 0);
2967 if (rv) 2966 if (rv) {
2967 printk(KERN_WARNING PFX
2968 "Error sending channel information for channel"
2969 " 0, %d\n", rv);
2968 goto out; 2970 goto out;
2971 }
2969 2972
2970 /* Wait for the channel info to be read. */ 2973 /* Wait for the channel info to be read. */
2971 wait_event(intf->waitq, 2974 wait_event(intf->waitq,
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 5d665680ae33..5c4e1f625bbb 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -965,9 +965,9 @@ static inline int ipmi_si_is_busy(struct timespec *ts)
965 return ts->tv_nsec != -1; 965 return ts->tv_nsec != -1;
966} 966}
967 967
968static int ipmi_thread_busy_wait(enum si_sm_result smi_result, 968static inline int ipmi_thread_busy_wait(enum si_sm_result smi_result,
969 const struct smi_info *smi_info, 969 const struct smi_info *smi_info,
970 struct timespec *busy_until) 970 struct timespec *busy_until)
971{ 971{
972 unsigned int max_busy_us = 0; 972 unsigned int max_busy_us = 0;
973 973
@@ -2658,6 +2658,9 @@ static int ipmi_probe(struct platform_device *dev)
2658 if (!match) 2658 if (!match)
2659 return -EINVAL; 2659 return -EINVAL;
2660 2660
2661 if (!of_device_is_available(np))
2662 return -EINVAL;
2663
2661 ret = of_address_to_resource(np, 0, &resource); 2664 ret = of_address_to_resource(np, 0, &resource);
2662 if (ret) { 2665 if (ret) {
2663 dev_warn(&dev->dev, PFX "invalid address from OF\n"); 2666 dev_warn(&dev->dev, PFX "invalid address from OF\n");
@@ -3655,6 +3658,9 @@ static void cleanup_one_si(struct smi_info *to_clean)
3655 if (!to_clean) 3658 if (!to_clean)
3656 return; 3659 return;
3657 3660
3661 if (to_clean->dev)
3662 dev_set_drvdata(to_clean->dev, NULL);
3663
3658 list_del(&to_clean->link); 3664 list_del(&to_clean->link);
3659 3665
3660 /* Tell the driver that we are shutting down. */ 3666 /* Tell the driver that we are shutting down. */