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]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux