From nobody Tue Dec 16 11:04:38 2025 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60C6B1B8EA8 for ; Fri, 16 Aug 2024 12:32:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723811530; cv=none; b=C7CbGPRH8y665I15J1deorPWQ65N9FK9GR1CsdD3P/UUhcaLn0xl3QWbRy/fNGDDKsvLIiwAAVQmu0v+iimP2/ihceku0VA70O27KzUjdnP1NzzbieoMembX40ue2RYDGgKapGg5T61YVOCl7U1XpO278EjlppyVvoaC6QaqrmA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723811530; c=relaxed/simple; bh=EucDhSv61CuFfP11sjE8SXVP+6M/bqH4uWFxl+dPrlw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GCBH+rQFa89ZX+tuxWwsORDprs2hA9v0Jhbry8yQdo8nJ87uAg3CMs1khC8rbiMklFp+FhgSHo+eZLvdFUZ9mKAYovLwxiSTkO+1kgShWomrTxPy9G0qrmDjMpJ2oUyBI4vFYoL5TwMtfbFNxVMTqZfHBo6NIEuxSzn0D6kk/xM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=RxoY7XtA; arc=none smtp.client-ip=209.85.219.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="RxoY7XtA" Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6bf6beda038so11430396d6.2 for ; Fri, 16 Aug 2024 05:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1723811527; x=1724416327; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=M3LNSQjxs6knu07oTqqXD2vtqpOl0khzecMqHctA770=; b=RxoY7XtApnJKWlHkPGcL5/0zb29zp/BcEtSQnI1OwybBUIi3FPhv5NY31knAw6AMSg TUNyw9wd+iMR65blqSWmSxe4PC4d8tZjQaGHbgcXB3InmDAQoDNKA06GdEY0QqyAAKuK 0iWJIG9tJPQjLmaHr6M96GWqX86ERko0wY8HI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723811527; x=1724416327; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M3LNSQjxs6knu07oTqqXD2vtqpOl0khzecMqHctA770=; b=JUR5vGdmYfaABFoH+W/x4vyJUE06L/Mg72my1tTYU222PMx0E6Y0tvhhwZcBQxvhoj NSDYgqgwNwvRlugIPIUPqFA7avRbxq3tud5cZDLjKn0y7+Nb3Y2q3hyr8d6ZRd8TF3DA InPfbd4vKIK7T84fFbTMutbaExI+tyxfAjyPYj2bckHiI/4rAI+ymfQSoOS8Puuf7bUK dTJaV4fM0JU/gGO84y4iQuZwV/re0nb48zE2iLHO3FwwNf68Tdt0FhV+gsp8bDNn56TY UBzvKael2y1XsRTkIlqjNWYuzpoqLLTR50M7DGLDceJ3KGJvAJNSXnhqxpTQx8Vyw5+G P0Ww== X-Forwarded-Encrypted: i=1; AJvYcCWaego8rGT/NJ5/IBJ7NJeq80RXzq3xNdjGgLG/nwiheDhLVittmgin3qWqZ3JFEQq+rVZ+whqNCz3sV7FhOn0qC3ULPv3bWBcSwGol X-Gm-Message-State: AOJu0Yyw5WXC3UM4og1ZzJJ//xVj549mO1KPQIORbUUkdShZh1jjGo83 h62ZnPLkBJuFudS74CJhht/MhTvdK1BdnAsWUwsnbSD4VKKPn07LcRSCDS3Txw== X-Google-Smtp-Source: AGHT+IHYD7aRmKGXgp+t/Ifehq3d65H0DR+M710hdZy/In2eSfy3ZYdXCjNDHAYDxXFnFLaObLyDlQ== X-Received: by 2002:a05:6214:3d9c:b0:6bd:83cb:1b8f with SMTP id 6a1803df08f44-6bf7ce5a411mr36042536d6.36.1723811527255; Fri, 16 Aug 2024 05:32:07 -0700 (PDT) Received: from denia.c.googlers.com (123.178.145.34.bc.googleusercontent.com. [34.145.178.123]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bf6fef3107sm16881426d6.121.2024.08.16.05.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 05:32:06 -0700 (PDT) From: Ricardo Ribalda Date: Fri, 16 Aug 2024 12:32:03 +0000 Subject: [PATCH v2 5/6] media: meson: vdec_1: Refactor vdec_1_stop() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240816-smatch-clock-v2-5-c63105db07e8@chromium.org> References: <20240816-smatch-clock-v2-0-c63105db07e8@chromium.org> In-Reply-To: <20240816-smatch-clock-v2-0-c63105db07e8@chromium.org> To: Sakari Ailus , =?utf-8?q?Krzysztof_Ha=C5=82asa?= , Mauro Carvalho Chehab , Sylwester Nawrocki , Andrzej Hajda , Neil Armstrong , Greg Kroah-Hartman , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Ricardo Ribalda X-Mailer: b4 0.13.0 Factor out all the power off logic, except the clk_disable_unprepare(), to a new function __vdec_1_stop(). This allows vdec_1_start() to explicitly clean-out the clock during the error-path. The following smatch warning is fixed: drivers/staging/media/meson/vdec/vdec_1.c:239 vdec_1_start() warn: 'core->v= dec_1_clk' from clk_prepare_enable() not released on lines: 239. Signed-off-by: Ricardo Ribalda --- drivers/staging/media/meson/vdec/vdec_1.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/meson/vdec/vdec_1.c b/drivers/staging/me= dia/meson/vdec/vdec_1.c index 3fe2de0c9331..a65cb4959446 100644 --- a/drivers/staging/media/meson/vdec/vdec_1.c +++ b/drivers/staging/media/meson/vdec/vdec_1.c @@ -129,7 +129,7 @@ static u32 vdec_1_vififo_level(struct amvdec_session *s= ess) return amvdec_read_dos(core, VLD_MEM_VIFIFO_LEVEL); } =20 -static int vdec_1_stop(struct amvdec_session *sess) +static void __vdec_1_stop(struct amvdec_session *sess) { struct amvdec_core *core =3D sess->core; struct amvdec_codec_ops *codec_ops =3D sess->fmt_out->codec_ops; @@ -158,10 +158,17 @@ static int vdec_1_stop(struct amvdec_session *sess) regmap_update_bits(core->regmap_ao, AO_RTI_GEN_PWR_SLEEP0, GEN_PWR_VDEC_1, GEN_PWR_VDEC_1); =20 - clk_disable_unprepare(core->vdec_1_clk); - if (sess->priv) codec_ops->stop(sess); +} + +static int vdec_1_stop(struct amvdec_session *sess) +{ + struct amvdec_core *core =3D sess->core; + + __vdec_1_stop(sess); + + clk_disable_unprepare(core->vdec_1_clk); =20 return 0; } @@ -235,7 +242,8 @@ static int vdec_1_start(struct amvdec_session *sess) return 0; =20 stop: - vdec_1_stop(sess); + __vdec_1_stop(sess); + clk_disable_unprepare(core->vdec_1_clk); return ret; } =20 --=20 2.46.0.184.g6999bdac58-goog