Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4875611pxj; Wed, 12 May 2021 15:24:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9uXHSmiMlSTTbCYw3ErCiGFc8/pmEGRPDqf1FB5RwF+7vhS1trBQQn3FOaWkb95h7VV5R X-Received: by 2002:aa7:c6ca:: with SMTP id b10mr31111420eds.221.1620858271167; Wed, 12 May 2021 15:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620858271; cv=none; d=google.com; s=arc-20160816; b=GBvnAqTpa8FCEgLggTYAhGAHb2MnkecqqhywYqKdJ9r4CW3ZxXS2R6SExCp+YCQFYv 5ZOvbOhbhYVK2vtUyMZDKnTGls0iq00F83UMw4dN9rAIec5NzpH06PEvh7scU3ecQPpq gCe/C2Oil+JM2ZzIic/AuVZtFqfrTPKhtODMC5HKB79UZnflop+T/dDTKYQqavnNxxXR oA2BsQ93lYYnO8HMDw9kZB+oCgQshTf9qkiEmReCwf64Br/pSpivLOpy1T3BJk6nTi4G zbcwFNgId3DU9wH0XQGw/oDsOuCRRkBfi7Zz1wRrpk5HYA8lIXQ+VjRamCXJ5tzj7DBd yXLg== 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=YlH4H3Xz1xnkw8cs6Y3CaV09qTUzV0ldnEu9F7pNgyg=; b=jyWMhw/1XKh+uCxsNDppoK/ZEgsEIrWK1UV15ugLK/fxGdnrCDLqyHmsEX15S6srs+ 5qdrb/xnWHGH7PrxBBzleZdS64uzgcyd4A0sR7KuukRas4Zhb2rHAF7hQlSc4DtXm19q f7s8Y5xla5nt1JUK/By4HPjbaiFth45d0SI8/uv7behtV9rmO1vWyokVg6qJkg0mk+p/ McS4+oULqBchHs3riWfYsoH+gFOEZXNOPSRT3FWDV2KsA7A+n4cgC6teZO18dt7iAfd7 oVWSfiM9S6/W1uVywa+J+VOmuf3KLVZg2olrvOb1gXMoqTmfZ798FjSFDpeNgptkk0Wv BOoA== 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 gn39si988503ejc.405.2021.05.12.15.24.06; Wed, 12 May 2021 15:24:31 -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 S1443001AbhELWPY (ORCPT + 99 others); Wed, 12 May 2021 18:15:24 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:42257 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346282AbhELVYG (ORCPT ); Wed, 12 May 2021 17:24:06 -0400 X-Originating-IP: 90.65.108.55 Received: from localhost (lfbn-lyo-1-1676-55.w90-65.abo.wanadoo.fr [90.65.108.55]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 24ABAFF803; Wed, 12 May 2021 21:22:38 +0000 (UTC) Date: Wed, 12 May 2021 23:22:37 +0200 From: Alexandre Belloni To: Christophe JAILLET Cc: Krzysztof Kozlowski , 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 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> <9535976d-1029-3668-4be4-c09068ccf84c@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9535976d-1029-3668-4be4-c09068ccf84c@wanadoo.fr> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/05/2021 22:02:17+0200, Christophe JAILLET wrote: > > 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? > The immediate benefit is that this solve a possible but very unlikely race condition around the character device removal when probe ultimately fails. The other benefit is that I won't have to do it later to handle the modern features. > > > 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 > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com