diff mbox series

[-next] swim: Remove unnecessary check of res

Message ID 20230816073745.226425-1-ruanjinjie@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] swim: Remove unnecessary check of res | expand

Commit Message

Jinjie Ruan Aug. 16, 2023, 7:37 a.m. UTC
The resource is checked in probe function, so there is
no need do this check in remove function.

Signed-off-by: Ruan Jinjie <ruanjinjie@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);