From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Edmundo Carmona Antoranz <eantoranz@gmail.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
cw00.choi@samsung.com, b.zolnierkie@samsung.com,
a.zummo@towertech.it, linux-rtc@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] rtc: max77686: Remove some dead code
Date: Wed, 12 May 2021 12:24:26 -0400 [thread overview]
Message-ID: <9b48e433-4e0b-7334-028d-d700e0cdbff0@canonical.com> (raw)
In-Reply-To: <YJv+mMRcOuTJxLuk@piout.net>
On 12/05/2021 12:13, Alexandre Belloni wrote:
> On 10/05/2021 08:20:52-0400, Krzysztof Kozlowski wrote:
>> On 09/05/2021 17:06, Alexandre Belloni wrote:
>>> On 08/05/2021 18:06:03-0600, Edmundo Carmona Antoranz wrote:
>>>> On Sat, May 8, 2021 at 10:59 AM Christophe JAILLET
>>>> <christophe.jaillet@wanadoo.fr> wrote:
>>>>>
>>>>>>
>>>>>> Following the recent conversations, I think it might make sense to do
>>>>>> dev_err(&pdev->dev, "Failed to register RTC device: %pe\n", info->rtc_dev);
>>>>>>
>>>>>> Is that right?
>>>>>>
>>>>>
>>>>> Yes, it is right, but it should be done in another patch.
>>>>>
>>>>> Would you like to give it a try?
>>>>>
>>>> Sure, I'll have the patch ready to send it when I see yours on next.
>>>
>>> Does it make sense to print anything at all? Who would use the output?
>>> Is anyone actually going to read it?
>>
>> If the RTC core does not print the message, it should be
>> dev_err_probe(). However the first is recently preferred - RTC core
>> should do it for all drivers. I find such error messages useful - helps
>> easily spotting regressions via dmesg -l err.
>>
>
> The only error path that will not print a message by default (it is
> dev_dbg) is when rtc-ops is NULL which I don't expect would regress
> anyway.
Then the message in the driver is useless and could be removed.
> A better way to remove the dead code would be to switch to
> devm_rtc_allocate_device/devm_rtc_register_device. And even better would
> be to take that opportunity to set range_min and range_max ;)
>
The driver already uses devm_rtc_device_register() so I think I don't
follow that part.
Best regards,
Krzysztof
next prev parent reply other threads:[~2021-05-12 17:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-08 5:43 [PATCH] rtc: max77686: Remove some dead code Christophe JAILLET
2021-05-08 14:38 ` Edmundo Carmona Antoranz
2021-05-08 16:59 ` Christophe JAILLET
2021-05-09 0:06 ` Edmundo Carmona Antoranz
2021-05-09 21:06 ` Alexandre Belloni
2021-05-10 12:20 ` Krzysztof Kozlowski
2021-05-12 16:13 ` Alexandre Belloni
2021-05-12 16:24 ` Krzysztof Kozlowski [this message]
2021-05-12 16:54 ` Alexandre Belloni
2021-05-12 20:02 ` Christophe JAILLET
2021-05-12 21:22 ` Alexandre Belloni
2021-05-10 12:18 ` Krzysztof Kozlowski
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=9b48e433-4e0b-7334-028d-d700e0cdbff0@canonical.com \
--to=krzysztof.kozlowski@canonical.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=b.zolnierkie@samsung.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=cw00.choi@samsung.com \
--cc=eantoranz@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@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: 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