Skip to content

Commit

Permalink
pinctrl: amd: Add irq field data
Browse files Browse the repository at this point in the history
pinctrl_amd use gpiochip_get_data() to get their local state containers
back from the gpiochip passed as amd_gpio chip data.

Hence added irq field data to get directly using amd_gpio chip data.

Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Tested-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20210831120613.1514899-2-Basavaraj.Natikar@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Basavaraj Natikar authored and Linus Walleij committed Sep 16, 2021
1 parent 129803e commit 7e6f8d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/pinctrl/pinctrl-amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,6 @@ static struct pinctrl_desc amd_pinctrl_desc = {
static int amd_gpio_probe(struct platform_device *pdev)
{
int ret = 0;
int irq_base;
struct resource *res;
struct amd_gpio *gpio_dev;
struct gpio_irq_chip *girq;
Expand All @@ -925,9 +924,9 @@ static int amd_gpio_probe(struct platform_device *pdev)
if (!gpio_dev->base)
return -ENOMEM;

irq_base = platform_get_irq(pdev, 0);
if (irq_base < 0)
return irq_base;
gpio_dev->irq = platform_get_irq(pdev, 0);
if (gpio_dev->irq < 0)
return gpio_dev->irq;

#ifdef CONFIG_PM_SLEEP
gpio_dev->saved_regs = devm_kcalloc(&pdev->dev, amd_pinctrl_desc.npins,
Expand Down Expand Up @@ -987,7 +986,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
goto out2;
}

ret = devm_request_irq(&pdev->dev, irq_base, amd_gpio_irq_handler,
ret = devm_request_irq(&pdev->dev, gpio_dev->irq, amd_gpio_irq_handler,
IRQF_SHARED, KBUILD_MODNAME, gpio_dev);
if (ret)
goto out2;
Expand Down
1 change: 1 addition & 0 deletions drivers/pinctrl/pinctrl-amd.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ struct amd_gpio {
struct resource *res;
struct platform_device *pdev;
u32 *saved_regs;
int irq;
};

/* KERNCZ configuration*/
Expand Down

0 comments on commit 7e6f8d6

Please sign in to comment.