lkml.org 
[lkml]   [2022]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Re: [PATCH] tty/serial: Check for null pointer after calling devm_ioremap
Date
On Thu, Jan 13, 2022 at 03:35:14PM +0800, Jiri Slaby wrote:
>> diff --git a/drivers/tty/serial/milbeaut_usio.c b/drivers/tty/serial/milbeaut_usio.c
>> index 8f2cab7f66ad..1ecbf6d0dc79 100644
>> --- a/drivers/tty/serial/milbeaut_usio.c
>> +++ b/drivers/tty/serial/milbeaut_usio.c
>> @@ -523,6 +523,10 @@ static int mlb_usio_probe(struct platform_device *pdev)
>> }
>> port->membase = devm_ioremap(&pdev->dev, res->start,
>> resource_size(res));
>> + if (!port->membase) {
>> + ret = -ENOMEM;
>> + goto failed;
>> + }
>
> what about using devm_ioremap_resource() and have only one if there?

Well, I check the comment of the devm_ioremap_resource() and notice that
it checks and requests region before ioremap.
And the usage example is fit for the situation.
But I have still have no idea what the concrete advantages of the
devm_ioremap_resource(), like fixing something or improve the efficiency.
Please give me more detail.

Sincerely thanks,
Jiang

\
 
 \ /
  Last update: 2022-01-13 09:03    [W:0.026 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site