forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/pci/hotplug/shpchp_ctrl.c
....@@ -299,7 +299,6 @@
299299 if (p_slot->status == 0xFF) {
300300 /* power fault occurred, but it was benign */
301301 ctrl_dbg(ctrl, "%s: Power fault\n", __func__);
302
- rc = POWER_FAILURE;
303302 p_slot->status = 0;
304303 goto err_exit;
305304 }
....@@ -341,8 +340,7 @@
341340 u8 hp_slot;
342341 int rc;
343342
344
- if (shpchp_unconfigure_device(p_slot))
345
- return(1);
343
+ shpchp_unconfigure_device(p_slot);
346344
347345 hp_slot = p_slot->device - ctrl->slot_device_offset;
348346 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
....@@ -446,23 +444,12 @@
446444 mutex_unlock(&p_slot->lock);
447445 }
448446
449
-static int update_slot_info (struct slot *slot)
447
+static void update_slot_info(struct slot *slot)
450448 {
451
- struct hotplug_slot_info *info;
452
- int result;
453
-
454
- info = kmalloc(sizeof(*info), GFP_KERNEL);
455
- if (!info)
456
- return -ENOMEM;
457
-
458
- slot->hpc_ops->get_power_status(slot, &(info->power_status));
459
- slot->hpc_ops->get_attention_status(slot, &(info->attention_status));
460
- slot->hpc_ops->get_latch_status(slot, &(info->latch_status));
461
- slot->hpc_ops->get_adapter_status(slot, &(info->adapter_status));
462
-
463
- result = pci_hp_change_slot_info(slot->hotplug_slot, info);
464
- kfree (info);
465
- return result;
449
+ slot->hpc_ops->get_power_status(slot, &slot->pwr_save);
450
+ slot->hpc_ops->get_attention_status(slot, &slot->attention_save);
451
+ slot->hpc_ops->get_latch_status(slot, &slot->latch_save);
452
+ slot->hpc_ops->get_adapter_status(slot, &slot->presence_save);
466453 }
467454
468455 /*
....@@ -654,7 +641,7 @@
654641 switch (p_slot->state) {
655642 case BLINKINGON_STATE:
656643 cancel_delayed_work(&p_slot->work);
657
- /* fall through */
644
+ fallthrough;
658645 case STATIC_STATE:
659646 p_slot->state = POWERON_STATE;
660647 mutex_unlock(&p_slot->lock);
....@@ -690,7 +677,7 @@
690677 switch (p_slot->state) {
691678 case BLINKINGOFF_STATE:
692679 cancel_delayed_work(&p_slot->work);
693
- /* fall through */
680
+ fallthrough;
694681 case STATIC_STATE:
695682 p_slot->state = POWEROFF_STATE;
696683 mutex_unlock(&p_slot->lock);