From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jingoo Han <jingoohan1@gmail.com>, Daniel Thompson <daniel.thompson@linaro.org>, Lee Jones <lee@kernel.org>, Helge Deller <deller@gmx.de> Subject: [PATCH v1 3/4] backlight: hx8357: Make use of dev_err_probe() Date: Sun, 14 Jan 2024 17:25:10 +0200 [thread overview] Message-ID: <20240114152759.1040563-4-andriy.shevchenko@linux.intel.com> (raw) In-Reply-To: <20240114152759.1040563-1-andriy.shevchenko@linux.intel.com> Simplify the error handling in probe function by switching from dev_err() to dev_err_probe(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/video/backlight/hx8357.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c index 8709d9141cfb..fbe02fd73272 100644 --- a/drivers/video/backlight/hx8357.c +++ b/drivers/video/backlight/hx8357.c @@ -579,10 +579,8 @@ static int hx8357_probe(struct spi_device *spi) return -ENOMEM; ret = spi_setup(spi); - if (ret < 0) { - dev_err(&spi->dev, "SPI setup failed.\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(dev, ret, "SPI setup failed.\n"); lcd->spi = spi; @@ -617,10 +615,8 @@ static int hx8357_probe(struct spi_device *spi) hx8357_lcd_reset(lcdev); ret = init(lcdev); - if (ret) { - dev_err(&spi->dev, "Couldn't initialize panel\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Couldn't initialize panel\n"); dev_info(&spi->dev, "Panel probed\n"); -- 2.43.0.rc1.1.gbec44491f096
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Lee Jones <lee@kernel.org>, Daniel Thompson <daniel.thompson@linaro.org>, Jingoo Han <jingoohan1@gmail.com>, Helge Deller <deller@gmx.de> Subject: [PATCH v1 3/4] backlight: hx8357: Make use of dev_err_probe() Date: Sun, 14 Jan 2024 17:25:10 +0200 [thread overview] Message-ID: <20240114152759.1040563-4-andriy.shevchenko@linux.intel.com> (raw) In-Reply-To: <20240114152759.1040563-1-andriy.shevchenko@linux.intel.com> Simplify the error handling in probe function by switching from dev_err() to dev_err_probe(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/video/backlight/hx8357.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c index 8709d9141cfb..fbe02fd73272 100644 --- a/drivers/video/backlight/hx8357.c +++ b/drivers/video/backlight/hx8357.c @@ -579,10 +579,8 @@ static int hx8357_probe(struct spi_device *spi) return -ENOMEM; ret = spi_setup(spi); - if (ret < 0) { - dev_err(&spi->dev, "SPI setup failed.\n"); - return ret; - } + if (ret < 0) + return dev_err_probe(dev, ret, "SPI setup failed.\n"); lcd->spi = spi; @@ -617,10 +615,8 @@ static int hx8357_probe(struct spi_device *spi) hx8357_lcd_reset(lcdev); ret = init(lcdev); - if (ret) { - dev_err(&spi->dev, "Couldn't initialize panel\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Couldn't initialize panel\n"); dev_info(&spi->dev, "Panel probed\n"); -- 2.43.0.rc1.1.gbec44491f096
next prev parent reply other threads:[~2024-01-14 15:28 UTC|newest] Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-01-14 15:25 [PATCH v1 0/4] backlight: hx8357: Clean up and make OF-independent Andy Shevchenko 2024-01-14 15:25 ` Andy Shevchenko 2024-01-14 15:25 ` [PATCH v1 1/4] backlight: hx8357: Make use of device properties Andy Shevchenko 2024-01-14 15:25 ` Andy Shevchenko 2024-01-15 8:20 ` Javier Martinez Canillas 2024-01-21 13:48 ` Andy Shevchenko 2024-01-21 13:48 ` Andy Shevchenko 2024-01-22 10:35 ` Daniel Thompson 2024-01-22 10:35 ` Daniel Thompson 2024-01-24 17:19 ` Daniel Thompson 2024-01-24 17:19 ` Daniel Thompson 2024-01-28 14:38 ` Andy Shevchenko 2024-01-28 14:38 ` Andy Shevchenko 2024-01-14 15:25 ` [PATCH v1 2/4] backlight: hx8357: Move OF table closer to its consumer Andy Shevchenko 2024-01-14 15:25 ` Andy Shevchenko 2024-01-15 8:22 ` Javier Martinez Canillas 2024-01-21 13:49 ` Andy Shevchenko 2024-01-21 13:49 ` Andy Shevchenko 2024-01-22 10:43 ` Daniel Thompson 2024-01-22 10:43 ` Daniel Thompson 2024-01-24 17:21 ` Daniel Thompson 2024-01-24 17:21 ` Daniel Thompson 2024-01-14 15:25 ` Andy Shevchenko [this message] 2024-01-14 15:25 ` [PATCH v1 3/4] backlight: hx8357: Make use of dev_err_probe() Andy Shevchenko 2024-01-15 8:24 ` Javier Martinez Canillas 2024-01-24 17:24 ` Daniel Thompson 2024-01-24 17:24 ` Daniel Thompson 2024-01-14 15:25 ` [PATCH v1 4/4] backlight: hx8357: Utilise temporary variable for struct device Andy Shevchenko 2024-01-14 15:25 ` Andy Shevchenko 2024-01-15 8:27 ` Javier Martinez Canillas 2024-01-24 17:25 ` Daniel Thompson 2024-01-24 17:25 ` Daniel Thompson 2024-01-28 14:39 ` Andy Shevchenko 2024-01-28 14:39 ` Andy Shevchenko
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=20240114152759.1040563-4-andriy.shevchenko@linux.intel.com \ --to=andriy.shevchenko@linux.intel.com \ --cc=daniel.thompson@linaro.org \ --cc=deller@gmx.de \ --cc=dri-devel@lists.freedesktop.org \ --cc=jingoohan1@gmail.com \ --cc=lee@kernel.org \ --cc=linux-fbdev@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.