diff options
author | Mark Brown <broonie@kernel.org> | 2019-04-02 12:20:47 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-04-02 12:20:47 +0300 |
commit | 6d5e2bf9d203e4d9e08ca2e9420c6ff22ad190af (patch) | |
tree | c2c20648773d3326f942e34ef73b06566f7a19ec /drivers/block/paride/pf.c | |
parent | b820d52e7eed7b30b2dfef5f4213a2bc3cbea6f3 (diff) | |
parent | 257f9053c0204ea47491aa236004fd1226f75fa8 (diff) | |
download | linux-6d5e2bf9d203e4d9e08ca2e9420c6ff22ad190af.tar.xz |
Merge branch 'acpi-utils' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm into asoc-5.2
Diffstat (limited to 'drivers/block/paride/pf.c')
-rw-r--r-- | drivers/block/paride/pf.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index e92e7a8eeeb2..103b617cdc31 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c @@ -761,8 +761,12 @@ static int pf_detect(void) return 0; printk("%s: No ATAPI disk detected\n", name); - for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) + for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { + blk_cleanup_queue(pf->disk->queue); + pf->disk->queue = NULL; + blk_mq_free_tag_set(&pf->tag_set); put_disk(pf->disk); + } pi_unregister_driver(par_drv); return -1; } @@ -1047,13 +1051,15 @@ static void __exit pf_exit(void) int unit; unregister_blkdev(major, name); for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { - if (!pf->present) - continue; - del_gendisk(pf->disk); + if (pf->present) + del_gendisk(pf->disk); + blk_cleanup_queue(pf->disk->queue); blk_mq_free_tag_set(&pf->tag_set); put_disk(pf->disk); - pi_release(pf->pi); + + if (pf->present) + pi_release(pf->pi); } } |