Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91739
b: refs/heads/master
c: fb19974
h: refs/heads/master
i:
  91737: 30b7ad9
  91735: cb5f648
v: v3
  • Loading branch information
Akinobu Mita authored and Jens Axboe committed Apr 21, 2008
1 parent a14a409 commit a544eba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2472892a3ce17b177cc0d8099a6391949c75abf2
refs/heads/master: fb199746303a6bfd6121834ec9e810471185c530
10 changes: 8 additions & 2 deletions trunk/block/blk-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,12 @@ int blk_register_queue(struct gendisk *disk)

struct request_queue *q = disk->queue;

if (!q || !q->request_fn)
if (WARN_ON(!q))
return -ENXIO;

if (!q->request_fn)
return 0;

ret = kobject_add(&q->kobj, kobject_get(&disk->dev.kobj),
"%s", "queue");
if (ret < 0)
Expand All @@ -300,7 +303,10 @@ void blk_unregister_queue(struct gendisk *disk)
{
struct request_queue *q = disk->queue;

if (q && q->request_fn) {
if (WARN_ON(!q))
return;

if (q->request_fn) {
elv_unregister_queue(q);

kobject_uevent(&q->kobj, KOBJ_REMOVE);
Expand Down

0 comments on commit a544eba

Please sign in to comment.