* [PATCH 2/2 v2] Input: stmpe-ts - return -ENOMEM if memory allocation fail
@ 2010-09-05 3:10 Axel Lin
2010-09-05 5:21 ` Wolfram Sang
0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2010-09-05 3:10 UTC (permalink / raw)
To: linux-kernel; +Cc: Dmitry Torokhov, Wolfram Sang, Luotao Fu, linux-input
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
Change since v1:
remove unneeded initialization of 'ret' variable
drivers/input/touchscreen/stmpe-ts.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c
index 656148e..06869e4 100644
--- a/drivers/input/touchscreen/stmpe-ts.c
+++ b/drivers/input/touchscreen/stmpe-ts.c
@@ -268,7 +268,7 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev)
struct stmpe_touch *ts;
struct input_dev *idev;
struct stmpe_ts_platform_data *ts_pdata = NULL;
- int ret = 0;
+ int ret;
int ts_irq;
ts_irq = platform_get_irq_byname(pdev, "FIFO_TH");
@@ -276,12 +276,16 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev)
return ts_irq;
ts = kzalloc(sizeof(*ts), GFP_KERNEL);
- if (!ts)
+ if (!ts) {
+ ret = -ENOMEM;
goto err_out;
+ }
idev = input_allocate_device();
- if (!idev)
+ if (!idev) {
+ ret = -ENOMEM;
goto err_free_ts;
+ }
platform_set_drvdata(pdev, ts);
ts->stmpe = stmpe;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2 v2] Input: stmpe-ts - return -ENOMEM if memory allocation fail
2010-09-05 3:10 [PATCH 2/2 v2] Input: stmpe-ts - return -ENOMEM if memory allocation fail Axel Lin
@ 2010-09-05 5:21 ` Wolfram Sang
2010-09-05 19:23 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2010-09-05 5:21 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Dmitry Torokhov, Luotao Fu, linux-input
[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]
On Sun, Sep 05, 2010 at 11:10:44AM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
> ---
> Change since v1:
> remove unneeded initialization of 'ret' variable
>
> drivers/input/touchscreen/stmpe-ts.c | 10 +++++++---
> 1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c
> index 656148e..06869e4 100644
> --- a/drivers/input/touchscreen/stmpe-ts.c
> +++ b/drivers/input/touchscreen/stmpe-ts.c
> @@ -268,7 +268,7 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev)
> struct stmpe_touch *ts;
> struct input_dev *idev;
> struct stmpe_ts_platform_data *ts_pdata = NULL;
> - int ret = 0;
> + int ret;
> int ts_irq;
>
> ts_irq = platform_get_irq_byname(pdev, "FIFO_TH");
> @@ -276,12 +276,16 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev)
> return ts_irq;
>
> ts = kzalloc(sizeof(*ts), GFP_KERNEL);
> - if (!ts)
> + if (!ts) {
> + ret = -ENOMEM;
> goto err_out;
> + }
>
> idev = input_allocate_device();
> - if (!idev)
> + if (!idev) {
> + ret = -ENOMEM;
> goto err_free_ts;
> + }
>
> platform_set_drvdata(pdev, ts);
> ts->stmpe = stmpe;
> --
> 1.7.0.4
>
>
>
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2 v2] Input: stmpe-ts - return -ENOMEM if memory allocation fail
2010-09-05 5:21 ` Wolfram Sang
@ 2010-09-05 19:23 ` Dmitry Torokhov
0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2010-09-05 19:23 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Axel Lin, linux-kernel, Luotao Fu, linux-input
On Sun, Sep 05, 2010 at 07:21:01AM +0200, Wolfram Sang wrote:
> On Sun, Sep 05, 2010 at 11:10:44AM +0800, Axel Lin wrote:
> > Signed-off-by: Axel Lin <axel.lin@gmail.com>
>
> Acked-by: Wolfram Sang <w.sang@pengutronix.de>
>
Applied, thank you.
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-09-05 19:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-05 3:10 [PATCH 2/2 v2] Input: stmpe-ts - return -ENOMEM if memory allocation fail Axel Lin
2010-09-05 5:21 ` Wolfram Sang
2010-09-05 19:23 ` Dmitry Torokhov
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).