Skip to content

Commit

Permalink
rfkill: fix error return code in rfkill_gpio_probe()
Browse files Browse the repository at this point in the history
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <[email protected]>
[fix some indentation on the way]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
Wei Yongjun authored and jmberg-intel committed Apr 22, 2013
1 parent 8ceb595 commit 06f95e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/rfkill/rfkill-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
rfkill->pwr_clk = clk_get(&pdev->dev, pdata->power_clk_name);
if (IS_ERR(rfkill->pwr_clk)) {
pr_warn("%s: can't find pwr_clk.\n", __func__);
ret = PTR_ERR(rfkill->pwr_clk);
goto fail_shutdown_name;
}
}
Expand All @@ -152,9 +153,11 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
}

rfkill->rfkill_dev = rfkill_alloc(pdata->name, &pdev->dev, pdata->type,
&rfkill_gpio_ops, rfkill);
if (!rfkill->rfkill_dev)
&rfkill_gpio_ops, rfkill);
if (!rfkill->rfkill_dev) {
ret = -ENOMEM;
goto fail_shutdown;
}

ret = rfkill_register(rfkill->rfkill_dev);
if (ret < 0)
Expand Down

0 comments on commit 06f95e6

Please sign in to comment.