Skip to content

Commit

Permalink
Merge tag 'hwmon-for-linus-v4.14-rc4' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/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()'
  • Loading branch information
torvalds committed Oct 7, 2017
2 parents dbeb1a8 + 74007ae commit 1c86f2e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions drivers/hwmon/xgene-hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
sizeof(struct slimpro_resp_msg) * ASYNC_MSG_FIFO_SIZE,
GFP_KERNEL);
if (rc)
goto out_mbox_free;
return -ENOMEM;

INIT_WORK(&ctx->workq, xgene_hwmon_evt_work);

Expand All @@ -646,23 +646,26 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
if (IS_ERR(ctx->mbox_chan)) {
dev_err(&pdev->dev,
"SLIMpro mailbox channel request failed\n");
return -ENODEV;
rc = -ENODEV;
goto out_mbox_free;
}
} else {
struct acpi_pcct_hw_reduced *cppc_ss;

if (device_property_read_u32(&pdev->dev, "pcc-channel",
&ctx->mbox_idx)) {
dev_err(&pdev->dev, "no pcc-channel property\n");
return -ENODEV;
rc = -ENODEV;
goto out_mbox_free;
}

cl->rx_callback = xgene_hwmon_pcc_rx_cb;
ctx->mbox_chan = pcc_mbox_request_channel(cl, ctx->mbox_idx);
if (IS_ERR(ctx->mbox_chan)) {
dev_err(&pdev->dev,
"PPC channel request failed\n");
return -ENODEV;
rc = -ENODEV;
goto out_mbox_free;
}

/*
Expand All @@ -675,13 +678,13 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
if (!cppc_ss) {
dev_err(&pdev->dev, "PPC subspace not found\n");
rc = -ENODEV;
goto out_mbox_free;
goto out;
}

if (!ctx->mbox_chan->mbox->txdone_irq) {
dev_err(&pdev->dev, "PCC IRQ not supported\n");
rc = -ENODEV;
goto out_mbox_free;
goto out;
}

/*
Expand All @@ -696,14 +699,14 @@ static int xgene_hwmon_probe(struct platform_device *pdev)
} else {
dev_err(&pdev->dev, "Failed to get PCC comm region\n");
rc = -ENODEV;
goto out_mbox_free;
goto out;
}

if (!ctx->pcc_comm_addr) {
dev_err(&pdev->dev,
"Failed to ioremap PCC comm region\n");
rc = -ENOMEM;
goto out_mbox_free;
goto out;
}

/*
Expand Down

0 comments on commit 1c86f2e

Please sign in to comment.