Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4801118pxj; Wed, 12 May 2021 13:38:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBxW0w2efHL0lnRlk/o5poQJmD680JM2aG+tClvQsA3TRD2dcjBCl6mGYd1Y2fHypn0iGa X-Received: by 2002:a17:907:161f:: with SMTP id hb31mr39865377ejc.514.1620851886956; Wed, 12 May 2021 13:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620851886; cv=none; d=google.com; s=arc-20160816; b=sbX7KArp3bq9102vNN6W6qfG68fRGPC8TKNa0/hj3ZSfoma9NrgfzeiUQBYe6c2wCW ZpD6d3ye5KAs7OKUCnbpJu179xIeJgtrFoh0mzF1y6pV+7aM2Vo7/0ee8/s/7MJk1HUz wxwOoqbGgeiab13pMse/MPfAgArgfJglJd4ibxyYNvlROfyLp/S3C61uOQpFvDQ5uNOV tX3hTXnX/pmmv6JJ6AjNFQxz2BnJq0cf/9+1oItsG7Nagb5kU7RCyiKFaqk2qdXjRSOU kdHuHIlTqRzjBH7SekwAHLCb/Fk5HBrk/GvXMNXUXEsm17YU9WMdhLcrmtWjguOZNpbF 7GKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Xnzeyyfv0+v9ydjWSd+jA5zXMhDO2zKL6T/TzR13k4U=; b=kfT/sk8cDmL4JqW7aEdyyYTYGZex9PABNIOzcoau5r28t4sCO352+pWRpObqCPVm2v l5bKp0q0i+b3ZOztD1sAhsWYFuM645DrvAlU9eE2iQBSmzaDSvrX2Aap/6d/+7d6GMAb ReqitX530nRVs4uDr4MPBjMxCGb2soGKub73hNNPx41Va4YmJph1T4Bs7IVkzvwHno9e LheNa8fT0EWoIXbDmlkX1EXRB3l0TntR7bJ0I9wo99Vk1OpzXviJUZy+4T5nMtK72jMg I6sUGaufB3I7vyacy1CqCp7i6E4B9Sy5PoC4/8ZjtTtIYvBlL5yZUSxEQ0JLMlqwAnYa QwJA== 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 hr13si758284ejc.630.2021.05.12.13.36.40; Wed, 12 May 2021 13:38:06 -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 S1386644AbhELUVr (ORCPT + 99 others); Wed, 12 May 2021 16:21:47 -0400 Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:27962 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344145AbhELUDb (ORCPT ); Wed, 12 May 2021 16:03:31 -0400 Received: from [192.168.1.18] ([86.243.172.93]) by mwinf5d61 with ME id 3w2G2500221Fzsu03w2GZX; Wed, 12 May 2021 22:02:18 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 12 May 2021 22:02:18 +0200 X-ME-IP: 86.243.172.93 Subject: Re: [PATCH] rtc: max77686: Remove some dead code To: Alexandre Belloni , Krzysztof Kozlowski Cc: Edmundo Carmona Antoranz , 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 References: <9f34ebcd-0c17-cd7f-eb08-52c6c3dc7b03@wanadoo.fr> <219efcc7-ca05-a7d1-5943-d34a42f0d49f@canonical.com> From: Christophe JAILLET Message-ID: <9535976d-1029-3668-4be4-c09068ccf84c@wanadoo.fr> Date: Wed, 12 May 2021 22:02:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 12/05/2021 à 18:13, Alexandre Belloni a écrit : > 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. > > A better way to remove the dead code would be to switch to > devm_rtc_allocate_device/devm_rtc_register_device. I don't follow you here. Isn't devm_rtc_device_register = devm_rtc_allocate_device + devm_rtc_register_device? What would be the benefit for switch to the latter? > And even better would > be to take that opportunity to set range_min and range_max ;) Maybe, but this goes beyond my knowledge. I'll let someone else propose a patch for it. CJ