lkml.org 
[lkml]   [2019]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mtd: st_spi_fsm: Use devm_platform_ioremap_resource() in stfsm_probe()
From
Date
>> +++ b/drivers/mtd/devices/st_spi_fsm.c
>> @@ -2034,13 +2034,7 @@ static int stfsm_probe(struct platform_device *pdev)
>>
>> platform_set_drvdata(pdev, fsm);
>>
>> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> - if (!res) {
>> - dev_err(&pdev->dev, "Resource not found\n");
>> - return -ENODEV;
>> - }
>> -
>> - fsm->base = devm_ioremap_resource(&pdev->dev, res);
>> + fsm->base = devm_platform_ioremap_resource(pdev, 0);
>> if (IS_ERR(fsm->base)) {
>> dev_err(&pdev->dev,
>> "Failed to reserve memory region %pR\n", res);
>> --
>> 2.23.0
>>
>
>
> Is this even compiled tested? 'res' is not initialized anymore so you
> can't use it in the error trace. I suppose you should even drop it from
> the stack parameters.

Would you accept to reduce the error message another bit?

Regards,
Markus

\
 
 \ /
  Last update: 2019-09-19 12:51    [W:2.159 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site