[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220701100008.coh5mymwwxak5pnu@bogus>
Date: Fri, 1 Jul 2022 11:00:08 +0100
From: Sudeep Holla <sudeep.holla@....com>
To: huhai <huhai@...inos.cn>
Cc: cristian.marussi@....com, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, luriwen@...inos.cn,
liuyun01@...inos.cn, Sudeep Holla <sudeep.holla@....com>
Subject: Re: [PATCH] firmware: arm_scpi: Fix error handle when scpi probe
failed
On Fri, Jul 01, 2022 at 10:42:12AM +0100, Sudeep Holla wrote:
> diff --git i/drivers/firmware/arm_scpi.c w/drivers/firmware/arm_scpi.c
> index ddf0b9ff9e15..6fa1a5b193b8 100644
> --- i/drivers/firmware/arm_scpi.c
> +++ w/drivers/firmware/arm_scpi.c
> @@ -799,7 +799,7 @@ static struct scpi_ops scpi_ops = {
>
> struct scpi_ops *get_scpi_ops(void)
> {
> - return scpi_info ? scpi_info->scpi_ops : NULL;
> + return scpi_info && scpi_info->scpi_ops ? scpi_info->scpi_ops : NULL;
Scratch that, scpi_info->scpi_ops will be NULL and it is fine to return NULL.
Only reason why something can go wrong is if devm_of_platform_populate()
fails and we return error after setting up scpi_info->scpi_ops.
Can you check if the below fixes the issue ? We can continue working as
a driver even if few of the devices were populated which could be the case
but I am still doubtful about that.
Regards,
Sudeep
-->8
diff --git i/drivers/firmware/arm_scpi.c w/drivers/firmware/arm_scpi.c
index ddf0b9ff9e15..bae2e18e24ee 100644
--- i/drivers/firmware/arm_scpi.c
+++ w/drivers/firmware/arm_scpi.c
@@ -1024,7 +1024,9 @@ static int scpi_probe(struct platform_device *pdev)
scpi_info->firmware_version));
scpi_info->scpi_ops = &scpi_ops;
- return devm_of_platform_populate(dev);
+ devm_of_platform_populate(dev);
+
+ return ret;
}
Powered by blists - more mailing lists