From: Stephen Rothwell <sfr@canb.auug.org.au> To: Bartosz Golaszewski <brgl@bgdev.pl>, Olof Johansson <olof@lixom.net>, Arnd Bergmann <arnd@arndb.de> Cc: ARM <linux-arm-kernel@lists.infradead.org>, Andrew Davis <afd@ti.com>, Bartosz Golaszewski <bartosz.golaszewski@linaro.org>, Linus Walleij <linus.walleij@linaro.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux Next Mailing List <linux-next@vger.kernel.org> Subject: linux-next: manual merge of the gpio-brgl tree with the arm-soc tree Date: Tue, 30 May 2023 14:19:14 +1000 [thread overview] Message-ID: <20230530141914.672a8e59@canb.auug.org.au> (raw) [-- Attachment #1: Type: text/plain, Size: 3195 bytes --] Hi all, Today's linux-next merge of the gpio-brgl tree got a conflict in: drivers/gpio/gpio-twl4030.c between commit: d5f4fa60d63a ("ARM/gpio: Push OMAP2 quirk down into TWL4030 driver") from the arm-soc tree and commit: fbc8ab2ccd85 ("gpio: twl4030: Use devm_gpiochip_add_data() to simplify remove path") from the gpio-brgl tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. -- Cheers, Stephen Rothwell diff --cc drivers/gpio/gpio-twl4030.c index 446599ac234a,3708ed2314e8..000000000000 --- a/drivers/gpio/gpio-twl4030.c +++ b/drivers/gpio/gpio-twl4030.c @@@ -490,30 -492,9 +490,18 @@@ static struct twl4030_gpio_platform_dat return omap_twl_info; } - /* Cannot use as gpio_twl4030_probe() calls us */ - static int gpio_twl4030_remove(struct platform_device *pdev) - { - struct gpio_twl4030_priv *priv = platform_get_drvdata(pdev); - - gpiochip_remove(&priv->gpio_chip); - - /* REVISIT no support yet for deregistering all the IRQs */ - WARN_ON(!is_module()); - return 0; - } - +/* Called from the registered devm action */ +static void gpio_twl4030_power_off_action(void *data) +{ + struct gpio_desc *d = data; + + gpiod_unexport(d); + gpiochip_free_own_desc(d); +} + static int gpio_twl4030_probe(struct platform_device *pdev) { - struct twl4030_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); + struct twl4030_gpio_platform_data *pdata; struct device_node *node = pdev->dev.of_node; struct gpio_twl4030_priv *priv; int ret, irq_base; @@@ -586,38 -569,19 +574,35 @@@ no_irqs if (ret < 0) { dev_err(&pdev->dev, "could not register gpiochip, %d\n", ret); priv->gpio_chip.ngpio = 0; - gpio_twl4030_remove(pdev); - goto out; + return ret; } - if (pdata->setup) { - int status; + /* + * Special quirk for the OMAP3 to hog and export a WLAN power + * GPIO. + */ + if (IS_ENABLED(CONFIG_ARCH_OMAP3) && + of_machine_is_compatible("compulab,omap3-sbc-t3730")) { + struct gpio_desc *d; + + d = gpiochip_request_own_desc(&priv->gpio_chip, + 2, "wlan pwr", + GPIO_ACTIVE_HIGH, + GPIOD_OUT_HIGH); + if (IS_ERR(d)) + return dev_err_probe(&pdev->dev, PTR_ERR(d), + "unable to hog wlan pwr GPIO\n"); + + gpiod_export(d, 0); + + ret = devm_add_action_or_reset(&pdev->dev, gpio_twl4030_power_off_action, d); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to install power off handler\n"); - status = pdata->setup(&pdev->dev, priv->gpio_chip.base, - TWL4030_GPIO_MAX); - if (status) - dev_dbg(&pdev->dev, "setup --> %d\n", status); } - platform_set_drvdata(pdev, priv); - out: - return ret; + return 0; } static const struct of_device_id twl_gpio_match[] = { [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Rothwell <sfr@canb.auug.org.au> To: Bartosz Golaszewski <brgl@bgdev.pl>, Olof Johansson <olof@lixom.net>, Arnd Bergmann <arnd@arndb.de> Cc: ARM <linux-arm-kernel@lists.infradead.org>, Andrew Davis <afd@ti.com>, Bartosz Golaszewski <bartosz.golaszewski@linaro.org>, Linus Walleij <linus.walleij@linaro.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux Next Mailing List <linux-next@vger.kernel.org> Subject: linux-next: manual merge of the gpio-brgl tree with the arm-soc tree Date: Tue, 30 May 2023 14:19:14 +1000 [thread overview] Message-ID: <20230530141914.672a8e59@canb.auug.org.au> (raw) [-- Attachment #1.1: Type: text/plain, Size: 3195 bytes --] Hi all, Today's linux-next merge of the gpio-brgl tree got a conflict in: drivers/gpio/gpio-twl4030.c between commit: d5f4fa60d63a ("ARM/gpio: Push OMAP2 quirk down into TWL4030 driver") from the arm-soc tree and commit: fbc8ab2ccd85 ("gpio: twl4030: Use devm_gpiochip_add_data() to simplify remove path") from the gpio-brgl tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. -- Cheers, Stephen Rothwell diff --cc drivers/gpio/gpio-twl4030.c index 446599ac234a,3708ed2314e8..000000000000 --- a/drivers/gpio/gpio-twl4030.c +++ b/drivers/gpio/gpio-twl4030.c @@@ -490,30 -492,9 +490,18 @@@ static struct twl4030_gpio_platform_dat return omap_twl_info; } - /* Cannot use as gpio_twl4030_probe() calls us */ - static int gpio_twl4030_remove(struct platform_device *pdev) - { - struct gpio_twl4030_priv *priv = platform_get_drvdata(pdev); - - gpiochip_remove(&priv->gpio_chip); - - /* REVISIT no support yet for deregistering all the IRQs */ - WARN_ON(!is_module()); - return 0; - } - +/* Called from the registered devm action */ +static void gpio_twl4030_power_off_action(void *data) +{ + struct gpio_desc *d = data; + + gpiod_unexport(d); + gpiochip_free_own_desc(d); +} + static int gpio_twl4030_probe(struct platform_device *pdev) { - struct twl4030_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); + struct twl4030_gpio_platform_data *pdata; struct device_node *node = pdev->dev.of_node; struct gpio_twl4030_priv *priv; int ret, irq_base; @@@ -586,38 -569,19 +574,35 @@@ no_irqs if (ret < 0) { dev_err(&pdev->dev, "could not register gpiochip, %d\n", ret); priv->gpio_chip.ngpio = 0; - gpio_twl4030_remove(pdev); - goto out; + return ret; } - if (pdata->setup) { - int status; + /* + * Special quirk for the OMAP3 to hog and export a WLAN power + * GPIO. + */ + if (IS_ENABLED(CONFIG_ARCH_OMAP3) && + of_machine_is_compatible("compulab,omap3-sbc-t3730")) { + struct gpio_desc *d; + + d = gpiochip_request_own_desc(&priv->gpio_chip, + 2, "wlan pwr", + GPIO_ACTIVE_HIGH, + GPIOD_OUT_HIGH); + if (IS_ERR(d)) + return dev_err_probe(&pdev->dev, PTR_ERR(d), + "unable to hog wlan pwr GPIO\n"); + + gpiod_export(d, 0); + + ret = devm_add_action_or_reset(&pdev->dev, gpio_twl4030_power_off_action, d); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "failed to install power off handler\n"); - status = pdata->setup(&pdev->dev, priv->gpio_chip.base, - TWL4030_GPIO_MAX); - if (status) - dev_dbg(&pdev->dev, "setup --> %d\n", status); } - platform_set_drvdata(pdev, priv); - out: - return ret; + return 0; } static const struct of_device_id twl_gpio_match[] = { [-- Attachment #1.2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] [-- Attachment #2: Type: text/plain, Size: 176 bytes --] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2023-05-30 4:19 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-05-30 4:19 Stephen Rothwell [this message] 2023-05-30 4:19 ` linux-next: manual merge of the gpio-brgl tree with the arm-soc tree Stephen Rothwell 2023-05-30 9:28 ` Arnd Bergmann 2023-05-30 9:28 ` Arnd Bergmann 2023-05-30 9:35 ` Bartosz Golaszewski 2023-05-30 9:35 ` Bartosz Golaszewski 2023-05-30 9:49 ` Linus Walleij 2023-05-30 9:49 ` Linus Walleij -- strict thread matches above, loose matches on Subject: below -- 2021-01-28 6:03 Stephen Rothwell 2021-01-28 6:03 ` Stephen Rothwell 2021-02-09 10:01 ` Geert Uytterhoeven 2021-02-09 10:01 ` Geert Uytterhoeven 2021-02-09 11:35 ` Arnd Bergmann 2021-02-09 11:35 ` Arnd Bergmann 2021-02-10 5:33 ` nobuhiro1.iwamatsu 2021-02-10 5:33 ` nobuhiro1.iwamatsu
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230530141914.672a8e59@canb.auug.org.au \ --to=sfr@canb.auug.org.au \ --cc=afd@ti.com \ --cc=arnd@arndb.de \ --cc=bartosz.golaszewski@linaro.org \ --cc=brgl@bgdev.pl \ --cc=linus.walleij@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-next@vger.kernel.org \ --cc=olof@lixom.net \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.