diff mbox series

watchdog: bcm_kona_wdt: Use correct return value for bcm_kona_wdt_probe()

Message ID 1590391864-308-1-git-send-email-yangtiezhu@loongson.cn (mailing list archive)
State Accepted
Headers show
Series watchdog: bcm_kona_wdt: Use correct return value for bcm_kona_wdt_probe() | expand

Commit Message

Tiezhu Yang May 25, 2020, 7:31 a.m. UTC
When call function devm_platform_ioremap_resource(), we should use IS_ERR()
to check the return value and return PTR_ERR() if failed.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/watchdog/bcm_kona_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck May 25, 2020, 1:47 p.m. UTC | #1
On 5/25/20 12:31 AM, Tiezhu Yang wrote:
> When call function devm_platform_ioremap_resource(), we should use IS_ERR()
> to check the return value and return PTR_ERR() if failed.
> 
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/bcm_kona_wdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c
> index eb850a8..8237c4e 100644
> --- a/drivers/watchdog/bcm_kona_wdt.c
> +++ b/drivers/watchdog/bcm_kona_wdt.c
> @@ -279,7 +279,7 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev)
>  
>  	wdt->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(wdt->base))
> -		return -ENODEV;
> +		return PTR_ERR(wdt->base);
>  
>  	wdt->resolution = SECWDOG_DEFAULT_RESOLUTION;
>  	ret = bcm_kona_wdt_set_resolution_reg(wdt);
>
Tiezhu Yang July 6, 2020, 8:56 a.m. UTC | #2
On 05/25/2020 09:47 PM, Guenter Roeck wrote:
> On 5/25/20 12:31 AM, Tiezhu Yang wrote:
>> When call function devm_platform_ioremap_resource(), we should use IS_ERR()
>> to check the return value and return PTR_ERR() if failed.
>>
>> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Hi,

Could you please apply this patch?

Thanks,
Tiezhu

>
>> ---
>>   drivers/watchdog/bcm_kona_wdt.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c
>> index eb850a8..8237c4e 100644
>> --- a/drivers/watchdog/bcm_kona_wdt.c
>> +++ b/drivers/watchdog/bcm_kona_wdt.c
>> @@ -279,7 +279,7 @@ static int bcm_kona_wdt_probe(struct platform_device *pdev)
>>   
>>   	wdt->base = devm_platform_ioremap_resource(pdev, 0);
>>   	if (IS_ERR(wdt->base))
>> -		return -ENODEV;
>> +		return PTR_ERR(wdt->base);
>>   
>>   	wdt->resolution = SECWDOG_DEFAULT_RESOLUTION;
>>   	ret = bcm_kona_wdt_set_resolution_reg(wdt);
>>
diff mbox series

Patch

diff --git a/drivers/watchdog/bcm_kona_wdt.c b/drivers/watchdog/bcm_kona_wdt.c
index eb850a8..8237c4e 100644
--- a/drivers/watchdog/bcm_kona_wdt.c
+++ b/drivers/watchdog/bcm_kona_wdt.c
@@ -279,7 +279,7 @@  static int bcm_kona_wdt_probe(struct platform_device *pdev)
 
 	wdt->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(wdt->base))
-		return -ENODEV;
+		return PTR_ERR(wdt->base);
 
 	wdt->resolution = SECWDOG_DEFAULT_RESOLUTION;
 	ret = bcm_kona_wdt_set_resolution_reg(wdt);