summaryrefslogtreecommitdiff
path: root/block/blk-sysfs.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-10-08 07:08:41 +0200
committerJens Axboe <axboe@kernel.dk>2024-10-22 08:16:22 -0600
commitd51c9cdfc214dde98afe45d95f7fb3b4ad11aa9e (patch)
tree775fc242bda2078bfa9a1a0b7ce414c1fe682d85 /block/blk-sysfs.c
parent758737d86f8a2d74c0fa9f8b2523fa7fd1e0d0aa (diff)
downloadlinux-d51c9cdfc214dde98afe45d95f7fb3b4ad11aa9e.tar.gz
linux-d51c9cdfc214dde98afe45d95f7fb3b4ad11aa9e.tar.bz2
linux-d51c9cdfc214dde98afe45d95f7fb3b4ad11aa9e.zip
block: return void from the queue_sysfs_entry load_module method
Requesting a module either succeeds or does nothing, return an error from this method does not make sense. Also move the load_module after the store method in the struct declaration to keep the important show and store methods together. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org> Link: https://lore.kernel.org/r/20241008050841.104602-1-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r--block/blk-sysfs.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index e85941bec857..8717d43e0792 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -23,8 +23,8 @@
struct queue_sysfs_entry {
struct attribute attr;
ssize_t (*show)(struct gendisk *disk, char *page);
- int (*load_module)(struct gendisk *disk, const char *page, size_t count);
ssize_t (*store)(struct gendisk *disk, const char *page, size_t count);
+ void (*load_module)(struct gendisk *disk, const char *page, size_t count);
};
static ssize_t
@@ -684,11 +684,8 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr,
* queue to ensure that the module file can be read when the request
* queue is the one for the device storing the module file.
*/
- if (entry->load_module) {
- res = entry->load_module(disk, page, length);
- if (res)
- return res;
- }
+ if (entry->load_module)
+ entry->load_module(disk, page, length);
blk_mq_freeze_queue(q);
mutex_lock(&q->sysfs_lock);