From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS autolearn=ham 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 2E1F2C43219 for ; Thu, 25 Apr 2019 17:12:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A809C2067C for ; Thu, 25 Apr 2019 17:12:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TCED2IlJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A809C2067C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+f2Ztzm5gyJ1STOrsThK9lBhSyX6E5SZOVY8AloUJbw=; b=TCED2IlJ8DNE4vGDHDmftDT62 fQQ9Y1gxvoiYYhY9wiPvSeZPfam0VJd352sHzHE8WgPx98wG71YXGtwXWNQ4C0L76U9KGkVmU1ZBy L1+1R8QJE4CHmj7/SUMZ6rQ29zmZ4GxJk3Hd2ChC/3qMpiCTigh2u4uQR4Z9sp5J5d05iik48iMXl MtP2z2J1tpsC6QK/735HkrkSbVKLduo0/QeMhuqaR/E41OmFhsB+mgOsbf6dQvffhAMTLHZshCJmF EFUsNEQaONmBYKF/PL0HSKachB210im2EB+5APTt3IoJMtPZRzBj2ilHaOxZMCeowpl9tPlxRBj5x k4GzlgzjQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJhvN-00011j-DK; Thu, 25 Apr 2019 17:12:41 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJhvK-00011H-7z for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2019 17:12:39 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5E57B80D; Thu, 25 Apr 2019 10:12:37 -0700 (PDT) Received: from [10.1.196.93] (en101.cambridge.arm.com [10.1.196.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D4BF73F246; Thu, 25 Apr 2019 10:12:35 -0700 (PDT) Subject: Re: [PATCH v2 25/36] coresight: Rearrange platform data probing To: mathieu.poirier@linaro.org References: <1555344260-12375-1-git-send-email-suzuki.poulose@arm.com> <1555344260-12375-26-git-send-email-suzuki.poulose@arm.com> <20190422171608.GB6402@xps15> From: Suzuki K Poulose Message-ID: <3cee6641-a376-6caf-6b32-297fb2cb32df@arm.com> Date: Thu, 25 Apr 2019 18:12:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190422171608.GB6402@xps15> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190425_101238_289940_432470C8 X-CRM114-Status: GOOD ( 17.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: coresight@lists.linaro.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, robert.walker@arm.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 22/04/2019 18:16, Mathieu Poirier wrote: > On Mon, Apr 15, 2019 at 05:04:08PM +0100, Suzuki K Poulose wrote: >> We are about to introduce methods to clean up the platform data >> as we switch to tracking the device reference from "name" to "fwnode >> handles" for device connections. This requires us to drop the fwnode >> handle references when the data is no longer required - i.e, when >> the device probe fails or the device gets unregistered. >> >> In order to consolidate the invocation of the cleanup, we delay the >> platform probing to the very last minute, possibly before invoking >> the coresight_register. Then, we leave the coresight core code to >> do the clean up. i.e, if the coresight_register fails, it takes >> care of freeing the data. Otherwise, coresight_unregister will >> do the necessary operations. >> >> Cc: Mathieu Poirier >> Signed-off-by: Suzuki K Poulose ... >> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c >> index 7ff0989..7c53fb2 100644 >> --- a/drivers/hwtracing/coresight/coresight-etm4x.c >> +++ b/drivers/hwtracing/coresight/coresight-etm4x.c >> @@ -981,11 +981,6 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) >> if (!drvdata) >> return -ENOMEM; >> >> - pdata = coresight_get_platform_data(dev); >> - if (IS_ERR(pdata)) >> - return PTR_ERR(pdata); >> - adev->dev.platform_data = pdata; >> - >> dev_set_drvdata(dev, drvdata); >> >> /* Validity for the resource is already checked by the AMBA core */ >> @@ -1028,6 +1023,11 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) >> etm4_init_trace_id(drvdata); >> etm4_set_default(&drvdata->config); >> >> + pdata = coresight_get_platform_data(dev); >> + if (IS_ERR(pdata)) >> + return PTR_ERR(pdata); > > Here you need to "goto err_arch_supported" instead of returning. Thanks for catching that ! Fixed. Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel