diff mbox

[OpenWrt-Devel] kernel: fix uninitialised variable causing 1-wire to not bind to GPIO

Message ID 5543522F.5020405@andrewmcdonnell.net
State Changes Requested
Headers show

Commit Message

Andrew McDonnell May 1, 2015, 10:15 a.m. UTC
This patch fixes a bug where 1-wire fails with an error instead of binding
to the requested GPIO pin: "gpio_request_one (ext_pullup_enable_pin) failed"

---
 package/kernel/w1-gpio-custom/src/w1-gpio-custom.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Felix Fietkau May 8, 2015, 10:10 p.m. UTC | #1
On 2015-05-01 12:15, Andrew McDonnell wrote:
> This patch fixes a bug where 1-wire fails with an error instead of binding
> to the requested GPIO pin: "gpio_request_one (ext_pullup_enable_pin) failed"
> 
> ---
>  package/kernel/w1-gpio-custom/src/w1-gpio-custom.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/kernel/w1-gpio-custom/src/w1-gpio-custom.c
> b/package/kernel/w1-gpio-custom/src/w1-gpio-custom.c
> index fc2f842..2018f58 100644
> --- a/package/kernel/w1-gpio-custom/src/w1-gpio-custom.c
> +++ b/package/kernel/w1-gpio-custom/src/w1-gpio-custom.c
> @@ -113,6 +113,7 @@ static int __init w1_gpio_custom_add_one(unsigned int id,
> unsigned int *params)
The patch is line wrapped and does not apply.
Please resend.

- Felix
diff mbox

Patch

diff --git a/package/kernel/w1-gpio-custom/src/w1-gpio-custom.c
b/package/kernel/w1-gpio-custom/src/w1-gpio-custom.c
index fc2f842..2018f58 100644
--- a/package/kernel/w1-gpio-custom/src/w1-gpio-custom.c
+++ b/package/kernel/w1-gpio-custom/src/w1-gpio-custom.c
@@ -113,6 +113,7 @@  static int __init w1_gpio_custom_add_one(unsigned int id,
unsigned int *params)
 	pdata.pin = params[BUS_PARAM_PIN];
 	pdata.is_open_drain = params[BUS_PARAM_OD] ? 1 : 0;
 	pdata.enable_external_pullup = NULL;
+	pdata.ext_pullup_enable_pin = -1;
  	err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
 	if (err)