From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 370A1379998 for ; Mon, 9 Feb 2026 12:45:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770641109; cv=none; b=FKb5bjsdWndWPZ7cV0OfHUCk+cHnWiiHTOG6mBYdw8UNEF6vK0eUCgGeBjF6JK/PjZeQ75V6TnGoGmc1pLVSUu96IpXJFvwai/gEsDBnNpJvuRNXEK6/DhQHhNnQa1QF+q55BTed8+uMEgpxdlVivaGFSVOr6QaqSJ//2sJs9RQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770641109; c=relaxed/simple; bh=ozvu735fRRCrA88oOmpcg0vHpswFzERK4w+1qWbR9AE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BYvBJrn03T7J96Djfr9nQ/I550K62/H9ZbZdxzzLK6V4CW25wTk7iuyPldg2rrY7W+2hRWKrdt9K08abAt/fenx4CRPuW6dofPQmPfmUzb2iGXnMwO8nQgfUqN0wPACGy5GxakWZlPhnalL3sa6W9nSMclqpKNpn7WSxwxKa35M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7DFB41063; Mon, 9 Feb 2026 04:45:02 -0800 (PST) Received: from e132581.arm.com (e132581.arm.com [10.1.196.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1EFF73F63F; Mon, 9 Feb 2026 04:45:06 -0800 (PST) From: Leo Yan Date: Mon, 09 Feb 2026 12:44:40 +0000 Subject: [PATCH v4 8/8] coresight: Unify bus unregistration via coresight_unregister() 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: 7bit Message-Id: <20260209-arm_coresight_refactor_dev_register-v4-8-62d6042f76f7@arm.com> References: <20260209-arm_coresight_refactor_dev_register-v4-0-62d6042f76f7@arm.com> In-Reply-To: <20260209-arm_coresight_refactor_dev_register-v4-0-62d6042f76f7@arm.com> To: Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , Greg Kroah-Hartman , Mathieu Poirier , Mao Jinlong Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Leo Yan X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1770641090; l=1542; i=leo.yan@arm.com; s=20250604; h=from:subject:message-id; bh=ozvu735fRRCrA88oOmpcg0vHpswFzERK4w+1qWbR9AE=; b=L7ZdoDbBLYGSJC9rCOxkQFjvVOYYApROpsvNLpnKCJ3lzQzVe7ytJ5moeZCcGIDZYmgsa418f +M75VOAydXKBCr4rEb5ZA/HsdceVdkpTjBmNTTQv8znyXaZnb1Mh1yq X-Developer-Key: i=leo.yan@arm.com; a=ed25519; pk=k4BaDbvkCXzBFA7Nw184KHGP5thju8lKqJYIrOWxDhI= Once a device is successfully registered, set the "registered" flag to true. After that point, all failures jump to the out_unlock label to unwind the flow via coresight_unregister(). Since failure handling is unified, the comment about resource release for the etm_perf_add_symlink_sink() failure is no need, remove it. Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/coresight-core.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c index 955af43010446803030973c72f07315492b2fcf3..56320ce49cb23bf7168f69b7f1ad820ca83b8365 100644 --- a/drivers/hwtracing/coresight/coresight-core.c +++ b/drivers/hwtracing/coresight/coresight-core.c @@ -1383,20 +1383,13 @@ struct coresight_device *coresight_register(struct coresight_desc *desc) goto out_unlock; } - ret = etm_perf_add_symlink_sink(csdev); - - /* - * As with the above, all resources are free'd explicitly via - * coresight_device_release() triggered from put_device(), which is in - * turn called from function device_unregister(). - */ - if (ret && ret != -EOPNOTSUPP) { - device_unregister(&csdev->dev); - goto out_unlock; - } /* Device is now registered */ registered = true; + ret = etm_perf_add_symlink_sink(csdev); + if (ret && ret != -EOPNOTSUPP) + goto out_unlock; + ret = coresight_create_conns_sysfs_group(csdev); if (ret) goto out_unlock; -- 2.34.1