Message ID | 20220817105424.3124006-3-cristian.marussi@arm.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Add ARM SCMI Powercap driver | expand |
diff --git a/drivers/powercap/arm_scmi_powercap.c b/drivers/powercap/arm_scmi_powercap.c index 9f3b8386b4d8..dc26cbb32b35 100644 --- a/drivers/powercap/arm_scmi_powercap.c +++ b/drivers/powercap/arm_scmi_powercap.c @@ -425,11 +425,12 @@ static int scmi_powercap_probe(struct scmi_device *sdev) if (!pr) return -ENOMEM; - pr->num_zones = powercap_ops->num_domains_get(ph); - if (pr->num_zones < 0) { + ret = powercap_ops->num_domains_get(ph); + if (ret < 0) { dev_err(dev, "number of powercap domains not found\n"); - return pr->num_zones; + return ret; } + pr->num_zones = ret; pr->spzones = devm_kcalloc(dev, pr->num_zones, sizeof(*pr->spzones), GFP_KERNEL);