Re: [PATCH v2 2/3] tty: serial: 8250: Add loongson uart driver support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/08/2024 10:24, 郑豪威 wrote:
>>> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>> +	if (!res)
>>> +		return -ENODEV;
>>> +
>>> +	port->membase = devm_ioremap(&pdev->dev, res->start, resource_size(res));
>>> +	if (!port->membase)
>>> +		return -ENOMEM;
>>> +
>> Use wrapper combining both calls.
> 
> I got it, did you mean like this?
> 
> +    res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +    if (!res)
> +        return -ENODEV;
> +
> +    port->mapbase = res->start;
> +    port->mapsize = resource_size(res);
> +
> +    port->membase = devm_ioremap(&pdev->dev, port->mapbase, port->mapsize);
> +    if (!port->membase)
>   +       return -ENOMEM;

I still see two calls, so how are they combined? Just open any other
file and see how it is done there.


Best regards,
Krzysztof





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux