mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: thierry.reding@gmail.com, lee.jones@linaro.org,
	matthias.bgg@gmail.com, linux-pwm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, kernel@collabora.com
Subject: Re: [PATCH 1/2] pwm: pwm-mediatek: Simplify error handling with dev_err_probe()
Date: Mon, 14 Feb 2022 14:50:37 +0100	[thread overview]
Message-ID: <bb79e52c-bf82-5966-1814-ba23f4b6dcf5@collabora.com> (raw)
In-Reply-To: <20220214134850.aqmd7wjxjsjyuwz7@pengutronix.de>

Il 14/02/22 14:48, Uwe Kleine-König ha scritto:
> On Mon, Feb 14, 2022 at 12:30:37PM +0100, AngeloGioacchino Del Regno wrote:
>> Use dev_err_probe() to simplify handling errors in pwm_mediatek_probe().
>>
>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>> ---
>>   drivers/pwm/pwm-mediatek.c | 30 +++++++++++-------------------
>>   1 file changed, 11 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
>> index 0d4dd80e9f07..c7d5ca09a684 100644
>> --- a/drivers/pwm/pwm-mediatek.c
>> +++ b/drivers/pwm/pwm-mediatek.c
>> @@ -227,18 +227,14 @@ static int pwm_mediatek_probe(struct platform_device *pdev)
>>   		return -ENOMEM;
>>   
>>   	pc->clk_top = devm_clk_get(&pdev->dev, "top");
>> -	if (IS_ERR(pc->clk_top)) {
>> -		dev_err(&pdev->dev, "clock: top fail: %ld\n",
>> -			PTR_ERR(pc->clk_top));
>> -		return PTR_ERR(pc->clk_top);
>> -	}
>> +	if (IS_ERR(pc->clk_top))
>> +		return dev_err_probe(&pdev->dev, PTR_ERR(pc->clk_top),
>> +				     "clock: top failed\n");
> 
> The change looks straight forward. I wonder if we should improve the
> error message on this occasion. E.g.
> 
> 	"Failed to get top clock\n"
> 

I can push another commit on top that improves the messages, if desired!

Regards,
Angelo

> ? Ditto below.
> 
> Best regards
> Uwe
> 



      reply	other threads:[~2022-02-14 13:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 11:30 AngeloGioacchino Del Regno
2022-02-14 11:30 ` [PATCH 2/2] pwm: pwm-mediatek: Allocate clk_pwms with devm_kmalloc_array AngeloGioacchino Del Regno
2022-02-14 13:48 ` [PATCH 1/2] pwm: pwm-mediatek: Simplify error handling with dev_err_probe() Uwe Kleine-König
2022-02-14 13:50   ` AngeloGioacchino Del Regno [this message]

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=bb79e52c-bf82-5966-1814-ba23f4b6dcf5@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=kernel@collabora.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=thierry.reding@gmail.com \
    --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

all inboxes | Powered by JetHome®