Commit 11a8b2c5 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven

m68k: zorro - Kill warn_unused_result warnings

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: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent 2e4c77be
......@@ -77,17 +77,21 @@ static struct bin_attribute zorro_config_attr = {
.read = zorro_read_config,
};
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);
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 = sysfs_create_bin_file(&dev->kobj, &zorro_config_attr)))
return error;
return 0;
}
......@@ -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 */
......
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);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment