hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/input/misc/da9063_onkey.c
....@@ -1,16 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * OnKey device driver for DA9063, DA9062 and DA9061 PMICs
34 * Copyright (C) 2015 Dialog Semiconductor Ltd.
4
- *
5
- * This program is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU General Public License
7
- * as published by the Free Software Foundation; either version 2
8
- * of the License, or (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
145 */
156
167 #include <linux/module.h>
....@@ -22,7 +13,6 @@
2213 #include <linux/regmap.h>
2314 #include <linux/of.h>
2415 #include <linux/mfd/da9063/core.h>
25
-#include <linux/mfd/da9063/pdata.h>
2616 #include <linux/mfd/da9063/registers.h>
2717 #include <linux/mfd/da9062/core.h>
2818 #include <linux/mfd/da9062/registers.h>
....@@ -201,8 +191,6 @@
201191
202192 static int da9063_onkey_probe(struct platform_device *pdev)
203193 {
204
- struct da9063 *da9063 = dev_get_drvdata(pdev->dev.parent);
205
- struct da9063_pdata *pdata = dev_get_platdata(da9063->dev);
206194 struct da9063_onkey *onkey;
207195 const struct of_device_id *match;
208196 int irq;
....@@ -229,12 +217,8 @@
229217 return -ENXIO;
230218 }
231219
232
- if (pdata)
233
- onkey->key_power = pdata->key_power;
234
- else
235
- onkey->key_power =
236
- !of_property_read_bool(pdev->dev.of_node,
237
- "dlg,disable-key-power");
220
+ onkey->key_power = !of_property_read_bool(pdev->dev.of_node,
221
+ "dlg,disable-key-power");
238222
239223 onkey->input = devm_input_allocate_device(&pdev->dev);
240224 if (!onkey->input) {
....@@ -261,11 +245,8 @@
261245 }
262246
263247 irq = platform_get_irq_byname(pdev, "ONKEY");
264
- if (irq < 0) {
265
- error = irq;
266
- dev_err(&pdev->dev, "Failed to get platform IRQ: %d\n", error);
267
- return error;
268
- }
248
+ if (irq < 0)
249
+ return irq;
269250
270251 error = devm_request_threaded_irq(&pdev->dev, irq,
271252 NULL, da9063_onkey_irq_handler,