Message ID | 20230816073432.221665-1-ruanjinjie@huawei.com |
---|---|
State | New |
Headers | show |
Series | [-next] usb: isp116x-hcd: Remove unnecessary check of res | expand |
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index a82d8926e922..c95a9b004412 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c @@ -1540,12 +1540,10 @@ static void isp116x_remove(struct platform_device *pdev) iounmap(isp116x->data_reg); res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - if (res) - release_mem_region(res->start, 2); + release_mem_region(res->start, 2); iounmap(isp116x->addr_reg); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res) - release_mem_region(res->start, 2); + release_mem_region(res->start, 2); usb_put_hcd(hcd); }
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/usb/host/isp116x-hcd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)