linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] MIPS: OCTEON: fix error - use 'ret' after remove it
@ 2020-09-24  6:41 Qinglang Miao
  2020-09-24  8:16 ` Sergei Shtylyov
  2020-09-24  8:20 ` Thomas Bogendoerfer
  0 siblings, 2 replies; 3+ messages in thread
From: Qinglang Miao @ 2020-09-24  6:41 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel, Qinglang Miao

Variable ret was removed in commit 0ee69c589ec("MIPS: OCTEON:
use devm_platform_ioremap_resource") but still being used in
devm_release_mem_region which is unneeded. So remove this
line to fix error.

Fixes: 0ee69c589ec("MIPS: OCTEON: use devm_platform_ioremap_resource")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 arch/mips/cavium-octeon/octeon-usb.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c
index 97f6dc31e1b4..987a94cbf3d0 100644
--- a/arch/mips/cavium-octeon/octeon-usb.c
+++ b/arch/mips/cavium-octeon/octeon-usb.c
@@ -534,8 +534,6 @@ static int __init dwc3_octeon_device_init(void)
 			dev_info(&pdev->dev, "clocks initialized.\n");
 			mutex_unlock(&dwc3_octeon_clocks_mutex);
 			devm_iounmap(&pdev->dev, base);
-			devm_release_mem_region(&pdev->dev, res->start,
-						resource_size(res));
 		}
 	} while (node != NULL);
 
-- 
2.23.0


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

* Re: [PATCH -next] MIPS: OCTEON: fix error - use 'ret' after remove it
  2020-09-24  6:41 [PATCH -next] MIPS: OCTEON: fix error - use 'ret' after remove it Qinglang Miao
@ 2020-09-24  8:16 ` Sergei Shtylyov
  2020-09-24  8:20 ` Thomas Bogendoerfer
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2020-09-24  8:16 UTC (permalink / raw)
  To: Qinglang Miao, Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel

Hello!

On 24.09.2020 9:41, Qinglang Miao wrote:

> Variable ret was removed in commit 0ee69c589ec("MIPS: OCTEON:

    I'm only seeing the variable 'res' below...

> use devm_platform_ioremap_resource") but still being used in
> devm_release_mem_region which is unneeded. So remove this
> line to fix error.
> 
> Fixes: 0ee69c589ec("MIPS: OCTEON: use devm_platform_ioremap_resource")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> ---
>   arch/mips/cavium-octeon/octeon-usb.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c
> index 97f6dc31e1b4..987a94cbf3d0 100644
> --- a/arch/mips/cavium-octeon/octeon-usb.c
> +++ b/arch/mips/cavium-octeon/octeon-usb.c
> @@ -534,8 +534,6 @@ static int __init dwc3_octeon_device_init(void)
>   			dev_info(&pdev->dev, "clocks initialized.\n");
>   			mutex_unlock(&dwc3_octeon_clocks_mutex);
>   			devm_iounmap(&pdev->dev, base);
> -			devm_release_mem_region(&pdev->dev, res->start,
> -						resource_size(res));
>   		}
>   	} while (node != NULL);
>   

MBR, Sergei

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

* Re: [PATCH -next] MIPS: OCTEON: fix error - use 'ret' after remove it
  2020-09-24  6:41 [PATCH -next] MIPS: OCTEON: fix error - use 'ret' after remove it Qinglang Miao
  2020-09-24  8:16 ` Sergei Shtylyov
@ 2020-09-24  8:20 ` Thomas Bogendoerfer
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2020-09-24  8:20 UTC (permalink / raw)
  To: Qinglang Miao; +Cc: linux-mips, linux-kernel

On Thu, Sep 24, 2020 at 02:41:42PM +0800, Qinglang Miao wrote:
> Variable ret was removed in commit 0ee69c589ec("MIPS: OCTEON:
> use devm_platform_ioremap_resource") but still being used in
> devm_release_mem_region which is unneeded. So remove this
> line to fix error.
> 
> Fixes: 0ee69c589ec("MIPS: OCTEON: use devm_platform_ioremap_resource")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
> ---
>  arch/mips/cavium-octeon/octeon-usb.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c
> index 97f6dc31e1b4..987a94cbf3d0 100644
> --- a/arch/mips/cavium-octeon/octeon-usb.c
> +++ b/arch/mips/cavium-octeon/octeon-usb.c
> @@ -534,8 +534,6 @@ static int __init dwc3_octeon_device_init(void)
>  			dev_info(&pdev->dev, "clocks initialized.\n");
>  			mutex_unlock(&dwc3_octeon_clocks_mutex);
>  			devm_iounmap(&pdev->dev, base);
> -			devm_release_mem_region(&pdev->dev, res->start,
> -						resource_size(res));
>  		}
>  	} while (node != NULL);

I've reverted the orginal fix as IMHO the whole change is wrong.
The code maps/unmaps the io region to setup clocks and phy and
releases everything so the real driver can pick it up later.
The devm_release_mem_region is important and since the device
continues to exists, there is not auto-cleanup.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2020-09-24  8:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-24  6:41 [PATCH -next] MIPS: OCTEON: fix error - use 'ret' after remove it Qinglang Miao
2020-09-24  8:16 ` Sergei Shtylyov
2020-09-24  8:20 ` Thomas Bogendoerfer

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