Commit 2e4c77bea3d8b17d94f8ee382411f359b708560f
1 parent
639274d810
Exists in
master
and in
7 other branches
m68k: dio - 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: Geert Uytterhoeven <geert@linux-m68k.org>
Showing 3 changed files with 26 additions and 10 deletions Side-by-side Diff
drivers/dio/dio-sysfs.c
... | ... | @@ -63,15 +63,19 @@ |
63 | 63 | } |
64 | 64 | static DEVICE_ATTR(resource, S_IRUGO, dio_show_resource, NULL); |
65 | 65 | |
66 | -void dio_create_sysfs_dev_files(struct dio_dev *d) | |
66 | +int dio_create_sysfs_dev_files(struct dio_dev *d) | |
67 | 67 | { |
68 | 68 | struct device *dev = &d->dev; |
69 | + int error; | |
69 | 70 | |
70 | 71 | /* current configuration's attributes */ |
71 | - device_create_file(dev, &dev_attr_id); | |
72 | - device_create_file(dev, &dev_attr_ipl); | |
73 | - device_create_file(dev, &dev_attr_secid); | |
74 | - device_create_file(dev, &dev_attr_name); | |
75 | - device_create_file(dev, &dev_attr_resource); | |
72 | + if ((error = device_create_file(dev, &dev_attr_id)) || | |
73 | + (error = device_create_file(dev, &dev_attr_ipl)) || | |
74 | + (error = device_create_file(dev, &dev_attr_secid)) || | |
75 | + (error = device_create_file(dev, &dev_attr_name)) || | |
76 | + (error = device_create_file(dev, &dev_attr_resource))) | |
77 | + return error; | |
78 | + | |
79 | + return 0; | |
76 | 80 | } |
drivers/dio/dio.c
... | ... | @@ -173,6 +173,7 @@ |
173 | 173 | mm_segment_t fs; |
174 | 174 | int i; |
175 | 175 | struct dio_dev *dev; |
176 | + int error; | |
176 | 177 | |
177 | 178 | if (!MACH_IS_HP300) |
178 | 179 | return 0; |
... | ... | @@ -182,7 +183,11 @@ |
182 | 183 | /* Initialize the DIO bus */ |
183 | 184 | INIT_LIST_HEAD(&dio_bus.devices); |
184 | 185 | strcpy(dio_bus.dev.bus_id, "dio"); |
185 | - device_register(&dio_bus.dev); | |
186 | + error = device_register(&dio_bus.dev); | |
187 | + if (error) { | |
188 | + pr_err("DIO: Error registering dio_bus\n"); | |
189 | + return error; | |
190 | + } | |
186 | 191 | |
187 | 192 | /* Request all resources */ |
188 | 193 | dio_bus.num_resources = (hp300_model == HP_320 ? 1 : 2); |
... | ... | @@ -252,8 +257,15 @@ |
252 | 257 | |
253 | 258 | if (scode >= DIOII_SCBASE) |
254 | 259 | iounmap(va); |
255 | - device_register(&dev->dev); | |
256 | - dio_create_sysfs_dev_files(dev); | |
260 | + error = device_register(&dev->dev); | |
261 | + if (error) { | |
262 | + pr_err("DIO: Error registering device %s\n", | |
263 | + dev->name); | |
264 | + continue; | |
265 | + } | |
266 | + error = dio_create_sysfs_dev_files(dev); | |
267 | + if (error) | |
268 | + dev_err(&dev->dev, "Error creating sysfs files\n"); | |
257 | 269 | } |
258 | 270 | return 0; |
259 | 271 | } |
include/linux/dio.h
... | ... | @@ -241,7 +241,7 @@ |
241 | 241 | |
242 | 242 | extern int dio_find(int deviceid); |
243 | 243 | extern unsigned long dio_scodetophysaddr(int scode); |
244 | -extern void dio_create_sysfs_dev_files(struct dio_dev *); | |
244 | +extern int dio_create_sysfs_dev_files(struct dio_dev *); | |
245 | 245 | |
246 | 246 | /* New-style probing */ |
247 | 247 | extern int dio_register_driver(struct dio_driver *); |