| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * gpiolib support for Wolfson Arizona class devices |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2012 Wolfson Microelectronics PLC. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * 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 | | - * |
|---|
| 13 | 8 | */ |
|---|
| 14 | 9 | |
|---|
| 15 | 10 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 152 | 147 | static int arizona_gpio_probe(struct platform_device *pdev) |
|---|
| 153 | 148 | { |
|---|
| 154 | 149 | 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; |
|---|
| 156 | 151 | struct arizona_gpio *arizona_gpio; |
|---|
| 157 | 152 | int ret; |
|---|
| 158 | 153 | |
|---|
| .. | .. |
|---|
| 187 | 182 | return -EINVAL; |
|---|
| 188 | 183 | } |
|---|
| 189 | 184 | |
|---|
| 190 | | - if (pdata && pdata->gpio_base) |
|---|
| 185 | + if (pdata->gpio_base) |
|---|
| 191 | 186 | arizona_gpio->gpio_chip.base = pdata->gpio_base; |
|---|
| 192 | 187 | else |
|---|
| 193 | 188 | arizona_gpio->gpio_chip.base = -1; |
|---|
| .. | .. |
|---|
| 197 | 192 | ret = devm_gpiochip_add_data(&pdev->dev, &arizona_gpio->gpio_chip, |
|---|
| 198 | 193 | arizona_gpio); |
|---|
| 199 | 194 | if (ret < 0) { |
|---|
| 195 | + pm_runtime_disable(&pdev->dev); |
|---|
| 200 | 196 | dev_err(&pdev->dev, "Could not register gpiochip, %d\n", |
|---|
| 201 | 197 | ret); |
|---|
| 202 | 198 | return ret; |
|---|