From: Dirk Behme <dirk.behme@googlemail.com>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH] ARM: OMAP: Fix warnings in ads7846
Date: Sat, 04 Nov 2006 16:50:17 +0100 [thread overview]
Message-ID: <454CB6B9.4090307@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 175 bytes --]
Fix various warnings
warning: ignoring return value of 'device_create_file',
declared with attribute warn_unused_result
Signed-off-by: Dirk Behme <dirk.behme_at_gmail.com>
[-- Attachment #2: ads7846_warning_patch.txt --]
[-- Type: text/plain, Size: 2323 bytes --]
Index: linux-osk/drivers/input/touchscreen/ads7846.c
===================================================================
--- linux-osk.orig/drivers/input/touchscreen/ads7846.c
+++ linux-osk/drivers/input/touchscreen/ads7846.c
@@ -916,36 +916,54 @@ static int __devinit ads7846_probe(struc
* use the other ADC lines a bit differently too
*/
if (ts->model == 7846) {
- device_create_file(&spi->dev, &dev_attr_temp0);
- device_create_file(&spi->dev, &dev_attr_temp1);
+ err = device_create_file(&spi->dev, &dev_attr_temp0);
+ if (err)
+ goto err_remove_attr7;
+ err = device_create_file(&spi->dev, &dev_attr_temp1);
+ if (err)
+ goto err_remove_attr6;
}
/* in1 == vBAT (7846), or a non-scaled ADC input */
- if (ts->model != 7845)
- device_create_file(&spi->dev, &dev_attr_in1_input);
+ if (ts->model != 7845) {
+ err = device_create_file(&spi->dev, &dev_attr_in1_input);
+ if (err)
+ goto err_remove_attr5;
+ }
/* in0 == a non-scaled ADC input */
- device_create_file(&spi->dev, &dev_attr_in0_input);
+ err = device_create_file(&spi->dev, &dev_attr_in0_input);
+ if (err)
+ goto err_remove_attr4;
/* non-hwmon device attributes */
- device_create_file(&spi->dev, &dev_attr_pen_down);
- device_create_file(&spi->dev, &dev_attr_disable);
+ err = device_create_file(&spi->dev, &dev_attr_pen_down);
+ if (err)
+ goto err_remove_attr3;
+ err = device_create_file(&spi->dev, &dev_attr_disable);
+ if (err)
+ goto err_remove_attr2;
err = input_register_device(input_dev);
if (err)
- goto err_remove_attr;
+ goto err_remove_attr1;
return 0;
- err_remove_attr:
+ err_remove_attr1:
device_remove_file(&spi->dev, &dev_attr_disable);
+ err_remove_attr2:
device_remove_file(&spi->dev, &dev_attr_pen_down);
+ err_remove_attr3:
+ device_remove_file(&spi->dev, &dev_attr_in0_input);
+ err_remove_attr4:
+ if (ts->model != 7845)
+ device_remove_file(&spi->dev, &dev_attr_in1_input);
+ err_remove_attr5:
if (ts->model == 7846) {
device_remove_file(&spi->dev, &dev_attr_temp1);
+ err_remove_attr6:
device_remove_file(&spi->dev, &dev_attr_temp0);
}
- if (ts->model != 7845)
- device_remove_file(&spi->dev, &dev_attr_in1_input);
- device_remove_file(&spi->dev, &dev_attr_in0_input);
-
+ err_remove_attr7:
free_irq(spi->irq, ts);
err_cleanup_filter:
if (ts->filter_cleanup)
[-- Attachment #3: Type: text/plain, Size: 0 bytes --]
next reply other threads:[~2006-11-04 15:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-04 15:50 Dirk Behme [this message]
2006-11-09 23:26 ` [PATCH] ARM: OMAP: Fix warnings in ads7846 Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
2006-10-27 16:32 Dirk Behme
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=454CB6B9.4090307@gmail.com \
--to=dirk.behme@googlemail.com \
--cc=linux-omap-open-source@linux.omap.com \
/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: link
Be 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.