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