From: "Heiko Stübner" <heiko@sntech.de>
To: dmitry.torokhov@gmail.com, Xichao Zhao <zhao.xichao@vivo.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Xichao Zhao <zhao.xichao@vivo.com>
Subject: Re: [PATCH] Input: Remove dev_err_probe() if error is -ENOMEM
Date: Thu, 21 Aug 2025 14:54:10 +0200 [thread overview]
Message-ID: <25449163.kmuVQn2iE0@diego> (raw)
In-Reply-To: <20250821094751.573411-1-zhao.xichao@vivo.com>
Am Donnerstag, 21. August 2025, 11:47:51 Mitteleuropäische Sommerzeit schrieb Xichao Zhao:
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Acked-by: Heiko Stuebner <heiko@sntech.de>
Funnily enough, it seems I "messed up" in both drivers - just with a
decade in between :-)
Heiko
> ---
> drivers/input/misc/qnap-mcu-input.c | 2 +-
> drivers/input/touchscreen/zforce_ts.c | 3 +--
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/misc/qnap-mcu-input.c b/drivers/input/misc/qnap-mcu-input.c
> index 76e62f0816c1..3be899bfc114 100644
> --- a/drivers/input/misc/qnap-mcu-input.c
> +++ b/drivers/input/misc/qnap-mcu-input.c
> @@ -103,7 +103,7 @@ static int qnap_mcu_input_probe(struct platform_device *pdev)
>
> input = devm_input_allocate_device(dev);
> if (!input)
> - return dev_err_probe(dev, -ENOMEM, "no memory for input device\n");
> + return -ENOMEM;
>
> idev->input = input;
> idev->dev = dev;
> diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
> index df42fdf36ae3..a360749fa076 100644
> --- a/drivers/input/touchscreen/zforce_ts.c
> +++ b/drivers/input/touchscreen/zforce_ts.c
> @@ -747,8 +747,7 @@ static int zforce_probe(struct i2c_client *client)
>
> input_dev = devm_input_allocate_device(&client->dev);
> if (!input_dev)
> - return dev_err_probe(&client->dev, -ENOMEM,
> - "could not allocate input device\n");
> + return -ENOMEM;
>
> ts->client = client;
> ts->input = input_dev;
>
next prev parent reply other threads:[~2025-08-21 12:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 9:47 [PATCH] Input: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
2025-08-21 12:54 ` Heiko Stübner [this message]
2025-08-22 2:48 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25449163.kmuVQn2iE0@diego \
--to=heiko@sntech.de \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zhao.xichao@vivo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox