aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-10-06 20:59:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-10-06 20:59:32 -0400
commit1c86f2e4c84faface399d7ba7c740423d6dfbdf9 (patch)
treef7d28ba1a4d86b1194c7550fd393b270900e2b54
parentdbeb1a8ff547ffc2db69b44b4445a9eadc025abf (diff)
parent74007ae6316ebe40260e44f8ab558f9b1ccc04e5 (diff)
Merge tag 'hwmon-for-linus-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon fix from Guenter Roeck: "Fix up error path in xgene driver" * tag 'hwmon-for-linus-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (xgene) Fix up error handling path mixup in 'xgene_hwmon_probe()'
-rw-r--r--drivers/hwmon/xgene-hwmon.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/hwmon/xgene-hwmon.c b/drivers/hwmon/xgene-hwmon.c
index 9c0dbb8191ad..e1be61095532 100644
--- a/drivers/hwmon/xgene-hwmon.c
+++ b/drivers/hwmon/xgene-hwmon.c
@@ -630,7 +630,7 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
630 sizeof(struct slimpro_resp_msg) * ASYNC_MSG_FIFO_SIZE, 630 sizeof(struct slimpro_resp_msg) * ASYNC_MSG_FIFO_SIZE,
631 GFP_KERNEL); 631 GFP_KERNEL);
632 if (rc) 632 if (rc)
633 goto out_mbox_free; 633 return -ENOMEM;
634 634
635 INIT_WORK(&ctx->workq, xgene_hwmon_evt_work); 635 INIT_WORK(&ctx->workq, xgene_hwmon_evt_work);
636 636
@@ -646,7 +646,8 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
646 if (IS_ERR(ctx->mbox_chan)) { 646 if (IS_ERR(ctx->mbox_chan)) {
647 dev_err(&pdev->dev, 647 dev_err(&pdev->dev,
648 "SLIMpro mailbox channel request failed\n"); 648 "SLIMpro mailbox channel request failed\n");
649 return -ENODEV; 649 rc = -ENODEV;
650 goto out_mbox_free;
650 } 651 }
651 } else { 652 } else {
652 struct acpi_pcct_hw_reduced *cppc_ss; 653 struct acpi_pcct_hw_reduced *cppc_ss;
@@ -654,7 +655,8 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
654 if (device_property_read_u32(&pdev->dev, "pcc-channel", 655 if (device_property_read_u32(&pdev->dev, "pcc-channel",
655 &ctx->mbox_idx)) { 656 &ctx->mbox_idx)) {
656 dev_err(&pdev->dev, "no pcc-channel property\n"); 657 dev_err(&pdev->dev, "no pcc-channel property\n");
657 return -ENODEV; 658 rc = -ENODEV;
659 goto out_mbox_free;
658 } 660 }
659 661
660 cl->rx_callback = xgene_hwmon_pcc_rx_cb; 662 cl->rx_callback = xgene_hwmon_pcc_rx_cb;
@@ -662,7 +664,8 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
662 if (IS_ERR(ctx->mbox_chan)) { 664 if (IS_ERR(ctx->mbox_chan)) {
663 dev_err(&pdev->dev, 665 dev_err(&pdev->dev,
664 "PPC channel request failed\n"); 666 "PPC channel request failed\n");
665 return -ENODEV; 667 rc = -ENODEV;
668 goto out_mbox_free;
666 } 669 }
667 670
668 /* 671 /*
@@ -675,13 +678,13 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
675 if (!cppc_ss) { 678 if (!cppc_ss) {
676 dev_err(&pdev->dev, "PPC subspace not found\n"); 679 dev_err(&pdev->dev, "PPC subspace not found\n");
677 rc = -ENODEV; 680 rc = -ENODEV;
678 goto out_mbox_free; 681 goto out;
679 } 682 }
680 683
681 if (!ctx->mbox_chan->mbox->txdone_irq) { 684 if (!ctx->mbox_chan->mbox->txdone_irq) {
682 dev_err(&pdev->dev, "PCC IRQ not supported\n"); 685 dev_err(&pdev->dev, "PCC IRQ not supported\n");
683 rc = -ENODEV; 686 rc = -ENODEV;
684 goto out_mbox_free; 687 goto out;
685 } 688 }
686 689
687 /* 690 /*
@@ -696,14 +699,14 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
696 } else { 699 } else {
697 dev_err(&pdev->dev, "Failed to get PCC comm region\n"); 700 dev_err(&pdev->dev, "Failed to get PCC comm region\n");
698 rc = -ENODEV; 701 rc = -ENODEV;
699 goto out_mbox_free; 702 goto out;
700 } 703 }
701 704
702 if (!ctx->pcc_comm_addr) { 705 if (!ctx->pcc_comm_addr) {
703 dev_err(&pdev->dev, 706 dev_err(&pdev->dev,
704 "Failed to ioremap PCC comm region\n"); 707 "Failed to ioremap PCC comm region\n");
705 rc = -ENOMEM; 708 rc = -ENOMEM;
706 goto out_mbox_free; 709 goto out;
707 } 710 }
708 711
709 /* 712 /*