Re: [PATCH v5 06/13] soc: qcom: geni-se: Introduce helper API for attaching power domains
From: Konrad Dybcio <hidden>
Date: 2026-02-19 15:08:06
Also in:
linux-arm-msm, linux-i2c, lkml
On 2/19/26 3:58 PM, Praveen Talari wrote:
Hi On 2/17/2026 5:09 PM, Konrad Dybcio wrote:quoted
On 2/6/26 6:41 PM, Praveen Talari wrote:quoted
The GENI Serial Engine drivers (I2C, SPI, and SERIAL) currently handle the attachment of power domains. This often leads to duplicated code logic across different driver probe functions. Introduce a new helper API, geni_se_domain_attach(), to centralize the logic for attaching "power" and "perf" domains to the GENI SE device. Signed-off-by: Praveen Talari <redacted> ---[...]quoted
+int geni_se_domain_attach(struct geni_se *se) +{ + struct dev_pm_domain_attach_data pd_data = { + .pd_flags = PD_FLAG_DEV_LINK_ON, + .pd_names = (const char*[]) { "power", "perf" }, + .num_pd_names = 2, + }; + int ret; + + ret = devm_pm_domain_attach_list(se->dev, + &pd_data, &se->pd_list); + if (ret <= 0) + return -EINVAL;I think we should preserve the original retval for the < 0 cases For == 0, this can mean a number of different things.. but in this specific case (where we always set pd_data.num_pd_names == 2) it seems that it would only be an issue if dev->of_node == NULL, at which point this function would have never been calledI hope the below is acceptable. +int geni_se_domain_attach(struct geni_se *se) +{ + struct dev_pm_domain_attach_data pd_data = { + .pd_flags = PD_FLAG_DEV_LINK_ON, + .pd_names = (const char*[]) { "power", "perf" }, + .num_pd_names = 2, + }; + int ret; + + ret = devm_pm_domain_attach_list(se->dev, + &pd_data, &se->pd_list); + if (ret == 0) + return -ENODEV; + else if (ret < 0) + return ret;
Yeah, thanks! Konrad