Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1378877lqj; Mon, 3 Jun 2024 22:17:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXOyhzwar/SAgkBm62HEXs9z+d0SRQnWFRRZ1mPrlKwhrFOJnmBUE68UeLUteJc6C/MXeLIBEkqGiyEbSUtiyPwI8MWCfjB0Xlfo14/IA== X-Google-Smtp-Source: AGHT+IFujeiiPvhL0P6FX6QvOfd812CGEnOaYYSmafMU8SYzjPij3/4a5w3LdEJ8WHCRePrA3ab+ X-Received: by 2002:a17:906:494b:b0:a68:a476:6957 with SMTP id a640c23a62f3a-a69546aebeamr113481866b.24.1717478269426; Mon, 03 Jun 2024 22:17:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717478269; cv=pass; d=google.com; s=arc-20160816; b=ba+x2qLDsg2T80Ct3alsJElP0cMoKqm3YAd+NgnsSEXs5gHAFkNrgsGyfxCmoC0TkP 59FM8tzOXt1akSPq6Bi17JTLZ6lEeB7C7FL7JnRi9t94P2Epc+PkGRANIsrSLL8/UA0B h3H5JUsyniQKTuKFmGFt9jKSMWgMMhYvwxHlVZqbZk4V7wOE3K9NeoJDoFMCuZTU1zPW Hp3YMpY/spb3FIQKT1N6CJKvk0jV+SVo2Ek3a4J0z5JSsVXLpEDJYw/2ja2vn9xWmYA5 UFv7Y9MAUXxtGtOrYdZaES6XyEEK8E8qezk25LWEIF+lg4jDwODSmUcmEFjzRegYcNxE Gn+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vgrQhwQ+LZZ7+U766LpZ5SROVnCeOnpXR/Ie63+uDow=; fh=TuSGxqTOfQdEnj8HQSeM8BmH3+vn3/ZCsy+2bFL5DH0=; b=xdq4K75WZtQzGUQ+5mxRL6lA+hm77LeJvGqXZcuwh6Q+Z6IfQ++7sGy/AMIdw/R/Pc 6N4ozlux3PmPt9h31ev1BA1SXn5qdC+i49KyoMC/XAJjTLWuPUFrm2IvUHcHZUsOEXIS hwPj2XQIqbNzmrZ6x/3oiKe5e/yHq8fqve4VxX9tjI6xI7qm2/tGqP8QsUjeQeLuult9 rkDE/+QPA2fjh5PjrTf3TdugUr9GXyhE8EUT9oXHCa5ORqWOV0XDWWHMwLWzF8fRkkMT PzMn23sEVnE/ARJx0OOeXSoPJ8+QmeyT3PT8lSuMtMlHsnfrRDvRMpm7K2p4C+SXSEiE eHQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=aRw5Lweo; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-200053-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200053-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a68e920ea40si242925166b.173.2024.06.03.22.17.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 22:17:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200053-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=aRw5Lweo; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-200053-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200053-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 039871F24974 for ; Tue, 4 Jun 2024 05:17:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75E9F13DDBA; Tue, 4 Jun 2024 05:17:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="aRw5Lweo" Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20DB37C6D5; Tue, 4 Jun 2024 05:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.248 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717478254; cv=none; b=KyqhQGlrnMLrEbIvGAKzSARGTxDhgszwWCBObPO+CLn5c82mHukN0JWQEBp3aiRu0/Z7Ifv0zOkwK6CIGfUFJbmmQtpgCsiPMHCSHy0KIyFxa/am3QV5L4YWBZTwDEa7l95Bb++vOiiUSYS2H9uwDeSc9Sczx442eHT9hoemxw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717478254; c=relaxed/simple; bh=tMZU77ZpEJIXR41I2pln5JIOX/gnB5gXPAarg47/1LU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dCPq4lQtibgvTmJsPw5gL/oXZlAlH/YdI5WV3zo+37nMNYzyUcHSIxj0bJnQBOOoe+a8no8L0M+vhHq2AXJgHohc/5r24IPhWkx79aGEbdsIf0NsF0TctwllvHX+Kj+iXrjFnbqyOF9Q83zWCHL3K0uazexTQZCgyl5Y7WN5DSo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=aRw5Lweo; arc=none smtp.client-ip=198.47.23.248 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 4545HSKQ004324; Tue, 4 Jun 2024 00:17:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1717478248; bh=vgrQhwQ+LZZ7+U766LpZ5SROVnCeOnpXR/Ie63+uDow=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=aRw5LweoH+I5Y3w3kQXVsEPgt5wvwhaPPxXnBYpK/39LQ+2aqNrX9HdzrVwgaV8Po Gg+1hss64jJGFBXM2kM3V3oeMieFdlHGIm0E6wNn+QEUpWmOrk/5HiFLmWGRdO4CPK BkFTOJiHXoeyo2wyYXPFD8xAeKWYKWUT7a/4liwY= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 4545HSl1031490 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 4 Jun 2024 00:17:28 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 4 Jun 2024 00:17:28 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 4 Jun 2024 00:17:28 -0500 Received: from uda0510294.dhcp.ti.com (uda0510294.dhcp.ti.com [10.24.69.66]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 4545HNG5067975; Tue, 4 Jun 2024 00:17:26 -0500 From: Beleswar Padhi To: , CC: , , , , Subject: [PATCH v2 1/3] remoteproc: k3-r5: Use devm_rproc_alloc() helper Date: Tue, 4 Jun 2024 10:47:20 +0530 Message-ID: <20240604051722.3608750-2-b-padhi@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604051722.3608750-1-b-padhi@ti.com> References: <20240604051722.3608750-1-b-padhi@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Use the device lifecycle managed allocation function. This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Beleswar Padhi --- drivers/remoteproc/ti_k3_r5_remoteproc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index 50e486bcfa103..26362a509ae3c 100644 --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c @@ -1258,8 +1258,8 @@ static int k3_r5_cluster_rproc_init(struct platform_device *pdev) goto out; } - rproc = rproc_alloc(cdev, dev_name(cdev), &k3_r5_rproc_ops, - fw_name, sizeof(*kproc)); + rproc = devm_rproc_alloc(cdev, dev_name(cdev), &k3_r5_rproc_ops, + fw_name, sizeof(*kproc)); if (!rproc) { ret = -ENOMEM; goto out; @@ -1351,7 +1351,6 @@ static int k3_r5_cluster_rproc_init(struct platform_device *pdev) err_add: k3_r5_reserved_mem_exit(kproc); err_config: - rproc_free(rproc); core->rproc = NULL; out: /* undo core0 upon any failures on core1 in split-mode */ @@ -1398,7 +1397,6 @@ static void k3_r5_cluster_rproc_exit(void *data) k3_r5_reserved_mem_exit(kproc); - rproc_free(rproc); core->rproc = NULL; } } -- 2.34.1