From patchwork Fri Jan 24 09:30:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233296 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 892F7C32771 for ; Fri, 24 Jan 2020 09:40:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DB30214AF for ; Fri, 24 Jan 2020 09:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579858832; bh=BIPbnlO9fACMo7/V30+Oas84K0C6QSVwu8VSeWhTK3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2gTir7BWJRdTeuUBbmFDNeVyruUTYeYGWsT8ROAbdGmxTJwbkPPWplC8mSrsce6Ib OEDlNxtg/L5HODO+1anqsDJiS3lbZqEQeFxRK6YHF92Eo+ztfyyWleGY3pRlJizCi1 5hCoelE2f5TjQ3W6dwa/Ae5BfWnXId4skVcuOhvI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730653AbgAXJk2 (ORCPT ); Fri, 24 Jan 2020 04:40:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:37782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731041AbgAXJkY (ORCPT ); Fri, 24 Jan 2020 04:40:24 -0500 Received: from localhost (unknown [145.15.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 92CCF208C4; Fri, 24 Jan 2020 09:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579858824; bh=BIPbnlO9fACMo7/V30+Oas84K0C6QSVwu8VSeWhTK3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ca1pr1bUbRmQs+5rBlGVlBDYhKPGcNCGAigR6DebDpxFZfrG47gBPZT29IxVQW2bt FS3GuMPr7M2zFjPqaPMasfG1yByavyT4VVJrrwBBYAAyLfhgFlKAjSSj1u00dEALod /SZk070UzLF6EkYiCgrtfNO0GqrOKQTe/I+XjPFc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Steven Price , Rob Herring , Sasha Levin Subject: [PATCH 5.4 051/102] drm/panfrost: Add missing check for pfdev->regulator Date: Fri, 24 Jan 2020 10:30:52 +0100 Message-Id: <20200124092814.017324612@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124092806.004582306@linuxfoundation.org> References: <20200124092806.004582306@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Steven Price [ Upstream commit 52282163dfa651849e905886845bcf6850dd83c2 ] When modifying panfrost_devfreq_target() to support a device without a regulator defined I missed the check on the error path. Let's add it. Reported-by: Dan Carpenter Fixes: e21dd290881b ("drm/panfrost: Enable devfreq to work without regulator") Signed-off-by: Steven Price Signed-off-by: Rob Herring Link: https://patchwork.freedesktop.org/patch/msgid/20190822093218.26014-1-steven.price@arm.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 12ff77dacc954..c1eb8cfe6aeb3 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -53,8 +53,10 @@ static int panfrost_devfreq_target(struct device *dev, unsigned long *freq, if (err) { dev_err(dev, "Cannot set frequency %lu (%d)\n", target_rate, err); - regulator_set_voltage(pfdev->regulator, pfdev->devfreq.cur_volt, - pfdev->devfreq.cur_volt); + if (pfdev->regulator) + regulator_set_voltage(pfdev->regulator, + pfdev->devfreq.cur_volt, + pfdev->devfreq.cur_volt); return err; }