diff mbox series

[-next] USB: ohci-sm501: remove unnecessary check of mem

Message ID 20230809085348.2761782-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit 3ddde5aa43cf302aa8ac6d4d5fa6166a09bb0a00
Headers show
Series [-next] USB: ohci-sm501: remove unnecessary check of mem | expand

Commit Message

Yang Yingliang Aug. 9, 2023, 8:53 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/usb/host/ohci-sm501.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Alan Stern Aug. 9, 2023, 2:11 p.m. UTC | #1
On Wed, Aug 09, 2023 at 04:53:48PM +0800, Yang Yingliang wrote:
> 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/usb/host/ohci-sm501.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
> index 0468eeb4fcfd..4b39e9d6f33a 100644
> --- a/drivers/usb/host/ohci-sm501.c
> +++ b/drivers/usb/host/ohci-sm501.c
> @@ -195,8 +195,7 @@ static void ohci_hcd_sm501_drv_remove(struct platform_device *pdev)
>  	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
>  	usb_put_hcd(hcd);
>  	mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> -	if (mem)
> -		release_mem_region(mem->start, resource_size(mem));
> +	release_mem_region(mem->start, resource_size(mem));
>  
>  	/* mask interrupts and disable power */

Acked-by: Alan Stern <stern@rowland.harvard.edu>
diff mbox series

Patch

diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
index 0468eeb4fcfd..4b39e9d6f33a 100644
--- a/drivers/usb/host/ohci-sm501.c
+++ b/drivers/usb/host/ohci-sm501.c
@@ -195,8 +195,7 @@  static void ohci_hcd_sm501_drv_remove(struct platform_device *pdev)
 	release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
 	usb_put_hcd(hcd);
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	if (mem)
-		release_mem_region(mem->start, resource_size(mem));
+	release_mem_region(mem->start, resource_size(mem));
 
 	/* mask interrupts and disable power */