Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4760052pxj; Wed, 12 May 2021 12:37:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDmioAc+CmMojH9pTkBLx5vckuaYzTikDNeA5/5NLIuxJ1fOlBogtTALFmbgyz7FFqvJEA X-Received: by 2002:aa7:c903:: with SMTP id b3mr45800363edt.296.1620848233144; Wed, 12 May 2021 12:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620848233; cv=none; d=google.com; s=arc-20160816; b=XcWydFtVqGVsQF0SCTqnImwPtF7AxNnn5d1BwWTBHKla9f29CSi5/ZPJR/a5wXifcL ESlmQrR+wjUVk+5o/U6xniWPZP4U36gmWTgIiw1cgUHcssuxPJWx504uFCEA5TypW+na NcEwJIMDExqww5MDFHArixxi4TwE7yo/toXToQvuAlQFsnmz5qWTgyfzMCTrtAimK+dB 7Yj8BvSmv9vuULp7vCjSPkIDLIDR7J5PY2tXxrW8T8F8+XvRqgq9mcgCI6H5PkRVbyp7 TxdkKaybtsCBh3VAuyYyfpuMCxZOlxGweTp76kHpLIbLv/4S34aZKg75CO9ZcVsRGNsc VqBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lmFdBTzTTNtGhRRBaTjldGNwEJW3KyvWGA3DoZjJGAY=; b=KB/vyDd2Qd2tSoSZYMsFoHRZDwc9KEivQa5RnA1MD+78QkaG2YuwlrF+xnCm9LlBE9 KwHz0kWjyJKGLF9vlNvL3w9p1b2JPkzZJzrbh39N/A17NegfK8CAE8X+iD7EnmeIpz6G lU/vxTmY+hX8YhYy0OKy+5lhAA2MLOy2cmXbq8DSoPyMzjKpTTnHFrc/XYyWoyqnoTBl e06azRkRryOT5rZFqGeuX6RsazXIW1tyoT+NIp8IE9FJGPlLX2u6QilqV3a0FohFpOan 0hQWPonv2CH1t5E3tpB/lwi9Ajyad6XsKbu5sNCONrV3oIjPUG8JX7Q90sdEbocLWsSK Pzqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bj22si415946ejb.53.2021.05.12.12.36.48; Wed, 12 May 2021 12:37:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379870AbhELTaa (ORCPT + 99 others); Wed, 12 May 2021 15:30:30 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:40279 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233495AbhELQz5 (ORCPT ); Wed, 12 May 2021 12:55:57 -0400 Received: from localhost (lfbn-lyo-1-1676-55.w90-65.abo.wanadoo.fr [90.65.108.55]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 6487B24000C; Wed, 12 May 2021 16:54:42 +0000 (UTC) Date: Wed, 12 May 2021 18:54:42 +0200 From: Alexandre Belloni To: Krzysztof Kozlowski Cc: Edmundo Carmona Antoranz , Christophe JAILLET , 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 Message-ID: References: <9f34ebcd-0c17-cd7f-eb08-52c6c3dc7b03@wanadoo.fr> <219efcc7-ca05-a7d1-5943-d34a42f0d49f@canonical.com> <9b48e433-4e0b-7334-028d-d700e0cdbff0@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9b48e433-4e0b-7334-028d-d700e0cdbff0@canonical.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/05/2021 12:24:26-0400, Krzysztof Kozlowski wrote: > 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 > >>>> 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. devm_rtc_device_register is different from devm_rtc_register_device. > > Best regards, > Krzysztof -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com