diff mbox series

[-next] block/swim: remove unnecessary check of res

Message ID 20230809061639.1040093-1-yangyingliang@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] block/swim: remove unnecessary check of res | expand

Commit Message

Yang Yingliang Aug. 9, 2023, 6:16 a.m. UTC
The resource is checked in probe function, so there is
no need do this check in remove function.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/block/swim.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/block/swim.c b/drivers/block/swim.c
index f85b6af414b4..6f7b5e15fd6d 100644
--- a/drivers/block/swim.c
+++ b/drivers/block/swim.c
@@ -933,8 +933,7 @@  static int swim_remove(struct platform_device *dev)
 		floppy_eject(&swd->unit[drive]);
 
 	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
-	if (res)
-		release_mem_region(res->start, resource_size(res));
+	release_mem_region(res->start, resource_size(res));
 
 	kfree(swd);