summaryrefslogtreecommitdiffstats
path: root/drivers/staging/hikey9xx/hi6421-spmi-pmic.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-07-17 11:58:13 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-21 11:23:42 +0200
commitf81d992182570d56db642344fa89a7e1777dbc80 (patch)
tree97024a3a3a74cc636badf5abf0d89cebdb141a04 /drivers/staging/hikey9xx/hi6421-spmi-pmic.c
parentb82d45a9a6de363dd80704c9a6d9f5313e6099ab (diff)
downloadlinux-f81d992182570d56db642344fa89a7e1777dbc80.tar.gz
linux-f81d992182570d56db642344fa89a7e1777dbc80.tar.bz2
linux-f81d992182570d56db642344fa89a7e1777dbc80.zip
staging: hi6421-spmi-pmic: rename GPIO IRQ OF node
Instead of using the standard name ("gpios"), use "interrupts". Suggested-by: Rob Herring <robh@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/8b2cad1e9b9904c6a2aaea8786d5e5a39f09ac19.1626515862.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/hikey9xx/hi6421-spmi-pmic.c')
-rw-r--r--drivers/staging/hikey9xx/hi6421-spmi-pmic.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c
index dd7ff63214d3..61cbd2e62f68 100644
--- a/drivers/staging/hikey9xx/hi6421-spmi-pmic.c
+++ b/drivers/staging/hikey9xx/hi6421-spmi-pmic.c
@@ -218,6 +218,7 @@ static int hi6421_spmi_pmic_probe(struct spmi_device *sdev)
struct device *dev = &sdev->dev;
struct device_node *np = dev->of_node;
struct hi6421_spmi_pmic *ddata;
+ struct platform_device *pdev;
unsigned int virq;
int ret, i;
@@ -233,21 +234,14 @@ static int hi6421_spmi_pmic_probe(struct spmi_device *sdev)
ddata->dev = dev;
- ddata->gpio = of_get_gpio(np, 0);
- if (ddata->gpio < 0)
- return ddata->gpio;
+ pdev = container_of(dev, struct platform_device, dev);
- if (!gpio_is_valid(ddata->gpio))
- return -EINVAL;
-
- ret = devm_gpio_request_one(dev, ddata->gpio, GPIOF_IN, "pmic");
- if (ret < 0) {
- dev_err(dev, "Failed to request gpio%d\n", ddata->gpio);
- return ret;
+ ddata->irq = platform_get_irq(pdev, 0);
+ if (ddata->irq < 0) {
+ dev_err(dev, "Error %d when getting IRQs\n", ddata->irq);
+ return ddata->irq;
}
- ddata->irq = gpio_to_irq(ddata->gpio);
-
hi6421_spmi_pmic_irq_init(ddata);
ddata->irqs = devm_kzalloc(dev, PMIC_IRQ_LIST_MAX * sizeof(int), GFP_KERNEL);