* linux-next: build failure after merge of the gpio tree
@ 2015-08-12 6:59 Stephen Rothwell
2015-08-12 7:20 ` [PATCH] Bluetooth: hci_bcm: improve use of gpios API Uwe Kleine-König
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2015-08-12 6:59 UTC (permalink / raw)
To: Linus Walleij, Gustavo Padovan
Cc: linux-next, linux-kernel, Uwe Kleine-König, Frederic Danis,
Marcel Holtmann
Hi Linus,
After merging the gpio tree, today's linux-next build (x86_64
allmodconfig) failed like this:
drivers/bluetooth/hci_bcm.c: In function 'bcm_acpi_probe':
drivers/bluetooth/hci_bcm.c:429:9: error: too few arguments to function 'devm_gpiod_get'
gpio = devm_gpiod_get(&pdev->dev, "device-wakeup");
^
In file included from drivers/bluetooth/hci_bcm.c:32:0:
include/linux/gpio/consumer.h:73:32: note: declared here
struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
^
drivers/bluetooth/hci_bcm.c:437:9: error: too few arguments to function 'devm_gpiod_get'
gpio = devm_gpiod_get(&pdev->dev, "shutdown");
^
In file included from drivers/bluetooth/hci_bcm.c:32:0:
include/linux/gpio/consumer.h:73:32: note: declared here
struct gpio_desc *__must_check devm_gpiod_get(struct device *dev,
^
Caused by commit
b17d1bf16cc7 ("gpio: make flags mandatory for gpiod_get functions")
Interacting with commit
0395ffc1ee05 ("Bluetooth: hci_bcm: Add PM for BCM devices")
from the bluetooth tree.
I added the following merge fix patch:
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 12 Aug 2015 16:55:58 +1000
Subject: [PATCH] Bluetooth: hci_bcm: fix for devm_gpiod_get API change
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
drivers/bluetooth/hci_bcm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index cb7fe837f7d9..c3291a4ab2e8 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -426,7 +426,7 @@ static int bcm_acpi_probe(struct bcm_device *dev)
dev->clk = devm_clk_get(&pdev->dev, NULL);
- gpio = devm_gpiod_get(&pdev->dev, "device-wakeup");
+ gpio = devm_gpiod_get(&pdev->dev, "device-wakeup", GPIOD_ASIS);
if (!IS_ERR(gpio)) {
ret = gpiod_direction_output(gpio, 0);
if (ret)
@@ -434,7 +434,7 @@ static int bcm_acpi_probe(struct bcm_device *dev)
dev->device_wakeup = gpio;
}
- gpio = devm_gpiod_get(&pdev->dev, "shutdown");
+ gpio = devm_gpiod_get(&pdev->dev, "shutdown", GPIOD_ASIS);
if (!IS_ERR(gpio)) {
ret = gpiod_direction_output(gpio, 0);
if (ret)
--
2.5.0
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] Bluetooth: hci_bcm: improve use of gpios API
2015-08-12 6:59 linux-next: build failure after merge of the gpio tree Stephen Rothwell
@ 2015-08-12 7:20 ` Uwe Kleine-König
2015-08-12 8:19 ` Stephen Rothwell
2015-08-12 14:39 ` Marcel Holtmann
0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2015-08-12 7:20 UTC (permalink / raw)
To: Stephen Rothwell, Linus Walleij, Gustavo Padovan, Frederic Danis,
Marcel Holtmann
Cc: linux-next, linux-kernel, linux-bluetooth, kernel
devm_gpiod_get currently has an optional parameter to set initial
direction and value for the requested gpio. Make use of this to simplify
the driver and make it not fail to build when this parameter is made
mandatory (which is scheduled for 4.3-rc1).
Moreover use the _optional variant of devm_gpiod_get to simplify error
handling (which also gets more strict for free).
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,
this is needed on top of commit 0395ffc1ee05 ("Bluetooth: hci_bcm: Add
PM for BCM devices") incombination with b17d1bf16cc7 ("gpio: make flags
mandatory for gpiod_get functions") which is currently sitting in next.
Stephen fixed it up with a simpler patch, which works fine, but doesn't
benefit from the nice things devm_gpiod_get et al offer.
Best regards
Uwe
drivers/bluetooth/hci_bcm.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index cb7fe837f7d9..6070303418d8 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -408,7 +408,6 @@ static int bcm_acpi_probe(struct bcm_device *dev)
{
struct platform_device *pdev = dev->pdev;
const struct acpi_device_id *id;
- struct gpio_desc *gpio;
struct acpi_device *adev;
LIST_HEAD(resources);
int ret;
@@ -426,21 +425,16 @@ static int bcm_acpi_probe(struct bcm_device *dev)
dev->clk = devm_clk_get(&pdev->dev, NULL);
- gpio = devm_gpiod_get(&pdev->dev, "device-wakeup");
- if (!IS_ERR(gpio)) {
- ret = gpiod_direction_output(gpio, 0);
- if (ret)
- return ret;
- dev->device_wakeup = gpio;
- }
+ dev->device_wakeup = devm_gpiod_get_optional(&pdev->dev,
+ "device-wakeup",
+ GPIOD_OUT_LOW);
+ if (IS_ERR(dev->device_wakeup))
+ return PTR_ERR(dev->device_wakeup);
- gpio = devm_gpiod_get(&pdev->dev, "shutdown");
- if (!IS_ERR(gpio)) {
- ret = gpiod_direction_output(gpio, 0);
- if (ret)
- return ret;
- dev->shutdown = gpio;
- }
+ dev->shutdown = devm_gpiod_get_optional(&pdev->dev, "shutdown",
+ GPIOD_OUT_LOW);
+ if (IS_ERR(dev->shutdown))
+ return PTR_ERR(dev->shutdown);
/* Make sure at-least one of the GPIO is defined and that
* a name is specified for this instance
--
2.4.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Bluetooth: hci_bcm: improve use of gpios API
2015-08-12 7:20 ` [PATCH] Bluetooth: hci_bcm: improve use of gpios API Uwe Kleine-König
@ 2015-08-12 8:19 ` Stephen Rothwell
2015-08-12 14:39 ` Marcel Holtmann
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2015-08-12 8:19 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Linus Walleij, Gustavo Padovan, Frederic Danis, Marcel Holtmann,
linux-next, linux-kernel, linux-bluetooth, kernel
Hi Uwe,
On Wed, 12 Aug 2015 09:20:56 +0200 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
>
> devm_gpiod_get currently has an optional parameter to set initial
> direction and value for the requested gpio. Make use of this to simplify
> the driver and make it not fail to build when this parameter is made
> mandatory (which is scheduled for 4.3-rc1).
>
> Moreover use the _optional variant of devm_gpiod_get to simplify error
> handling (which also gets more strict for free).
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
>
> this is needed on top of commit 0395ffc1ee05 ("Bluetooth: hci_bcm: Add
> PM for BCM devices") incombination with b17d1bf16cc7 ("gpio: make flags
> mandatory for gpiod_get functions") which is currently sitting in next.
>
> Stephen fixed it up with a simpler patch, which works fine, but doesn't
> benefit from the nice things devm_gpiod_get et al offer.
>
> Best regards
> Uwe
>
> drivers/bluetooth/hci_bcm.c | 24 +++++++++---------------
> 1 file changed, 9 insertions(+), 15 deletions(-)
I will use this instead of my simple patch tomorrow if the bluetooth
maintainer has not applied it.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Bluetooth: hci_bcm: improve use of gpios API
2015-08-12 7:20 ` [PATCH] Bluetooth: hci_bcm: improve use of gpios API Uwe Kleine-König
2015-08-12 8:19 ` Stephen Rothwell
@ 2015-08-12 14:39 ` Marcel Holtmann
1 sibling, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2015-08-12 14:39 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Stephen Rothwell, Linus Walleij, Gustavo F. Padovan,
Frederic Danis, linux-next, inux Kernel Mailing List,
linux-bluetooth, kernel
Hi Uwe,
> devm_gpiod_get currently has an optional parameter to set initial
> direction and value for the requested gpio. Make use of this to simplify
> the driver and make it not fail to build when this parameter is made
> mandatory (which is scheduled for 4.3-rc1).
>
> Moreover use the _optional variant of devm_gpiod_get to simplify error
> handling (which also gets more strict for free).
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
>
> this is needed on top of commit 0395ffc1ee05 ("Bluetooth: hci_bcm: Add
> PM for BCM devices") incombination with b17d1bf16cc7 ("gpio: make flags
> mandatory for gpiod_get functions") which is currently sitting in next.
>
> Stephen fixed it up with a simpler patch, which works fine, but doesn't
> benefit from the nice things devm_gpiod_get et al offer.
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-12 14:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-12 6:59 linux-next: build failure after merge of the gpio tree Stephen Rothwell
2015-08-12 7:20 ` [PATCH] Bluetooth: hci_bcm: improve use of gpios API Uwe Kleine-König
2015-08-12 8:19 ` Stephen Rothwell
2015-08-12 14:39 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).