Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp132395rwb; Thu, 27 Jul 2023 10:19:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlHI9Ym8k+W1zfqZktoTdqKpjQ2lFuxDlpq6VW24X/dUzIqWaGUMbc8RI3bkpu4n591xygCL X-Received: by 2002:a05:6a00:2d82:b0:668:846b:9b5d with SMTP id fb2-20020a056a002d8200b00668846b9b5dmr5571276pfb.5.1690478388746; Thu, 27 Jul 2023 10:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690478388; cv=none; d=google.com; s=arc-20160816; b=ByqZUKIQuen00sZbIesPzlec7h+vOSd3dpK5yp5dC7MAbKCOda0HUJZb/gSsCLu829 jPxI1/QZBfKUGUnlSH+cHCJ4r8megN1haZs82I+db+2rWLKz7XmR7k/DO2/wV6ST7s0X r7DQdsBO5/zo15wfBbzu4roOIEw87U7LE0gDQ3OHYMVYC35439WjsSiB2efYieqSy1yI wY3fNgswKUQuv4QhvE7M0/pZecaYwvc3qg9/2K+dmt8kNlXE/09KH1X/1V5PlNulRi+E IjUBdEOgt/pPZcl1zpnsdvW0kiUc9trFMvApwHNicEyl2/G+aIza+nxOofgBEMrje0mN QhLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=sbcgdPd7//5eQ2jdrqnCNHQO+6z0ts+727955oICVbA=; fh=8akCWFoe4FbWUjYoO6+P3oWrKDiBPcRFZSLbGUiuoLs=; b=bLfz+1w7bmvZoN2vo+ti13LFejZf5zzuZUdeYfHwo8u92YqFn+Ps07Lwnzq1r3gMYw 8njNvdZq2XlKBrZdd/kkWDp23CTkZtay23f7NI75IF1VvJavNi4PT8fWZn9ruFcUSjHz 7gvBEaB8Zwo09pVyhZHuYhudn+6++s27g40uXi8GBiG53rs+AeSdfv34Vb4VeJcDKvDi 27f3VgSqRo2w1FYFl4X7+C+Bz/q5WsSAD5nRTRpBnmJ4V2zJpwBGjyo30hMt/4BVtjY6 mj+cIBX2WtiYtfJe3bu7JZ9VuIOL074QU0E6LFhiu9mEDFogQQAaGN42324/s677k+Pb jbTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=ffE4gZ1m; 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=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l125-20020a632583000000b0055c1760dd8esi1538791pgl.380.2023.07.27.10.19.36; Thu, 27 Jul 2023 10:19:48 -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=@163.com header.s=s110527 header.b=ffE4gZ1m; 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=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231424AbjG0REg (ORCPT + 99 others); Thu, 27 Jul 2023 13:04:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231314AbjG0REf (ORCPT ); Thu, 27 Jul 2023 13:04:35 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.215]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 75ED52D75 for ; Thu, 27 Jul 2023 10:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=sbcgdPd7//5eQ2jdrq nCNHQO+6z0ts+727955oICVbA=; b=ffE4gZ1mCC8ezIx91G59KavYQcd9/fejqp LLXv7V71YIKTYrraooyMUheXmLU5OVNpCUYZvTm8cBc4srp2vg8PCLUpK/hwGCTH KT0voO/8hh7PdktVxHq/hpvgWYdev9SMwZ3FhnnEsuV+tCf2rvRFFD46AxFDb25p 5ebg/x0mw= Received: from localhost.localdomain (unknown [202.112.113.212]) by zwqz-smtp-mta-g3-4 (Coremail) with SMTP id _____wAXXCF+o8JkAvnRBQ--.3132S4; Fri, 28 Jul 2023 01:04:06 +0800 (CST) From: Yuanjun Gong To: Joel Stanley , David Airlie , Daniel Vetter , Andrew Jeffery , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Yuanjun Gong Subject: [PATCH 1/1] gpu: drm: aspeed: fix value check in aspeed_gfx_load() Date: Fri, 28 Jul 2023 01:03:42 +0800 Message-Id: <20230727170342.18506-1-ruc_gongyuanjun@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: _____wAXXCF+o8JkAvnRBQ--.3132S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jr4rAw4fGw18tFWfKw4UArb_yoWDCFgE9r WxursxXFsrurWDGa45Zws3Jr92kF97uFWxWF18t34YyFy7ZryDXrWUWa4DZ343Ja1IyF98 tF1UZw43CFnrGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRNdgAUUUUUU== X-Originating-IP: [202.112.113.212] X-CM-SenderInfo: 5uxfsw5rqj53pdqm30i6rwjhhfrp/1tbiUQe55WDESc5Q-gAAsH 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,RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_L4,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 in aspeed_gfx_load(), check the return value of clk_prepare_enable() and return the error code if clk_prepare_enable() returns an unexpected value. Fixes: 4f2a8f5898ec ("drm: Add ASPEED GFX driver") Signed-off-by: Yuanjun Gong --- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c index c8c7f8215155..3bfa39bc4f7e 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c @@ -199,7 +199,11 @@ static int aspeed_gfx_load(struct drm_device *drm) "missing or invalid clk device tree entry"); return PTR_ERR(priv->clk); } - clk_prepare_enable(priv->clk); + ret = clk_prepare_enable(priv->clk); + if (ret) { + dev_err(&pdev->dev, "Failed to enable clock\n"); + return ret; + } /* Sanitize control registers */ writel(0, priv->base + CRT_CTRL1); -- 2.17.1