aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm/lightnvm.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-09-16 14:25:09 +0200
committerJens Axboe <axboe@fb.com>2016-09-21 07:57:32 -0600
commit1e3aeae4ea710023dda2a6b780183ee371d1a796 (patch)
treefef9caecf2ae190102f2c2c9a5b8e49d111d3a8f /drivers/lightnvm/lightnvm.h
parentlightnvm: expose device geometry through sysfs (diff)
downloadlinux-dev-1e3aeae4ea710023dda2a6b780183ee371d1a796.tar.xz
linux-dev-1e3aeae4ea710023dda2a6b780183ee371d1a796.zip
lightnvm: propagate device_add() error code
device_add() may fail, and all callers are supposed to check the return value, but one new user in lightnvm doesn't: drivers/lightnvm/sysfs.c: In function 'nvm_sysfs_register_dev': drivers/lightnvm/sysfs.c:184:2: error: ignoring return value of 'device_add', declared with attribute warn_unused_result [-Werror=unused-result] This changes the caller to propagate any error codes, which avoids the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 38c9e260b9f9 ("lightnvm: expose device geometry through sysfs") Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm/lightnvm.h')
-rw-r--r--drivers/lightnvm/lightnvm.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/lightnvm/lightnvm.h b/drivers/lightnvm/lightnvm.h
index 93f1aacc9f02..305c181509a6 100644
--- a/drivers/lightnvm/lightnvm.h
+++ b/drivers/lightnvm/lightnvm.h
@@ -24,7 +24,7 @@
#include <linux/lightnvm.h>
/* core -> sysfs.c */
-int nvm_sysfs_register_dev(struct nvm_dev *);
+int __must_check nvm_sysfs_register_dev(struct nvm_dev *);
void nvm_sysfs_unregister_dev(struct nvm_dev *);
int nvm_sysfs_register(void);
void nvm_sysfs_unregister(void);