All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ruan Jinjie <ruanjinjie@huawei.com>
To: <linux-usb@vger.kernel.org>, Olav Kongas <ok@artecdesign.ee>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <ruanjinjie@huawei.com>
Subject: [PATCH -next] usb: isp116x-hcd: Remove unnecessary check of res
Date: Wed, 16 Aug 2023 15:34:32 +0800	[thread overview]
Message-ID: <20230816073432.221665-1-ruanjinjie@huawei.com> (raw)

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(-)

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);
 }
-- 
2.34.1


             reply	other threads:[~2023-08-16  7:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16  7:34 Ruan Jinjie [this message]
2023-08-16 14:46 ` [PATCH -next] usb: isp116x-hcd: Remove unnecessary check of res Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230816073432.221665-1-ruanjinjie@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ok@artecdesign.ee \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.