aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authormerge <null@invalid>2009-01-13 08:34:39 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2009-01-13 08:34:39 +0000
commit5fed74bd2a6116f78bf70eeb6831d6a689b87289 (patch)
tree181c460741b1941fe936deb3acb4bccf2cd83cf4 /drivers
parent9200239791416d61f123a436595533c4d116b556 (diff)
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-return-path-openmoko-kernel-bo-1231786968
pending-tracking-hist top was MERGE-via-stable-tracking-return-path-openmoko-kernel-bo-1231786968 / 74cc4a9339e8cc15f05d94f76f851313f7667bcd ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-return-path-openmoko-kernel-bo stable-tracking-hist top was return-path-openmoko-kernel-bo / 05074908ceb3fd6cf9fdc218571c3bb1adc26cca ... parent commitmessage: From: Andy Green <agreen@pads.home.warmcat.com> Return-Path: <openmoko-kernel-bounces@lists.openmoko.org> Received: from mail.openmoko.org ([unix socket]) by mail.openmoko.org (Cyrus v2.1.18-IPv6-Debian-2.1.18-5.1) with LMTP; Mon, 12 Jan 2009 17:42:13 +0000 X-Sieve: CMU Sieve 2.2 Return-path: <openmoko-kernel-bounces@lists.openmoko.org> Received: from sita.openmoko.org ([88.198.124.203]) by mail.openmoko.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from <openmoko-kernel-bounces@lists.openmoko.org>) id 1LMQnk-00023C-W3 for andy@imap.openmoko.org; Mon, 12 Jan 2009 17:42:13 +0000 Received: from localhost ([127.0.0.1] helo=sita.openmoko.org) by sita.openmoko.org with esmtp (Exim 4.63) (envelope-from <openmoko-kernel-bounces@lists.openmoko.org>) id 1LMQnH-00021T-Ub; Mon, 12 Jan 2009 18:41:43 +0100 Received: from aakash.openmoko.org ([124.219.5.209]) by sita.openmoko.org with esmtp (Exim 4.63) (envelope-from <matt_hsu@openmoko.org>) id 1LMQnC-00021F-QB; Mon, 12 Jan 2009 18:41:42 +0100 Received: from [172.16.23.143] (helo=abacus-om.tw.openmoko.com ident=Debian-exim) by aakash.openmoko.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from <matt_hsu@openmoko.org>) id 1LMQhU-000398-Ik; Tue, 13 Jan 2009 01:35:54 +0800 Received: from matt by abacus-om.tw.openmoko.com with local (Exim 4.69) (envelope-from <matt_hsu@openmoko.org>) id 1LMRF1-0006Dl-2R; Tue, 13 Jan 2009 02:10:23 +0800 From: Matt Hsu <matt_hsu@openmoko.org> To: openmoko-kernel@lists.openmoko.org Date: Tue, 13 Jan 2009 02:10:23 +0800 Message-Id: <1231783823-23893-1-git-send-email-matt_hsu@openmoko.org> X-Mailer: git-send-email 1.5.6.5 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on sita.openmoko.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Subject: [PATCH] This patch fixs compiling warnings of pcap7200_ts driver. Cc: matt_hsu@openmoko.com X-BeenThere: openmoko-kernel@lists.openmoko.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Discussion regarding the OpenMoko Linux Kernel and boot loader <openmoko-kernel.lists.openmoko.org> List-Unsubscribe: <http://lists.openmoko.org/mailman/listinfo/openmoko-kernel>, <mailto:openmoko-kernel-request@lists.openmoko.org?subject=unsubscribe> List-Archive: <http://lists.openmoko.org/pipermail/openmoko-kernel> List-Post: <mailto:openmoko-kernel@lists.openmoko.org> List-Help: <mailto:openmoko-kernel-request@lists.openmoko.org?subject=help> List-Subscribe: <http://lists.openmoko.org/mailman/listinfo/openmoko-kernel>, <mailto:openmoko-kernel-request@lists.openmoko.org?subject=subscribe> Sender: openmoko-kernel-bounces@lists.openmoko.org Errors-To: openmoko-kernel-bounces@lists.openmoko.org In addition, it adds handling in case of any failures after creating sysfs. Signed-off-by: Matt Hsu <matt_hsu@openmoko.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/pcap7200_ts.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/pcap7200_ts.c b/drivers/input/touchscreen/pcap7200_ts.c
index 4c35caf9d15..4ee1c60398e 100644
--- a/drivers/input/touchscreen/pcap7200_ts.c
+++ b/drivers/input/touchscreen/pcap7200_ts.c
@@ -120,9 +120,9 @@ static int __set_op_mode(struct pcap7200_data *pcap, u_int8_t val)
*/
if (val == WAKEUP) {
for (i = 0; i < 3; i++)
- ret = i2c_master_send(pcap->client, &buf, sizeof(buf));
+ ret = i2c_master_send(pcap->client, buf, sizeof(buf));
} else
- ret = i2c_master_send(pcap->client, &buf, sizeof(buf));
+ ret = i2c_master_send(pcap->client, buf, sizeof(buf));
mutex_unlock(&pcap->lock);
return ret;
@@ -201,23 +201,30 @@ pcap7200_probe(struct i2c_client *client, const struct i2c_device_id *ids)
INIT_WORK(&pcap->work, pcap7200_work);
- sysfs_create_file(&client->dev.kobj, &dev_attr_op_mode.attr);
+ err = sysfs_create_file(&client->dev.kobj, &dev_attr_op_mode.attr);
+
+ if (err) {
+ dev_err(&client->dev, "Failed to create sysfs\n");
+ goto exit_unreg;
+ }
/* setup IRQ */
if (client->irq < 0) {
dev_err(&client->dev,
"No irq allocated in client resources!\n");
- return -EIO;
+ goto exit_rmsysfs;
}
pcap->irq = client->irq;
err = request_irq(pcap->irq, pcap7200_irq, IRQF_TRIGGER_LOW, "pcap7200", pcap);
if (err < 0)
- goto exit_unreg;
+ goto exit_rmsysfs;
return 0;
+exit_rmsysfs:
+ sysfs_remove_file(&client->dev.kobj, &dev_attr_op_mode.attr);
exit_unreg:
input_unregister_device(input_dev);
exit_kfree: