Skip to content

Commit

Permalink
USB: c67x00: remove unnecessary check of res
Browse files Browse the repository at this point in the history
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>
Link: https://lore.kernel.org/r/20220510112804.2401150-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Yang Yingliang authored and Greg Kroah-Hartman committed May 12, 2022
1 parent 84db2ee commit b92d8a6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/usb/c67x00/c67x00-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,12 @@ static int c67x00_drv_remove(struct platform_device *pdev)
c67x00_ll_release(c67x00);

res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res)
free_irq(res->start, c67x00);
free_irq(res->start, c67x00);

iounmap(c67x00->hpi.base);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res)
release_mem_region(res->start, resource_size(res));
release_mem_region(res->start, resource_size(res));

kfree(c67x00);

Expand Down

0 comments on commit b92d8a6

Please sign in to comment.