kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: gadget: s3c: Fix incorrect resources releasing
@ 2021-02-21  7:41 Christophe JAILLET
  2021-02-22  6:03 ` Dan Carpenter
  2021-03-05 10:05 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe JAILLET @ 2021-02-21  7:41 UTC (permalink / raw)
  To: balbi, gregkh, krzk, nathan, ndesaulniers, arnd, gustavoars,
	linux-arm-kernel
  Cc: linux-usb, linux-samsung-soc, linux-kernel, kernel-janitors,
	Christophe JAILLET

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
function.

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

Fixes: fe0f8e5c9ba8 ("usb: gadget: s3c: use platform resources")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
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 https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/usb/gadget/udc/s3c2410_udc.c?id=188db4435ac64f0918def7ba0593d408700ecc4b
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)
 		gpio_free(udc_info->vbus_pin);
 err_int:
 	free_irq(irq_usbd, udc);
-err_map:
-	iounmap(base_addr);
-err_mem:
-	release_mem_region(rsrc_start, rsrc_len);
+err:
 
 	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) {
 		clk_disable_unprepare(udc_clock);
 		clk_put(udc_clock);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] usb: gadget: s3c: Fix incorrect resources releasing
  2021-02-21  7:41 [PATCH 1/2] usb: gadget: s3c: Fix incorrect resources releasing Christophe JAILLET
@ 2021-02-22  6:03 ` Dan Carpenter
  2021-02-23 21:27   ` Christophe JAILLET
  2021-03-05 10:05 ` Krzysztof Kozlowski
  1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2021-02-22  6:03 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: balbi, gregkh, krzk, nathan, ndesaulniers, arnd, gustavoars,
	linux-arm-kernel, linux-usb, linux-samsung-soc, linux-kernel,
	kernel-janitors

On Sun, Feb 21, 2021 at 08:41:17AM +0100, Christophe JAILLET wrote:
> Since commit fe0f8e5c9ba8 ("usb: gadget: s3c: use platform resources"),

This the wrong hash.  It should be 188db4435ac6 from the URL you posted
below.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] usb: gadget: s3c: Fix incorrect resources releasing
  2021-02-22  6:03 ` Dan Carpenter
@ 2021-02-23 21:27   ` Christophe JAILLET
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2021-02-23 21:27 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: balbi, gregkh, krzk, nathan, ndesaulniers, arnd, gustavoars,
	linux-arm-kernel, linux-usb, linux-samsung-soc, linux-kernel,
	kernel-janitors

Le 22/02/2021 à 07:03, Dan Carpenter a écrit :
> On Sun, Feb 21, 2021 at 08:41:17AM +0100, Christophe JAILLET wrote:
>> Since commit fe0f8e5c9ba8 ("usb: gadget: s3c: use platform resources"),
> 
> This the wrong hash.  It should be 188db4435ac6 from the URL you posted
> below.
> 
> regards,
> dan carpenter
> 
> 
Ouch!

Thx for spotting this so stupid and so trivial little error!
I'll send a v2 when -rc1 is out.

CJ

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] usb: gadget: s3c: Fix incorrect resources releasing
  2021-02-21  7:41 [PATCH 1/2] usb: gadget: s3c: Fix incorrect resources releasing Christophe JAILLET
  2021-02-22  6:03 ` Dan Carpenter
@ 2021-03-05 10:05 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2021-03-05 10:05 UTC (permalink / raw)
  To: Christophe JAILLET, balbi, gregkh, nathan, ndesaulniers, arnd,
	gustavoars, linux-arm-kernel
  Cc: linux-usb, linux-samsung-soc, linux-kernel, kernel-janitors

On 21/02/2021 08:41, Christophe JAILLET wrote:
> 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

s/removre/remove/

> function.
> 
> Remove these calls and the unneeded 'rsrc_start' and 'rsrc_len' global
> variables.
> 
> Fixes: fe0f8e5c9ba8 ("usb: gadget: s3c: use platform resources")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> 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 https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/usb/gadget/udc/s3c2410_udc.c?id=188db4435ac64f0918def7ba0593d408700ecc4b
> 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(-)

With fixing of commit sha:
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-05 10:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-21  7:41 [PATCH 1/2] usb: gadget: s3c: Fix incorrect resources releasing Christophe JAILLET
2021-02-22  6:03 ` Dan Carpenter
2021-02-23 21:27   ` Christophe JAILLET
2021-03-05 10:05 ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).