Re: [PATCH -next v2 4/4] soc: ti: knav_qmss_queue: Simplify with dev_err_probe()
From: Krzysztof Kozlowski
Date: Sat Aug 31 2024 - 07:07:04 EST
On 30/08/2024 08:32, Jinjie Ruan wrote:
> Use the dev_err_probe() helper to simplify error handling
> during probe.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
> ---
> v2:
> - Split into 2 patches.
> - Rebased the newest next.
> - Update the commit message.
> ---
> drivers/soc/ti/knav_qmss_queue.c | 33 +++++++++++---------------------
> 1 file changed, 11 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
> index 02983f8ba1b6..d583a86028af 100644
> --- a/drivers/soc/ti/knav_qmss_queue.c
> +++ b/drivers/soc/ti/knav_qmss_queue.c
> @@ -1091,10 +1091,8 @@ static int knav_queue_setup_regions(struct knav_device *kdev,
>
> for_each_child_of_node_scoped(regions, child) {
> region = devm_kzalloc(dev, sizeof(*region), GFP_KERNEL);
> - if (!region) {
> - dev_err(dev, "out of memory allocating region\n");
> - return -ENOMEM;
> - }
> + if (!region)
> + return dev_err_probe(dev, -ENOMEM, "out of memory allocating region\n");
This as well does not make any sense. Please read carefully coding style
and then use coccinelle on all your contributions.
You send useless changes without understanding how this works. The tools
would help you, but it seems you do not want to use them.
Best regards,
Krzysztof