[lkml]   [2021]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 1/2] usb: gadget: s3c: Fix incorrect resources releasing
Since commit fe0f8e5c9ba8 ("usb: gadget: s3c: use platform resources"),
'request_mem_region()' and 'ioremap()' are no more used, so they don't need
to be undone in the error handling path of the probe and in the removre

Remove these calls and the unneeded 'rsrc_start' and 'rsrc_len' global

Fixes: fe0f8e5c9ba8 ("usb: gadget: s3c: use platform resources")
Signed-off-by: Christophe JAILLET <>
the 'err' label is used only to reduce the diff size of this patch. It is
removed in the following patch.

checkpatch reports:
WARNING: Unknown commit id 'fe0f8e5c9ba8', maybe rebased or not pulled?
According to
the commit ID looks correct to me. Maybe something should be tweaked somewhere
before applying, but I don't know what!
drivers/usb/gadget/udc/s3c2410_udc.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c
index f1ea51476add..3fc436286bad 100644
--- a/drivers/usb/gadget/udc/s3c2410_udc.c
+++ b/drivers/usb/gadget/udc/s3c2410_udc.c
@@ -54,8 +54,6 @@ static struct clk *udc_clock;
static struct clk *usb_bus_clock;
static void __iomem *base_addr;
static int irq_usbd;
-static u64 rsrc_start;
-static u64 rsrc_len;
static struct dentry *s3c2410_udc_debugfs_root;

static inline u32 udc_read(u32 reg)
@@ -1775,7 +1773,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
base_addr = devm_platform_ioremap_resource(pdev, 0);
if (!base_addr) {
retval = -ENOMEM;
- goto err_mem;
+ goto err;

the_controller = udc;
@@ -1793,7 +1791,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
if (retval != 0) {
dev_err(dev, "cannot get irq %i, err %d\n", irq_usbd, retval);
retval = -EBUSY;
- goto err_map;
+ goto err;

dev_dbg(dev, "got irq %i\n", irq_usbd);
@@ -1864,10 +1862,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
free_irq(irq_usbd, udc);
- iounmap(base_addr);
- release_mem_region(rsrc_start, rsrc_len);

return retval;
@@ -1899,9 +1894,6 @@ static int s3c2410_udc_remove(struct platform_device *pdev)

free_irq(irq_usbd, udc);

- iounmap(base_addr);
- release_mem_region(rsrc_start, rsrc_len);
if (!IS_ERR(udc_clock) && udc_clock != NULL) {
 \ /
  Last update: 2021-02-21 08:44    [W:0.059 / U:12.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site