From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] Input: adp5588-keys - switch to using managed resources
Date: Sat, 28 May 2022 21:37:55 +0200 [thread overview]
Message-ID: <20220528193755.lncxrpgmyiy4hprm@pengutronix.de> (raw)
In-Reply-To: <20220528045631.289821-3-dmitry.torokhov@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1567 bytes --]
On Fri, May 27, 2022 at 09:56:30PM -0700, Dmitry Torokhov wrote:
> This simplifies error handling in probe() and reduces amount of explicit
> code in remove().
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> drivers/input/keyboard/adp5588-keys.c | 111 +++++++++++---------------
> 1 file changed, 45 insertions(+), 66 deletions(-)
>
> diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
> index ac21873ba1d7..df84a2998ed2 100644
> --- a/drivers/input/keyboard/adp5588-keys.c
> +++ b/drivers/input/keyboard/adp5588-keys.c
> @@ -182,6 +182,21 @@ static int adp5588_build_gpiomap(struct adp5588_kpad *kpad,
> return n_unused;
> }
>
> +static void adp5588_gpio_do_teardown(void *_kpad)
> +{
> + struct adp5588_kpad *kpad = _kpad;
> + struct device *dev = &kpad->client->dev;
> + const struct adp5588_kpad_platform_data *pdata = dev_get_platdata(dev);
> + const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data;
> + int error;
> +
> + error = gpio_data->teardown(kpad->client,
> + kpad->gc.base, kpad->gc.ngpio,
> + gpio_data->context);
> + if (error)
> + dev_warn(&kpad->client->dev, "teardown failed %d\n", error);
> +}
I think the more sensible approach is to drop support for setup and
teardown. Maybe even rip all usage of adp5588_gpio_platform_data.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-05-28 20:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-28 4:56 [PATCH 1/4] Input: adp5588-keys - drop CONFIG_PM guards Dmitry Torokhov
2022-05-28 4:56 ` [PATCH 2/4] Input: adp5588-keys - switch to using threaded interrupt Dmitry Torokhov
2022-05-30 10:10 ` Hennerich, Michael
2022-05-28 4:56 ` [PATCH 3/4] Input: adp5588-keys - switch to using managed resources Dmitry Torokhov
2022-05-28 19:37 ` Uwe Kleine-König [this message]
2022-05-29 5:22 ` Dmitry Torokhov
2022-05-29 6:11 ` Uwe Kleine-König
2022-05-30 10:11 ` Hennerich, Michael
2022-05-28 4:56 ` [PATCH 4/4] Input: adp5588-keys - do not explicitly set device as wakeup source Dmitry Torokhov
2022-05-30 10:11 ` Hennerich, Michael
2022-05-30 10:06 ` [PATCH 1/4] Input: adp5588-keys - drop CONFIG_PM guards Hennerich, Michael
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=20220528193755.lncxrpgmyiy4hprm@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.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;
as well as URLs for NNTP newsgroup(s).