hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/gpio/gpio-arizona.c
....@@ -1,15 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * gpiolib support for Wolfson Arizona class devices
34 *
45 * Copyright 2012 Wolfson Microelectronics PLC.
56 *
67 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
12
- *
138 */
149
1510 #include <linux/kernel.h>
....@@ -152,7 +147,7 @@
152147 static int arizona_gpio_probe(struct platform_device *pdev)
153148 {
154149 struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
155
- struct arizona_pdata *pdata = dev_get_platdata(arizona->dev);
150
+ struct arizona_pdata *pdata = &arizona->pdata;
156151 struct arizona_gpio *arizona_gpio;
157152 int ret;
158153
....@@ -187,7 +182,7 @@
187182 return -EINVAL;
188183 }
189184
190
- if (pdata && pdata->gpio_base)
185
+ if (pdata->gpio_base)
191186 arizona_gpio->gpio_chip.base = pdata->gpio_base;
192187 else
193188 arizona_gpio->gpio_chip.base = -1;
....@@ -197,6 +192,7 @@
197192 ret = devm_gpiochip_add_data(&pdev->dev, &arizona_gpio->gpio_chip,
198193 arizona_gpio);
199194 if (ret < 0) {
195
+ pm_runtime_disable(&pdev->dev);
200196 dev_err(&pdev->dev, "Could not register gpiochip, %d\n",
201197 ret);
202198 return ret;