From: Phil Elwell Date: Thu, 21 Dec 2023 15:13:37 +0000 (+0000) Subject: bcm2835-virtgpio: Update for Linux 6.6 X-Git-Tag: accepted/tizen/unified/20240422.153132~178 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f54c10967b9abdf04b8f9850c83480430e58c0a4;p=platform%2Fkernel%2Flinux-rpi.git bcm2835-virtgpio: Update for Linux 6.6 The gpio subsystem is happier if the gpiochip is given a parent, and if it doesn't have a fixed base gpio number. While we're in here, use the fact that the firmware node is the parent to locate it, and use the devm_ version of rpi_firmware_get. Signed-off-by: Phil Elwell --- diff --git a/drivers/gpio/gpio-bcm-virt.c b/drivers/gpio/gpio-bcm-virt.c index 42c03b6..3b1ae09 100644 --- a/drivers/gpio/gpio-bcm-virt.c +++ b/drivers/gpio/gpio-bcm-virt.c @@ -85,13 +85,14 @@ static int brcmvirt_gpio_probe(struct platform_device *pdev) struct brcmvirt_gpio *ucb; u32 gpiovirtbuf; - fw_node = of_parse_phandle(np, "firmware", 0); + fw_node = of_get_parent(np); if (!fw_node) { dev_err(dev, "Missing firmware node\n"); return -ENOENT; } - fw = rpi_firmware_get(fw_node); + fw = devm_rpi_firmware_get(&pdev->dev, fw_node); + of_node_put(fw_node); if (!fw) return -EPROBE_DEFER; @@ -145,10 +146,10 @@ static int brcmvirt_gpio_probe(struct platform_device *pdev) } ucb->bus_addr = 0; } + ucb->gc.parent = dev; ucb->gc.label = MODULE_NAME; ucb->gc.owner = THIS_MODULE; - //ucb->gc.dev = dev; - ucb->gc.base = 100; + ucb->gc.base = -1; ucb->gc.ngpio = NUM_GPIO; ucb->gc.direction_input = brcmvirt_gpio_dir_in;