From patchwork Fri Apr 2 22:28:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 12181689 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99D78C43460 for ; Fri, 2 Apr 2021 22:29:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 556EE611ED for ; Fri, 2 Apr 2021 22:29:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235668AbhDBW3d (ORCPT ); Fri, 2 Apr 2021 18:29:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235567AbhDBW3b (ORCPT ); Fri, 2 Apr 2021 18:29:31 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BCB8C061788 for ; Fri, 2 Apr 2021 15:29:29 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id kr3-20020a17090b4903b02900c096fc01deso3127871pjb.4 for ; Fri, 02 Apr 2021 15:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u9ClulGPtKR9A7rITeJp1v1hARrcdfM+I5BoklnoMnw=; b=fnshem5entDFKpSgrA9NSoQeqydRYdFv5g8r6wSV16c8j7NoYQqKfF+/bg41xWpacT /r+qS3Ca5MB+cPQKPagDutZvYLdhIO8GcUDBhMq/Sn9ifdMvGFjXX9PrvY8Bb+2EGnRA FVV9NE7zWQtdqtHcHT0TOnetHxC+lb0hrFI5c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u9ClulGPtKR9A7rITeJp1v1hARrcdfM+I5BoklnoMnw=; b=LLUEqYUBoEbDiZaxqF4JQQQXWE7Mt9JvaDBXc4QbB7L3ETorJjqerXCljVKt/HdlTD WT4h3gn+V6XRrY0Lva7iLW/TZEWpu43Qs4arkDE0z+U8H+d9Jcfht2b6tbu42/95zt5F GtLMIlba0UkZ5E+26Td1MfqcgQFvdCvFdXX9AmtDZ/aEjBHY2iHSURY4ZqerVlCaDiSk LvCbjiuFTRUz4a5I9uCUW6gHKfOm7OgPiLlF6028stdjqUxAR9W1MbH/OWb+289FHVeS jQG8qINX9VO2NjmEhLUxJP4xG7DRn0BJFfss//LtVFwrzkkSuGxoOz+BShjjlU6chLcT 0oAQ== X-Gm-Message-State: AOAM532sqZ/vAQo2RGdVG42ZW8MM8JCGN2OGG4sz7KX6hFe58xN4VBGo y8bisT95tAVXhGWb/uJJrdx/kIIWcjrbOnBx X-Google-Smtp-Source: ABdhPJzBdc/sHqoL7CJFXE8mAC4IndrGbD4Eg+ATHS/EnjLfbECtxnsCG0vmYHmtml3I1vQ9G5hqsQ== X-Received: by 2002:a17:90a:ce0d:: with SMTP id f13mr15578491pju.85.1617402568895; Fri, 02 Apr 2021 15:29:28 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:6c58:fab2:c5e2:f2d7]) by smtp.gmail.com with ESMTPSA id t16sm9233094pfc.204.2021.04.02.15.29.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 15:29:28 -0700 (PDT) From: Douglas Anderson To: Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Sam Ravnborg Cc: Linus W , Bjorn Andersson , robdclark@chromium.org, Stephen Boyd , Steev Klimaszewski , Maarten Lankhorst , linux-arm-msm@vger.kernel.org, Stanislav Lisovskiy , Douglas Anderson , Robert Foss , Laurent Pinchart , Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 02/12] drm/bridge: ti-sn65dsi86: Simplify refclk handling Date: Fri, 2 Apr 2021 15:28:36 -0700 Message-Id: <20210402152701.v3.2.Ic9c04f960190faad5290738b2a35d73661862735@changeid> X-Mailer: git-send-email 2.31.0.208.g409f899ff0-goog In-Reply-To: <20210402222846.2461042-1-dianders@chromium.org> References: <20210402222846.2461042-1-dianders@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The clock framework makes it simple to deal with an optional clock. You can call clk_get_optional() and if the clock isn't specified it'll just return NULL without complaint. It's valid to pass NULL to enable/disable/prepare/unprepare. Let's make use of this to simplify things a tiny bit. Signed-off-by: Douglas Anderson Reviewed-by: Robert Foss Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Reviewed-by: Laurent Pinchart Reviewed-by: Andrzej Hajda --- (no changes since v2) Changes in v2: - Removed 2nd paragraph in commit message. drivers/gpu/drm/bridge/ti-sn65dsi86.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index 88df4dd0f39d..96fe8f2c0ea9 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -1275,14 +1275,9 @@ static int ti_sn_bridge_probe(struct i2c_client *client, return ret; } - pdata->refclk = devm_clk_get(pdata->dev, "refclk"); - if (IS_ERR(pdata->refclk)) { - ret = PTR_ERR(pdata->refclk); - if (ret == -EPROBE_DEFER) - return ret; - DRM_DEBUG_KMS("refclk not found\n"); - pdata->refclk = NULL; - } + pdata->refclk = devm_clk_get_optional(pdata->dev, "refclk"); + if (IS_ERR(pdata->refclk)) + return PTR_ERR(pdata->refclk); ret = ti_sn_bridge_parse_dsi_host(pdata); if (ret)