Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4792075rwb; Mon, 8 Aug 2022 07:09:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR6u0i2KgP6u+fRF2b/i39EymSHKJKrOtWR0jjOICshA7PFcMzT/qal6GxGeWJXV2AJdVEvl X-Received: by 2002:a17:907:9688:b0:730:f098:86d0 with SMTP id hd8-20020a170907968800b00730f09886d0mr11215875ejc.60.1659967742092; Mon, 08 Aug 2022 07:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659967742; cv=none; d=google.com; s=arc-20160816; b=xmpS2mrt/tPRy1iyljE4GyhFFFVLUhwwM+NS0tVxbwC+bpKPENNwACkz78kHh7ZGj2 uvZUQQyXWzNCAxmkd+yIgtkivjg+qE6iPcchJLwv8muE5lU+TH+K1RmCSBm91NJ8KDC8 QoGDTsvEIQf/VcqlTyUCcrpZoQ30xRfxaBmRScKgbzsB6xkt2I8ojJNf7xDzQbsprvai 4cC0hcbnzY3qNUCVE4oDWS+wwmPvNUMJupsNuoniV5JbawL6yQ3VjGjSewLc0sfuui0w /R+ksZHls5Bs4aD8aC/4HM4vCEP5RANSnaG9OadJNQypPPWiQCFtVMXE8oreK8CnvIVt mIZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Zb//D83w5rUouZtvhpUzjLE3yfU698mDfW845egr+PM=; b=itRafvGn1flq50Lwwn6NrRwTWrrmPg9JHzfE68o8Ik+wID1sB3gwnLr15Fsi2v1E8Z l9pYNPAXm+mw8HqYxkTlZlQODjtky4Yxxs8pqCsunsydRLM3ILkXtvA7ynodYmWR5bIk LhkJZdrc2RedRgJC6tB810W5iLyn83qJSqyFmJldRKPB18Yvenr9N5tCGlOYTcNHMxs1 SPYCyv8SDrC3Rq9RUmcdfMWctEkMuLRAIXJViVpOn73cdTuWCKj32G77bx5vX0UdEkHa xv+nk6bUEIwCbM+Z68Ilob3bM5N5NQZLpiGLrUEU9eGC97D+AktqMTJQ8qXnsf5qXCmL 9zoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CLd8uwlT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a508a83000000b0043d7c43bbaesi6274700edj.514.2022.08.08.07.08.27; Mon, 08 Aug 2022 07:09:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CLd8uwlT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243020AbiHHNoW (ORCPT + 99 others); Mon, 8 Aug 2022 09:44:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234710AbiHHNoT (ORCPT ); Mon, 8 Aug 2022 09:44:19 -0400 Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B09F81121 for ; Mon, 8 Aug 2022 06:44:18 -0700 (PDT) Received: by mail-qv1-xf31.google.com with SMTP id v2so6340321qvs.12 for ; Mon, 08 Aug 2022 06:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=Zb//D83w5rUouZtvhpUzjLE3yfU698mDfW845egr+PM=; b=CLd8uwlTx4U8OF8Vt3RWjNOH+J92Dx7WzSXMT7EHoCTkfI9AZGQ+w1rN5/HxC08cqJ o/qpRDWBd9N/EhRg+tLnoOMavOFqA/fLOK6vYkJB5hBcSt2dqlV5hhbcb4ccRN2hAP1K X8tvMKHUFkki68ZBvJJ3aZB5Q6fNH+R+ptqg3y3YCXrhQRS0kbyGCp8sXahVlcUIebHM pBGAhcuUjcYCssdFGCoXrN5UCN6c15rbteO46eayhTCiw70Khljlj1Sy8jFTfZIf/W4b UfUVzMnndPtnwqRjZZzqLiE71VIA3oFYJaEhq/HcVTVOdv4uXolHI32iy6rFPlS9kOZi 8XzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=Zb//D83w5rUouZtvhpUzjLE3yfU698mDfW845egr+PM=; b=1zWwrqD4psCgqSoP5zWW73LsySd2WfAokLqRb1Dc3Z1/cJSGM+DKLZ6eSZk7AmyDAW JJAIwX40xmRAtZ40zkwmQrIr+rq4wwPbsWDKYTcu/xjtvsTt735JoPBhreyFzVZ6md/B BKUuQObvs7+2B0lC5Hkivy0DviIHEcHpL4aDjxxE36htuB7mM8rdo8kVUK9Fy0ZZHHcP lqZZyAsVosPSvnrSjgTkMKglkLyW6RZBQ903c7xYOOeR8Ec7otKGwipaalqNG493P2hK jp3uRAE/aPn1ZdoFomnXUk81ILrXRs0IcF7MambPEd4cudpQc/UcBlCuLBOyTz+orDeL qTgw== X-Gm-Message-State: ACgBeo03nKIZc7JvISGTE4HKeTejYQk7FZpQ5fMkifWjvIkwURasHZb+ Kw+N2AO86AZYxHL2KlBe4TYYkI5CVwy/znI7ruYlWZFEze0= X-Received: by 2002:a05:6214:e69:b0:476:b991:586f with SMTP id jz9-20020a0562140e6900b00476b991586fmr15851832qvb.48.1659966257725; Mon, 08 Aug 2022 06:44:17 -0700 (PDT) MIME-Version: 1.0 References: <20220805205321.19452-1-andriy.shevchenko@linux.intel.com> <20220805205321.19452-2-andriy.shevchenko@linux.intel.com> In-Reply-To: From: Andy Shevchenko Date: Mon, 8 Aug 2022 15:43:41 +0200 Message-ID: Subject: Re: [PATCH v1 2/5] regmap: mmio: Drop unneeded and duplicative checks around CLK calls To: Mark Brown Cc: Andy Shevchenko , Aidan MacDonald , Linux Kernel Mailing List , Greg Kroah-Hartman , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 8, 2022 at 3:28 PM Mark Brown wrote: > On Fri, Aug 05, 2022 at 11:53:18PM +0300, Andy Shevchenko wrote: > > > The commit 6b8e090ecc3d ("regmap: use IS_ERR() to check clk_get() > > results") assumes that CLK calls return the error pointer when clock > > is not found. However in the current code the described situation > > is simply impossible, because the regmap won't be created with > > missed clock if requested. The only way when it can be the case is > > what the above mentioned commit introduced by itself, when clock is > > not provided. > > > Taking above into consideration, effectively revert the commit > > 6b8e090ecc3d and while at it, drop unneeded NULL checks since CLK > > calls are NULL-aware. > > I don't understand the supposed benefit of this. Yes, the clk API does > currently accept NULL as a valid clock and returns it as a dummy but > explicitly taking advantage of that in the way that this does just feels > more sloppy than the current behaviour. How? The clock is still checked by NULL by the clock framework. The above mentioned patch is simply wrong (taking into account modern behaviour of CCF APIs) and reverting it clears things. -- With Best Regards, Andy Shevchenko