diff options
-rw-r--r-- | drivers/zorro/zorro-sysfs.c | 20 | ||||
-rw-r--r-- | drivers/zorro/zorro.c | 17 | ||||
-rw-r--r-- | drivers/zorro/zorro.h | 2 |
3 files changed, 27 insertions, 12 deletions
diff --git a/drivers/zorro/zorro-sysfs.c b/drivers/zorro/zorro-sysfs.c index 5290552d2ef7..1d2a772ea14c 100644 --- a/drivers/zorro/zorro-sysfs.c +++ b/drivers/zorro/zorro-sysfs.c | |||
@@ -77,17 +77,21 @@ static struct bin_attribute zorro_config_attr = { | |||
77 | .read = zorro_read_config, | 77 | .read = zorro_read_config, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | void zorro_create_sysfs_dev_files(struct zorro_dev *z) | 80 | int zorro_create_sysfs_dev_files(struct zorro_dev *z) |
81 | { | 81 | { |
82 | struct device *dev = &z->dev; | 82 | struct device *dev = &z->dev; |
83 | int error; | ||
83 | 84 | ||
84 | /* current configuration's attributes */ | 85 | /* current configuration's attributes */ |
85 | device_create_file(dev, &dev_attr_id); | 86 | if ((error = device_create_file(dev, &dev_attr_id)) || |
86 | device_create_file(dev, &dev_attr_type); | 87 | (error = device_create_file(dev, &dev_attr_type)) || |
87 | device_create_file(dev, &dev_attr_serial); | 88 | (error = device_create_file(dev, &dev_attr_serial)) || |
88 | device_create_file(dev, &dev_attr_slotaddr); | 89 | (error = device_create_file(dev, &dev_attr_slotaddr)) || |
89 | device_create_file(dev, &dev_attr_slotsize); | 90 | (error = device_create_file(dev, &dev_attr_slotsize)) || |
90 | device_create_file(dev, &dev_attr_resource); | 91 | (error = device_create_file(dev, &dev_attr_resource)) || |
91 | sysfs_create_bin_file(&dev->kobj, &zorro_config_attr); | 92 | (error = sysfs_create_bin_file(&dev->kobj, &zorro_config_attr))) |
93 | return error; | ||
94 | |||
95 | return 0; | ||
92 | } | 96 | } |
93 | 97 | ||
diff --git a/drivers/zorro/zorro.c b/drivers/zorro/zorro.c index dff16d9767d8..2dda20ac6b36 100644 --- a/drivers/zorro/zorro.c +++ b/drivers/zorro/zorro.c | |||
@@ -130,6 +130,7 @@ static int __init zorro_init(void) | |||
130 | { | 130 | { |
131 | struct zorro_dev *z; | 131 | struct zorro_dev *z; |
132 | unsigned int i; | 132 | unsigned int i; |
133 | int error; | ||
133 | 134 | ||
134 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) | 135 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) |
135 | return 0; | 136 | return 0; |
@@ -140,7 +141,11 @@ static int __init zorro_init(void) | |||
140 | /* Initialize the Zorro bus */ | 141 | /* Initialize the Zorro bus */ |
141 | INIT_LIST_HEAD(&zorro_bus.devices); | 142 | INIT_LIST_HEAD(&zorro_bus.devices); |
142 | strcpy(zorro_bus.dev.bus_id, "zorro"); | 143 | strcpy(zorro_bus.dev.bus_id, "zorro"); |
143 | device_register(&zorro_bus.dev); | 144 | error = device_register(&zorro_bus.dev); |
145 | if (error) { | ||
146 | pr_err("Zorro: Error registering zorro_bus\n"); | ||
147 | return error; | ||
148 | } | ||
144 | 149 | ||
145 | /* Request the resources */ | 150 | /* Request the resources */ |
146 | zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2; | 151 | zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2; |
@@ -167,8 +172,14 @@ static int __init zorro_init(void) | |||
167 | sprintf(z->dev.bus_id, "%02x", i); | 172 | sprintf(z->dev.bus_id, "%02x", i); |
168 | z->dev.parent = &zorro_bus.dev; | 173 | z->dev.parent = &zorro_bus.dev; |
169 | z->dev.bus = &zorro_bus_type; | 174 | z->dev.bus = &zorro_bus_type; |
170 | device_register(&z->dev); | 175 | error = device_register(&z->dev); |
171 | zorro_create_sysfs_dev_files(z); | 176 | if (error) { |
177 | pr_err("Zorro: Error registering device %s\n", z->name); | ||
178 | continue; | ||
179 | } | ||
180 | error = zorro_create_sysfs_dev_files(z); | ||
181 | if (error) | ||
182 | dev_err(&z->dev, "Error creating sysfs files\n"); | ||
172 | } | 183 | } |
173 | 184 | ||
174 | /* Mark all available Zorro II memory */ | 185 | /* Mark all available Zorro II memory */ |
diff --git a/drivers/zorro/zorro.h b/drivers/zorro/zorro.h index 5c91adac4df1..b682d5ccd63f 100644 --- a/drivers/zorro/zorro.h +++ b/drivers/zorro/zorro.h | |||
@@ -1,4 +1,4 @@ | |||
1 | 1 | ||
2 | extern void zorro_name_device(struct zorro_dev *z); | 2 | extern void zorro_name_device(struct zorro_dev *z); |
3 | extern void zorro_create_sysfs_dev_files(struct zorro_dev *z); | 3 | extern int zorro_create_sysfs_dev_files(struct zorro_dev *z); |
4 | 4 | ||