All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ipmi: bt-bmc: use devm_platform_ioremap_resource() to simplify code
@ 2019-10-16  9:21 YueHaibing
  2019-10-16 14:19 ` Corey Minyard
  0 siblings, 1 reply; 4+ messages in thread
From: YueHaibing @ 2019-10-16  9:21 UTC (permalink / raw)
  To: minyard, arnd, gregkh; +Cc: openipmi-developer, linux-kernel, YueHaibing

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/char/ipmi/bt-bmc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index 40b9927..d36aeac 100644
--- a/drivers/char/ipmi/bt-bmc.c
+++ b/drivers/char/ipmi/bt-bmc.c
@@ -444,15 +444,13 @@ static int bt_bmc_probe(struct platform_device *pdev)
 
 	bt_bmc->map = syscon_node_to_regmap(pdev->dev.parent->of_node);
 	if (IS_ERR(bt_bmc->map)) {
-		struct resource *res;
 		void __iomem *base;
 
 		/*
 		 * Assume it's not the MFD-based devicetree description, in
 		 * which case generate a regmap ourselves
 		 */
-		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		base = devm_ioremap_resource(&pdev->dev, res);
+		base = devm_platform_ioremap_resource(pdev, 0);
 		if (IS_ERR(base))
 			return PTR_ERR(base);
 
-- 
2.7.4



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

* Re: [PATCH -next] ipmi: bt-bmc: use devm_platform_ioremap_resource() to simplify code
  2019-10-16  9:21 [PATCH -next] ipmi: bt-bmc: use devm_platform_ioremap_resource() to simplify code YueHaibing
@ 2019-10-16 14:19 ` Corey Minyard
  2019-10-16 14:41   ` Cédric Le Goater
  0 siblings, 1 reply; 4+ messages in thread
From: Corey Minyard @ 2019-10-16 14:19 UTC (permalink / raw)
  To: YueHaibing
  Cc: arnd, gregkh, openipmi-developer, linux-kernel, Alistair Popple,
	Cédric Le Goater

On Wed, Oct 16, 2019 at 05:21:31PM +0800, YueHaibing wrote:
> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.

Adding the module author and others. I can't see a reason to not do
this.

-corey

> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/char/ipmi/bt-bmc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
> index 40b9927..d36aeac 100644
> --- a/drivers/char/ipmi/bt-bmc.c
> +++ b/drivers/char/ipmi/bt-bmc.c
> @@ -444,15 +444,13 @@ static int bt_bmc_probe(struct platform_device *pdev)
>  
>  	bt_bmc->map = syscon_node_to_regmap(pdev->dev.parent->of_node);
>  	if (IS_ERR(bt_bmc->map)) {
> -		struct resource *res;
>  		void __iomem *base;
>  
>  		/*
>  		 * Assume it's not the MFD-based devicetree description, in
>  		 * which case generate a regmap ourselves
>  		 */
> -		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -		base = devm_ioremap_resource(&pdev->dev, res);
> +		base = devm_platform_ioremap_resource(pdev, 0);
>  		if (IS_ERR(base))
>  			return PTR_ERR(base);
>  
> -- 
> 2.7.4
> 
> 

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

* Re: [PATCH -next] ipmi: bt-bmc: use devm_platform_ioremap_resource() to simplify code
  2019-10-16 14:19 ` Corey Minyard
@ 2019-10-16 14:41   ` Cédric Le Goater
  2019-10-16 15:20     ` Corey Minyard
  0 siblings, 1 reply; 4+ messages in thread
From: Cédric Le Goater @ 2019-10-16 14:41 UTC (permalink / raw)
  To: minyard, YueHaibing
  Cc: arnd, gregkh, openipmi-developer, linux-kernel, Alistair Popple

On 16/10/2019 16:19, Corey Minyard wrote:
> On Wed, Oct 16, 2019 at 05:21:31PM +0800, YueHaibing wrote:
>> Use devm_platform_ioremap_resource() to simplify the code a bit.
>> This is detected by coccinelle.
> 
> Adding the module author and others. I can't see a reason to not do
> this.

yes. Looks good to me.

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> -corey
> 
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>  drivers/char/ipmi/bt-bmc.c | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
>> index 40b9927..d36aeac 100644
>> --- a/drivers/char/ipmi/bt-bmc.c
>> +++ b/drivers/char/ipmi/bt-bmc.c
>> @@ -444,15 +444,13 @@ static int bt_bmc_probe(struct platform_device *pdev)
>>  
>>  	bt_bmc->map = syscon_node_to_regmap(pdev->dev.parent->of_node);
>>  	if (IS_ERR(bt_bmc->map)) {
>> -		struct resource *res;
>>  		void __iomem *base;
>>  
>>  		/*
>>  		 * Assume it's not the MFD-based devicetree description, in
>>  		 * which case generate a regmap ourselves
>>  		 */
>> -		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> -		base = devm_ioremap_resource(&pdev->dev, res);
>> +		base = devm_platform_ioremap_resource(pdev, 0);
>>  		if (IS_ERR(base))
>>  			return PTR_ERR(base);
>>  
>> -- 
>> 2.7.4
>>
>>


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

* Re: [PATCH -next] ipmi: bt-bmc: use devm_platform_ioremap_resource() to simplify code
  2019-10-16 14:41   ` Cédric Le Goater
@ 2019-10-16 15:20     ` Corey Minyard
  0 siblings, 0 replies; 4+ messages in thread
From: Corey Minyard @ 2019-10-16 15:20 UTC (permalink / raw)
  To: Cédric Le Goater
  Cc: YueHaibing, arnd, gregkh, openipmi-developer, linux-kernel,
	Alistair Popple

On Wed, Oct 16, 2019 at 04:41:07PM +0200, Cédric Le Goater wrote:
> On 16/10/2019 16:19, Corey Minyard wrote:
> > On Wed, Oct 16, 2019 at 05:21:31PM +0800, YueHaibing wrote:
> >> Use devm_platform_ioremap_resource() to simplify the code a bit.
> >> This is detected by coccinelle.
> > 
> > Adding the module author and others. I can't see a reason to not do
> > this.
> 
> yes. Looks good to me.
> 
> Reviewed-by: Cédric Le Goater <clg@kaod.org>

Queued for next merge window, unless someone protests.

-corey

> 
> Thanks,
> 
> C.
> 
> > -corey
> > 
> >>
> >> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> >> ---
> >>  drivers/char/ipmi/bt-bmc.c | 4 +---
> >>  1 file changed, 1 insertion(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
> >> index 40b9927..d36aeac 100644
> >> --- a/drivers/char/ipmi/bt-bmc.c
> >> +++ b/drivers/char/ipmi/bt-bmc.c
> >> @@ -444,15 +444,13 @@ static int bt_bmc_probe(struct platform_device *pdev)
> >>  
> >>  	bt_bmc->map = syscon_node_to_regmap(pdev->dev.parent->of_node);
> >>  	if (IS_ERR(bt_bmc->map)) {
> >> -		struct resource *res;
> >>  		void __iomem *base;
> >>  
> >>  		/*
> >>  		 * Assume it's not the MFD-based devicetree description, in
> >>  		 * which case generate a regmap ourselves
> >>  		 */
> >> -		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> >> -		base = devm_ioremap_resource(&pdev->dev, res);
> >> +		base = devm_platform_ioremap_resource(pdev, 0);
> >>  		if (IS_ERR(base))
> >>  			return PTR_ERR(base);
> >>  
> >> -- 
> >> 2.7.4
> >>
> >>
> 

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

end of thread, other threads:[~2019-10-16 15:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16  9:21 [PATCH -next] ipmi: bt-bmc: use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-10-16 14:19 ` Corey Minyard
2019-10-16 14:41   ` Cédric Le Goater
2019-10-16 15:20     ` Corey Minyard

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.