From: Daniel Thompson <daniel.thompson@linaro.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Lee Jones <lee.jones@linaro.org>,
Jingoo Han <jingoohan1@gmail.com>,
linux-fbdev@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH] video: backlight: ili9320: Make ili9320_remove() return void
Date: Tue, 19 Oct 2021 16:30:37 +0100 [thread overview]
Message-ID: <20211019153037.5uwqixmg7k4m3api@maple.lan> (raw)
In-Reply-To: <20211019120927.3822792-1-u.kleine-koenig@pengutronix.de>
On Tue, Oct 19, 2021 at 02:09:27PM +0200, Uwe Kleine-König wrote:
> Up to now ili9320_remove() returns zero unconditionally. Make it return
> void instead which makes it easier to see in the callers that there is
> no error to handle.
Ultimately the actions here boil down to an SPI write which could fail
so we could make an attempt to correct the broken error propagation
inside ili9320.c instead...
> Also the return value of spi remove callbacks is ignored anyway.
... which does inform the above question.
Is this patch a local fix or part of a larger plan to eventually change
the return value of the spi_remove to void?
Daniel.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/video/backlight/ili9320.c | 3 +--
> drivers/video/backlight/ili9320.h | 2 +-
> drivers/video/backlight/vgg2432a4.c | 4 +++-
> 3 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/backlight/ili9320.c b/drivers/video/backlight/ili9320.c
> index 168ac79523d7..2acd2708f8ca 100644
> --- a/drivers/video/backlight/ili9320.c
> +++ b/drivers/video/backlight/ili9320.c
> @@ -251,10 +251,9 @@ int ili9320_probe_spi(struct spi_device *spi,
> }
> EXPORT_SYMBOL_GPL(ili9320_probe_spi);
>
> -int ili9320_remove(struct ili9320 *ili)
> +void ili9320_remove(struct ili9320 *ili)
> {
> ili9320_power(ili, FB_BLANK_POWERDOWN);
> - return 0;
> }
> EXPORT_SYMBOL_GPL(ili9320_remove);
>
> diff --git a/drivers/video/backlight/ili9320.h b/drivers/video/backlight/ili9320.h
> index fc59e389d59a..8213cc6e9184 100644
> --- a/drivers/video/backlight/ili9320.h
> +++ b/drivers/video/backlight/ili9320.h
> @@ -68,7 +68,7 @@ extern int ili9320_write_regs(struct ili9320 *ili,
> extern int ili9320_probe_spi(struct spi_device *spi,
> struct ili9320_client *cli);
>
> -extern int ili9320_remove(struct ili9320 *lcd);
> +extern void ili9320_remove(struct ili9320 *lcd);
> extern void ili9320_shutdown(struct ili9320 *lcd);
>
> /* PM */
> diff --git a/drivers/video/backlight/vgg2432a4.c b/drivers/video/backlight/vgg2432a4.c
> index 9bf277ca4ae9..3567b45f9ba9 100644
> --- a/drivers/video/backlight/vgg2432a4.c
> +++ b/drivers/video/backlight/vgg2432a4.c
> @@ -235,7 +235,9 @@ static int vgg2432a4_probe(struct spi_device *spi)
>
> static int vgg2432a4_remove(struct spi_device *spi)
> {
> - return ili9320_remove(spi_get_drvdata(spi));
> + ili9320_remove(spi_get_drvdata(spi));
> +
> + return 0;
> }
>
> static void vgg2432a4_shutdown(struct spi_device *spi)
> --
> 2.30.2
>
next prev parent reply other threads:[~2021-10-19 15:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-19 12:09 [PATCH] video: backlight: ili9320: Make ili9320_remove() return void Uwe Kleine-König
2021-10-19 15:30 ` Daniel Thompson [this message]
2021-10-19 16:36 ` Uwe Kleine-König
2021-10-20 13:32 ` Daniel Thompson
2021-10-20 14:14 ` Lee Jones
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=20211019153037.5uwqixmg7k4m3api@maple.lan \
--to=daniel.thompson@linaro.org \
--cc=jingoohan1@gmail.com \
--cc=kernel@pengutronix.de \
--cc=lee.jones@linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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).