Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1165374lqb; Thu, 30 May 2024 02:08:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVTi0l0vv8v+bOL5VhnsGNN1c4VsyLUL0XFxSU3aJ+S2uF1InoBLYLDSqTlmQ26KA6B0LB/lR8gJ/XSvp8ph+rxZKWlqdxnfzF4hVh9xQ== X-Google-Smtp-Source: AGHT+IEh+FyBbMdrdYoaLbD4j+ts0a8ncM0eBbf1X1NW6JQJxWhu58tkLPIsYmVAigYtKMkg/wT2 X-Received: by 2002:a17:906:f8da:b0:a61:e825:8a75 with SMTP id a640c23a62f3a-a65e8e42688mr87585966b.18.1717060125818; Thu, 30 May 2024 02:08:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717060125; cv=pass; d=google.com; s=arc-20160816; b=YgvksVBu/3qperqHPA7INUmUS+kce6Q9/AHoBbUr6VgCEpb4oGGGkjQFXIVb/k1kzu QkI7ShDdDytMfK6zw9KkKaHUtxp2JHQ4tqq6KmslESCfyqSzbyu9MadAvdapZ3kxHABU DXclSr4+r+o6hCmmchVY69Z5UZ1Kbzzn80+PhgdlrBc+HS2GFzQayrCYgL4OKoJdh1x4 /BgAmFLgO/ZUg6gQC1106tjUnhy39coLTGf12yHR9WFV5kagwrXXcWdmO8NT7o+dfzJ4 14o7Kz3ZR54T6dkltQSjEGW78+SbH7VZCVVtSoUcOvHtE5grVPECTnorNO3Ow4Vm+fB1 JscA== 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=gmp8rs8G5Za6Ekd4eJjX5uWVgL9bWVS6AH0AYLHSkgM=; fh=TuSGxqTOfQdEnj8HQSeM8BmH3+vn3/ZCsy+2bFL5DH0=; b=xm7IrQq2JQpKMTBFY5+kdcMdAT6S4JRcr+JfHSPPKuRaRPv+RA7aoobjLwNQgMruAO ZQhnrnnsKYDSk9iX90KAol4b/FcAHLuUKm+3svmpWUKi15FXL9isc1+lhrCRZJvcBzPR 3cuTM3DbNe/ESf8xxUDnR6kKk69yUQIAczC3KaFPygDLUyWvUrLm29nMd2G9npNaaBu7 iTU4jlnxWPZM26omijbS5gFnisFVjbAohhkuoTXxU35KEdJhCGXxBYpld25Er3QRSBc6 0r7MjhMipsbMG7tEcJF+l0kV2wtUWQ54mvvUG/vfv+wZLEal1WKT9+v8ttlPf1jXmzZA PuiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ahN26wT4; 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-195141-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195141-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. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626c91837esi715833466b.265.2024.05.30.02.08.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 02:08:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195141-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ahN26wT4; 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-195141-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195141-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 EE07A1F23AF7 for ; Thu, 30 May 2024 09:08:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00A7618399E; Thu, 30 May 2024 09:08:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="ahN26wT4" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 BF96F142E6C; Thu, 30 May 2024 09:07:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717060081; cv=none; b=C3MxVYQfMNE0lFoYtAXKermCzmz7bpKOXrZL2rAjrrpw63GJjdyVzWdSPmsz1xEZy7NucRmcANZbO4ShXLcNId7dzLW4/1qfj5+dzk2aB3nDLZSQlVRDfySIaWLgVukwAn0nhkZ5FxQLkfdt402qE1S6K8MPImSxVUcez6O/1lw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717060081; c=relaxed/simple; bh=H+qCObtCZgHNJ48o6q7pLeyIu/O7/+J50S4buns9VCA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TAlFbIFXMaexuvUi1GoZx0GPKWwuu00SYd7CTvXGO+kiUUUhNZia1bUCvJ4QSu54fRF/d1k+Jgzw8VJ0zCC2mNJJQsrCOErLXms2RvKAPJmbexqEiuQoI4IYGcUJrDZKFvCmpqJanWeGOiSCFearj37WqmQ9urOH5gZsegZHKKA= 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=ahN26wT4; arc=none smtp.client-ip=198.47.23.249 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 lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44U97i4q097026; Thu, 30 May 2024 04:07:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1717060064; bh=gmp8rs8G5Za6Ekd4eJjX5uWVgL9bWVS6AH0AYLHSkgM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ahN26wT4nFzfFxshD4LP11QP01ZGpMYd4K6IAyyxtvzArTDhMPxrYKoPxGWj/O0mm 67qKEGmCJ7ojvFBp8TIKGBvtNSN7AffyS/42rxINDUXy6EJgMqV9mWsvs1DdOt1R/n EOKi0UxOyNzwEAfpadwEQRlNdo4YC/EYlggs+Il0= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44U97iwN000826 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 30 May 2024 04:07:44 -0500 Received: from DLEE103.ent.ti.com (157.170.170.33) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 30 May 2024 04:07:43 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE103.ent.ti.com (157.170.170.33) 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; Thu, 30 May 2024 04:07:43 -0500 Received: from uda0510294.dhcp.ti.com (uda0510294.dhcp.ti.com [10.24.69.66]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 44U97cln043154; Thu, 30 May 2024 04:07:41 -0500 From: Beleswar Padhi To: , CC: , , , , Subject: [PATCH 1/3] remoteproc: k3-r5: Use devm_rproc_alloc() helper Date: Thu, 30 May 2024 14:37:35 +0530 Message-ID: <20240530090737.655054-2-b-padhi@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240530090737.655054-1-b-padhi@ti.com> References: <20240530090737.655054-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 50e486bcfa10..26362a509ae3 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