diff options
-rw-r--r-- | drivers/power/reset/ltc2952-poweroff.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/power/reset/ltc2952-poweroff.c b/drivers/power/reset/ltc2952-poweroff.c index 6487b991ed45..0b0792a9ad56 100644 --- a/drivers/power/reset/ltc2952-poweroff.c +++ b/drivers/power/reset/ltc2952-poweroff.c | |||
@@ -72,8 +72,6 @@ struct ltc2952_poweroff_data { | |||
72 | 72 | ||
73 | struct device *dev; | 73 | struct device *dev; |
74 | 74 | ||
75 | unsigned int virq; | ||
76 | |||
77 | /** | 75 | /** |
78 | * 0: trigger | 76 | * 0: trigger |
79 | * 1: watchdog | 77 | * 1: watchdog |
@@ -260,13 +258,11 @@ static int ltc2952_poweroff_init(struct platform_device *pdev) | |||
260 | goto err_io; | 258 | goto err_io; |
261 | } | 259 | } |
262 | 260 | ||
263 | ltc2952_data->virq = virq; | 261 | ret = devm_request_irq(&pdev->dev, virq, |
264 | ret = request_irq(virq, | 262 | ltc2952_poweroff_handler, |
265 | ltc2952_poweroff_handler, | 263 | (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING), |
266 | (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING), | 264 | "ltc2952-poweroff", |
267 | "ltc2952-poweroff", | 265 | ltc2952_data); |
268 | ltc2952_data | ||
269 | ); | ||
270 | 266 | ||
271 | if (ret) { | 267 | if (ret) { |
272 | dev_err(&pdev->dev, "cannot configure an interrupt handler\n"); | 268 | dev_err(&pdev->dev, "cannot configure an interrupt handler\n"); |
@@ -316,12 +312,9 @@ static int ltc2952_poweroff_remove(struct platform_device *pdev) | |||
316 | 312 | ||
317 | pm_power_off = NULL; | 313 | pm_power_off = NULL; |
318 | 314 | ||
319 | if (ltc2952_data) { | 315 | if (ltc2952_data) |
320 | free_irq(ltc2952_data->virq, ltc2952_data); | ||
321 | |||
322 | for (i = 0; i < ARRAY_SIZE(ltc2952_data->gpio); i++) | 316 | for (i = 0; i < ARRAY_SIZE(ltc2952_data->gpio); i++) |
323 | gpiod_put(ltc2952_data->gpio[i]); | 317 | gpiod_put(ltc2952_data->gpio[i]); |
324 | } | ||
325 | 318 | ||
326 | return 0; | 319 | return 0; |
327 | } | 320 | } |