public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH] m68k: zorro - kill warn_unused_result warnings
Date: Fri,  2 Jan 2009 11:41:28 +0100	[thread overview]
Message-ID: <1230892892-25751-16-git-send-email-geert@linux-m68k.org> (raw)
In-Reply-To: <1230892892-25751-15-git-send-email-geert@linux-m68k.org>

warning: ignoring return value of 'device_register', declared with attribute
warn_unused_result
warning: ignoring return value of 'device_create_file', declared with
attribute warn_unused_result

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/zorro/zorro-sysfs.c |   22 +++++++++++++---------
 drivers/zorro/zorro.c       |   17 ++++++++++++++---
 drivers/zorro/zorro.h       |    2 +-
 3 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/drivers/zorro/zorro-sysfs.c b/drivers/zorro/zorro-sysfs.c
index 7139ec2..eb924e0 100644
--- a/drivers/zorro/zorro-sysfs.c
+++ b/drivers/zorro/zorro-sysfs.c
@@ -87,18 +87,22 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
 
 static DEVICE_ATTR(modalias, S_IRUGO, modalias_show, NULL);
 
-void zorro_create_sysfs_dev_files(struct zorro_dev *z)
+int zorro_create_sysfs_dev_files(struct zorro_dev *z)
 {
 	struct device *dev = &z->dev;
+	int error;
 
 	/* current configuration's attributes */
-	device_create_file(dev, &dev_attr_id);
-	device_create_file(dev, &dev_attr_type);
-	device_create_file(dev, &dev_attr_serial);
-	device_create_file(dev, &dev_attr_slotaddr);
-	device_create_file(dev, &dev_attr_slotsize);
-	device_create_file(dev, &dev_attr_resource);
-	device_create_file(dev, &dev_attr_modalias);
-	sysfs_create_bin_file(&dev->kobj, &zorro_config_attr);
+	if ((error = device_create_file(dev, &dev_attr_id)) ||
+	    (error = device_create_file(dev, &dev_attr_type)) ||
+	    (error = device_create_file(dev, &dev_attr_serial)) ||
+	    (error = device_create_file(dev, &dev_attr_slotaddr)) ||
+	    (error = device_create_file(dev, &dev_attr_slotsize)) ||
+	    (error = device_create_file(dev, &dev_attr_resource)) ||
+	    (error = device_create_file(dev, &dev_attr_modalias)) ||
+	    (error = sysfs_create_bin_file(&dev->kobj, &zorro_config_attr)))
+		return error;
+
+	return 0;
 }
 
diff --git a/drivers/zorro/zorro.c b/drivers/zorro/zorro.c
index dff16d9..2dda20a 100644
--- a/drivers/zorro/zorro.c
+++ b/drivers/zorro/zorro.c
@@ -130,6 +130,7 @@ static int __init zorro_init(void)
 {
     struct zorro_dev *z;
     unsigned int i;
+    int error;
 
     if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
 	return 0;
@@ -140,7 +141,11 @@ static int __init zorro_init(void)
     /* Initialize the Zorro bus */
     INIT_LIST_HEAD(&zorro_bus.devices);
     strcpy(zorro_bus.dev.bus_id, "zorro");
-    device_register(&zorro_bus.dev);
+    error = device_register(&zorro_bus.dev);
+    if (error) {
+	pr_err("Zorro: Error registering zorro_bus\n");
+	return error;
+    }
 
     /* Request the resources */
     zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
@@ -167,8 +172,14 @@ static int __init zorro_init(void)
 	sprintf(z->dev.bus_id, "%02x", i);
 	z->dev.parent = &zorro_bus.dev;
 	z->dev.bus = &zorro_bus_type;
-	device_register(&z->dev);
-	zorro_create_sysfs_dev_files(z);
+	error = device_register(&z->dev);
+	if (error) {
+	    pr_err("Zorro: Error registering device %s\n", z->name);
+	    continue;
+	}
+	error = zorro_create_sysfs_dev_files(z);
+	if (error)
+	    dev_err(&z->dev, "Error creating sysfs files\n");
     }
 
     /* Mark all available Zorro II memory */
diff --git a/drivers/zorro/zorro.h b/drivers/zorro/zorro.h
index 5c91ada..b682d5c 100644
--- a/drivers/zorro/zorro.h
+++ b/drivers/zorro/zorro.h
@@ -1,4 +1,4 @@
 
 extern void zorro_name_device(struct zorro_dev *z);
-extern void zorro_create_sysfs_dev_files(struct zorro_dev *z);
+extern int zorro_create_sysfs_dev_files(struct zorro_dev *z);
 
-- 
1.5.6.5


  reply	other threads:[~2009-01-02 10:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-02 10:41 [PATCH] m68k: Atari SCC support for ST Geert Uytterhoeven
2009-01-02 10:41 ` [PATCH] m68k: amiga core - kill warn_unused_result warnings Geert Uytterhoeven
2009-01-02 10:41   ` [PATCH] m68k: apollo " Geert Uytterhoeven
2009-01-02 10:41     ` [PATCH] m68k: atari " Geert Uytterhoeven
2009-01-02 10:41       ` [PATCH] m68k: hp300 " Geert Uytterhoeven
2009-01-02 10:41         ` [PATCH] m68k: mac " Geert Uytterhoeven
2009-01-02 10:41           ` [PATCH] m68k: mvme147 " Geert Uytterhoeven
2009-01-02 10:41             ` [PATCH] m68k: sun3 " Geert Uytterhoeven
2009-01-02 10:41               ` [PATCH] m68k: atari_scc " Geert Uytterhoeven
2009-01-02 10:41                 ` [PATCH] m68k: vme_scc " Geert Uytterhoeven
2009-01-02 10:41                   ` [PATCH] m68k: ser_a2232 " Geert Uytterhoeven
2009-01-02 10:41                     ` [PATCH] m68k: scsi " Geert Uytterhoeven
2009-01-02 10:41                       ` [PATCH] m68k: atafb " Geert Uytterhoeven
2009-01-02 10:41                         ` [PATCH] m68k: amiserial " Geert Uytterhoeven
2009-01-02 10:41                           ` [PATCH] m68k: dio " Geert Uytterhoeven
2009-01-02 10:41                             ` Geert Uytterhoeven [this message]
2009-01-02 10:41                               ` [PATCH] m68k: dio - kill resource_size_t format warnings Geert Uytterhoeven
2009-01-02 10:41                                 ` [PATCH] m68k: zorro - use %pR to print resources Geert Uytterhoeven
2009-01-02 10:41                                   ` [PATCH] m68k: dmasound - kill warn_unused_result warnings Geert Uytterhoeven
2009-01-02 10:41                                     ` [PATCH] m68k: atari_scc - kill fake config variables Geert Uytterhoeven

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=1230892892-25751-16-git-send-email-geert@linux-m68k.org \
    --to=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    /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