diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-04-17 22:31:16 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-04-22 09:42:18 -0400 |
commit | 06f95e66deca680ff73076914b6ee47bcbe94926 (patch) | |
tree | 73d6bec7dbe68bf8459e36764b8a0944d2959740 /net | |
parent | 8ceb59557bdc373e532b87d4142ce27e04218f0e (diff) |
rfkill: fix error return code in rfkill_gpio_probe()
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 <yongjun_wei@trendmicro.com.cn>
[fix some indentation on the way]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/rfkill/rfkill-gpio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 78fc0937948d..fb076cd6f808 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c | |||
@@ -131,6 +131,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev) | |||
131 | rfkill->pwr_clk = clk_get(&pdev->dev, pdata->power_clk_name); | 131 | rfkill->pwr_clk = clk_get(&pdev->dev, pdata->power_clk_name); |
132 | if (IS_ERR(rfkill->pwr_clk)) { | 132 | if (IS_ERR(rfkill->pwr_clk)) { |
133 | pr_warn("%s: can't find pwr_clk.\n", __func__); | 133 | pr_warn("%s: can't find pwr_clk.\n", __func__); |
134 | ret = PTR_ERR(rfkill->pwr_clk); | ||
134 | goto fail_shutdown_name; | 135 | goto fail_shutdown_name; |
135 | } | 136 | } |
136 | } | 137 | } |
@@ -152,9 +153,11 @@ static int rfkill_gpio_probe(struct platform_device *pdev) | |||
152 | } | 153 | } |
153 | 154 | ||
154 | rfkill->rfkill_dev = rfkill_alloc(pdata->name, &pdev->dev, pdata->type, | 155 | rfkill->rfkill_dev = rfkill_alloc(pdata->name, &pdev->dev, pdata->type, |
155 | &rfkill_gpio_ops, rfkill); | 156 | &rfkill_gpio_ops, rfkill); |
156 | if (!rfkill->rfkill_dev) | 157 | if (!rfkill->rfkill_dev) { |
158 | ret = -ENOMEM; | ||
157 | goto fail_shutdown; | 159 | goto fail_shutdown; |
160 | } | ||
158 | 161 | ||
159 | ret = rfkill_register(rfkill->rfkill_dev); | 162 | ret = rfkill_register(rfkill->rfkill_dev); |
160 | if (ret < 0) | 163 | if (ret < 0) |