This patch frees stmpe-keyboard driver from tension of freeing resources :)
devm_* derivatives of multiple routines are used while allocating resources,
which would be freed automatically by kernel.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/input/keyboard/stmpe-keypad.c | 31 ++++++++++---------------------
1 file changed, 10 insertions(+), 21 deletions(-)
@@ -294,7 +293,7 @@ static int __devinit stmpe_keypad_probe(struct platform_device *pdev)STMPE_KEYPAD_MAX_COLS,keypad->keymap,input);if(ret)-gotoout_freeinput;+returnret;input_set_capability(input,EV_MSC,MSC_SCAN);if(!plat->no_autorepeat)
@@ -314,17 +313,17 @@ static int __devinit stmpe_keypad_probe(struct platform_device *pdev)ret=stmpe_keypad_chip_init(keypad);if(ret<0)-gotoout_freeinput;+returnret;ret=input_register_device(input);if(ret){dev_err(&pdev->dev,"unable to register input device: %d\n",ret);-gotoout_freeinput;+returnret;}-ret=request_threaded_irq(irq,NULL,stmpe_keypad_irq,IRQF_ONESHOT,-"stmpe-keypad",keypad);+ret=devm_request_threaded_irq(&pdev->dev,irq,NULL,stmpe_keypad_irq,+IRQF_ONESHOT,"stmpe-keypad",keypad);if(ret){dev_err(&pdev->dev,"unable to get irq: %d\n",ret);gotoout_unregisterinput;
@@ -336,11 +335,6 @@ static int __devinit stmpe_keypad_probe(struct platform_device *pdev)out_unregisterinput:input_unregister_device(input);-input=NULL;-out_freeinput:-input_free_device(input);-out_freekeypad:-kfree(keypad);returnret;}
@@ -348,14 +342,9 @@ static int __devexit stmpe_keypad_remove(struct platform_device *pdev){structstmpe_keypad*keypad=platform_get_drvdata(pdev);structstmpe*stmpe=keypad->stmpe;-intirq=platform_get_irq(pdev,0);stmpe_disable(stmpe,STMPE_BLOCK_KEYPAD);--free_irq(irq,keypad);input_unregister_device(keypad->input);-platform_set_drvdata(pdev,NULL);-kfree(keypad);return0;}
This patch frees stmpe-ts driver from tension of freeing resources :)
devm_* derivatives of multiple routines are used while allocating resources,
which would be freed automatically by kernel.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/input/touchscreen/stmpe-ts.c | 45 +++++++++---------------------------
1 file changed, 11 insertions(+), 34 deletions(-)
Hi Viresh,
On Fri, Nov 09, 2012 at 08:57:48PM +0530, Viresh Kumar wrote:
quoted hunk
This patch frees stmpe-keyboard driver from tension of freeing resources :)
devm_* derivatives of multiple routines are used while allocating resources,
which would be freed automatically by kernel.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/input/keyboard/stmpe-keypad.c | 31 ++++++++++---------------------
1 file changed, 10 insertions(+), 21 deletions(-)
@@ -294,7 +293,7 @@ static int __devinit stmpe_keypad_probe(struct platform_device *pdev)STMPE_KEYPAD_MAX_COLS,keypad->keymap,input);if(ret)-gotoout_freeinput;+returnret;input_set_capability(input,EV_MSC,MSC_SCAN);if(!plat->no_autorepeat)
@@ -314,17 +313,17 @@ static int __devinit stmpe_keypad_probe(struct platform_device *pdev)ret=stmpe_keypad_chip_init(keypad);if(ret<0)-gotoout_freeinput;+returnret;ret=input_register_device(input);if(ret){dev_err(&pdev->dev,"unable to register input device: %d\n",ret);-gotoout_freeinput;+returnret;}-ret=request_threaded_irq(irq,NULL,stmpe_keypad_irq,IRQF_ONESHOT,-"stmpe-keypad",keypad);+ret=devm_request_threaded_irq(&pdev->dev,irq,NULL,stmpe_keypad_irq,+IRQF_ONESHOT,"stmpe-keypad",keypad);if(ret){dev_err(&pdev->dev,"unable to get irq: %d\n",ret);gotoout_unregisterinput;
@@ -336,11 +335,6 @@ static int __devinit stmpe_keypad_probe(struct platform_device *pdev)out_unregisterinput:input_unregister_device(input);
If input device was alocated with devm_* interface it does not need be
explicitly unregistered/freed.
Thanks.
--
Dmitry
On 9 November 2012 20:57, Viresh Kumar [off-list ref] wrote:
This patch frees stmpe-ts driver from tension of freeing resources :)
devm_* derivatives of multiple routines are used while allocating resources,
which would be freed automatically by kernel.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Hi Viresh,
On Fri, Nov 09, 2012 at 10:34:35PM +0530, Viresh Kumar wrote:
quoted hunk
On 9 November 2012 20:57, Viresh Kumar [off-list ref] wrote:
quoted
This patch frees stmpe-ts driver from tension of freeing resources :)
devm_* derivatives of multiple routines are used while allocating resources,
which would be freed automatically by kernel.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
On 10 November 2012 13:30, Dmitry Torokhov [off-list ref] wrote:
Sometimes your mailer does wrap long lines, please make sure to turn it
off for patches.
I am using gmail for replying on mails and this fixup was done using that. Don't
know why it happened.
I am doing the same step again to verify what's playing with patches.
On this copy
i can see that this issue isn't there till now.
commit dda6d45808d65aaf8b0d4153e7a418b255365818
Author: Viresh Kumar [off-list ref]
Date: Fri Nov 9 22:28:26 2012 +0530
fixup! input: stmpe-ts: Use devm_*() routines
---
drivers/input/touchscreen/stmpe-ts.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/input/touchscreen/stmpe-ts.c
b/drivers/input/touchscreen/stmpe-ts.c
index 9896095..f2cb15d 100644
On 10 November 2012 13:33, Viresh Kumar [off-list ref] wrote:
quoted hunk
On 10 November 2012 13:30, Dmitry Torokhov [off-list ref] wrote:
quoted
Sometimes your mailer does wrap long lines, please make sure to turn it
off for patches.
I am using gmail for replying on mails and this fixup was done using that. Don't
know why it happened.
I am doing the same step again to verify what's playing with patches.
On this copy
i can see that this issue isn't there till now.
diff --git a/drivers/input/touchscreen/stmpe-ts.c
quoted hunk
@@ -344,8 +344,6 @@ static int __devexit stmpe_ts_remove(struct
On Sat, Nov 10, 2012 at 01:34:33PM +0530, Viresh Kumar wrote:
On 10 November 2012 13:33, Viresh Kumar [off-list ref] wrote:
quoted
On 10 November 2012 13:30, Dmitry Torokhov [off-list ref] wrote:
quoted
Sometimes your mailer does wrap long lines, please make sure to turn it
off for patches.
I am using gmail for replying on mails and this fixup was done using that. Don't
know why it happened.
I am doing the same step again to verify what's playing with patches.
On this copy
i can see that this issue isn't there till now.
diff --git a/drivers/input/touchscreen/stmpe-ts.c
quoted
@@ -344,8 +344,6 @@ static int __devexit stmpe_ts_remove(struct
From: Hannes Frederic Sowa <hidden> Date: 2012-11-10 08:15:29
On Sat, Nov 10, 2012 at 01:34:33PM +0530, Viresh Kumar wrote:
wrapped again.. Don't know how to disable it. :(
To quote Documentation/email-clients.txt:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Gmail (Web GUI)
Does not work for sending patches.
Gmail web client converts tabs to spaces automatically.
At the same time it wraps lines every 78 chars with CRLF style line breaks
although tab2space problem can be solved with external editor.
Another problem is that Gmail will base64-encode any message that has a
non-ASCII character. That includes things like European names.