From patchwork Sun Jul 28 13:00:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13743933 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1ED4C3DA49 for ; Sun, 28 Jul 2024 13:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vd35QWujqoCcgjswql0d6hqDvtzrzubBkMD+QAru0Qg=; b=zAzlJV4L84GjU5PZIVqeghF+Qz 6Cly21LOyqp6tSTHzZcaE52xZ98Pmmhq9Fo1PK+KEb7kPt4pe+5K+J0aV4sOmu3++Fgh4ZxVN/7QK NKDu9ZkjzY9xk0wyDSzG6Ln06Fn2JW/utNXL/zY+IBtSbIlquP/nxVk8ZQMUBUOLs8ZURST28GS/b sruEmS7bJGu/cMbVtGXmmSzLahaVIsuX+yA73LTGjUFa8hIBbQXHtsvOH/w5gv2Fo1/FJPvleT5GP 8cQuHzw3+vOua8GB3yLCkulKbYoll9xdXFVNlf/NBofWidVcMY9NiPhErVFKWm1Syxp6xx3vLiw/G bhdvTEgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sY3Ww-00000008UNY-1U7Z; Sun, 28 Jul 2024 13:01:42 +0000 Received: from mout.gmx.net ([212.227.15.18]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sY3WW-00000008ULN-0Cdd for linux-arm-kernel@lists.infradead.org; Sun, 28 Jul 2024 13:01:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1722171645; x=1722776445; i=wahrenst@gmx.net; bh=vd35QWujqoCcgjswql0d6hqDvtzrzubBkMD+QAru0Qg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=H1+1N26dP3qxTbZhVbmD2kVxYDvt1bitmot0XfOTZRuZhUjzfLM8ETRZuo6e+TE5 mz5TrjZ1fjhIxqVAPBG+5e/GWQcVijDuoG1vgzpoG7VhnN7MvBw93jsDe02RvRF7s GvLi/mTmL1YbIrBGHkRnmlIkJJCyIZWqUj/XqouMgF1MK3FvEdv8fu09dajwn9m3d r/ZX4ARtdekRd8PHzVmo69IQ+LraHJn02aFegNXUwf3nJpNtQnIlDWuNFVYLIH5kD hQ+0py9UvYlokvYbcaaH9E/ncJuItdeC0kM//Sd8lBgrfXd+d0onftfEH35ax5WJO 2bCpTT/8gNxn4VcTNw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MUosN-1sh62W1D0r-00YhSR; Sun, 28 Jul 2024 15:00:45 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli , Ray Jui , Scott Branden , Maxime Ripard , Jassi Brar , Ulf Hansson , =?utf-8?q?Ma=C3=ADra_Canal?= , Jiri Slaby , Minas Harutyunyan Cc: Dave Stevenson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Lukas Wunner , Artur Petrosyan , Peter Robinson , dri-devel@lists.freedesktop.org, bcm-kernel-feedback-list@broadcom.com, linux-pm@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-list@raspberrypi.com, Stefan Wahren Subject: [PATCH V2 09/16] drm/vc4: v3d: simplify clock retrieval Date: Sun, 28 Jul 2024 15:00:22 +0200 Message-Id: <20240728130029.78279-1-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240728114200.75559-1-wahrenst@gmx.net> References: <20240728114200.75559-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:pBQ7NbVoNBvF4yIvkxD/tynf0vR3oAGG6Sf+gA8vYtZQi08lBDC 0zBDHPYYYpVokSsMiUDz1Ksp6GoGWJdQU3kmcobhVvR0YP3w1oFOOfSWCbtOrZybaJiSaHj tm/fqlFx2pn3945+FbIho/zZR0rmu9emmLdLoMtR3+3pG2sUXpLmI/oubUyxh3Cd5PbfFT3 nk++MfRVoNdOSJ943i1Ig== UI-OutboundReport: notjunk:1;M01:P0:+vPpj/uVAzA=;irWGD7Y+dbxeocYnUfFCB/5Yp/L z4Da8MKGgalWaaps++KCqlP+9YICpWybJ0fhiOJ0Gii2cptTJtZE7o1XyR41ky5lX5GPH4SoF r7JGfNT1F3kFWHww86FZHrmVWosKTiBAgB96ro+MN7UkJhWeQT8bbE7IzNLBnA6rWITk7UW8D /L3JyLZ2aWQCUYjLWnL7ZSo43Bu9ourvXdqgK27JlwX2VtvQCzOtXsn6BT0ruIRFeiUN+/N6G wTJJ+kMxvNO689UjmE5rhGj3D9/AYDBRqJL25P5V2IiYHOW+mfEtRHNtwBcSnxB5DI0Hiz1b5 enHRLTtop0tjf60g/gVYwfY+uRcER7LSJa/XlpQcJayq36eeD5e3+Ur5/u1mUvI+ekPW9HeOT hska2q072STvAOPKm5AGd3MPI8MdOdqSSF+TPUSpgHQPYkBYJn2v5EFGeoSS7pq6cOTXItnvT 2+1D1aNt7p9ZUhkDk1G1Bve9fyFnUXr9JMSOrulKajiI175u1knJva71Ous4GpqtZhLWKFWY2 WOpVwlQx5XRoJdG/e8ANdcaFry+/qKYPSc2fh54Ew1U59HRXNapLMUQloqLEjZHcrIOKktD5I dwpaqDGON5HOtLTpgBgzBDQ68jZYcIt8nOJYa/b7z95ZcsnoAJEifldjiqyh2hNyyXelQJMA6 haoxOUG5TEVH3OqJLo4PAH7pmJu3uwLCmVAk/IMqeKvH5lEpv9NlhbTgLM/f1bic/QHKUcliu exu3dqzqJMZgFTfQNMBEO5ryb2lGSfOjQMs3XXABqLSRIN5/SJWD2Npn/aAKFm/L9CQ8PNk/A rpVu1hBnuSakHZF9JrsP6uig== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240728_060116_381449_ACEC108F X-CRM114-Status: GOOD ( 11.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Common pattern of handling deferred probe can be simplified with dev_err_probe() and devm_clk_get_optional(). This results in much less code. Signed-off-by: Stefan Wahren Reviewed-by: MaĆ­ra Canal --- drivers/gpu/drm/vc4/vc4_v3d.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) -- 2.34.1 diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c index 1ede508a67d3..4bf3a8d24770 100644 --- a/drivers/gpu/drm/vc4/vc4_v3d.c +++ b/drivers/gpu/drm/vc4/vc4_v3d.c @@ -441,20 +441,11 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) vc4->v3d = v3d; v3d->vc4 = vc4; - v3d->clk = devm_clk_get(dev, NULL); + v3d->clk = devm_clk_get_optional(dev, NULL); if (IS_ERR(v3d->clk)) { int ret = PTR_ERR(v3d->clk); - if (ret == -ENOENT) { - /* bcm2835 didn't have a clock reference in the DT. */ - ret = 0; - v3d->clk = NULL; - } else { - if (ret != -EPROBE_DEFER) - dev_err(dev, "Failed to get V3D clock: %d\n", - ret); - return ret; - } + return dev_err_probe(dev, ret, "Failed to get V3D clock\n"); } ret = platform_get_irq(pdev, 0);