From: Qinghuang Feng <s3c24xx@gmail.com>
To: rmk@arm.linux.org.uk
Cc: linux-arm-kernel@lists.arm.linux.org.uk, linux-kernel@vger.kernel.org
Subject: [PATCH]scsi/arm: check the return value of device_create_file() in powertec.c
Date: Thu, 29 May 2008 02:11:38 +0800 [thread overview]
Message-ID: <200805290211.39355.s3c24xx@gmail.com> (raw)
powertec.c : add code to print an error message while device_create_file() called from powertecscsi_probe() fail
Signed-off-by: Qinghuang Feng <s3c24xx@gmail.com>
---
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index d9a546d..14e25a6 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -315,6 +315,7 @@ powertecscsi_probe(struct expansion_card
struct powertec_info *info;
void __iomem *base;
int ret;
+ int ferr;
ret = ecard_request_resources(ec);
if (ret)
@@ -361,7 +362,9 @@ powertecscsi_probe(struct expansion_card
ecard_setirq(ec, &powertecscsi_ops, info);
- device_create_file(&ec->dev, &dev_attr_bus_term);
+ ferr = device_create_file(&ec->dev, &dev_attr_bus_term);
+ if (ferr)
+ printk(KERN_ERR "powertecscsi :failed to create the attribute file !\n");
ret = fas216_init(host);
if (ret)
@@ -398,7 +401,8 @@ powertecscsi_probe(struct expansion_card
fas216_release(host);
out_free:
- device_remove_file(&ec->dev, &dev_attr_bus_term);
+ if (!ferr)
+ device_remove_file(&ec->dev, &dev_attr_bus_term);
scsi_host_put(host);
out_region:
reply other threads:[~2008-05-28 18:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200805290211.39355.s3c24xx@gmail.com \
--to=s3c24xx@gmail.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox