From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: coresight@lists.linaro.org, rjw@rjwysocki.net,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 23/30] coresight: Add support for releasing platform specific data
Date: Mon, 13 May 2019 16:40:46 -0600 [thread overview]
Message-ID: <20190513224046.GH16162@xps15> (raw)
In-Reply-To: <1557226378-10131-24-git-send-email-suzuki.poulose@arm.com>
On Tue, May 07, 2019 at 11:52:50AM +0100, Suzuki K Poulose wrote:
> Add a helper to clean up the platform specific data provided
> by the firmware. This will be later used for dropping the necessary
> references when we switch to the fwnode handles for tracking
> connections.
>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> ---
> drivers/hwtracing/coresight/coresight-platform.c | 6 +++++-
> drivers/hwtracing/coresight/coresight-priv.h | 4 ++++
> drivers/hwtracing/coresight/coresight.c | 3 +++
> 3 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c
> index f500de6..53d6eed 100644
> --- a/drivers/hwtracing/coresight/coresight-platform.c
> +++ b/drivers/hwtracing/coresight/coresight-platform.c
> @@ -17,6 +17,7 @@
> #include <linux/cpumask.h>
> #include <asm/smp_plat.h>
>
> +#include "coresight-priv.h"
> /*
> * coresight_alloc_conns: Allocate connections record for each output
> * port from the device.
> @@ -311,7 +312,7 @@ struct coresight_platform_data *
> coresight_get_platform_data(struct device *dev)
> {
> int ret = -ENOENT;
> - struct coresight_platform_data *pdata;
> + struct coresight_platform_data *pdata = NULL;
> struct fwnode_handle *fwnode = dev_fwnode(dev);
>
> if (IS_ERR_OR_NULL(fwnode))
> @@ -329,6 +330,9 @@ coresight_get_platform_data(struct device *dev)
> if (!ret)
> return pdata;
> error:
> + if (!IS_ERR_OR_NULL(pdata))
> + /* Cleanup the connection information */
> + coresight_release_platform_data(pdata);
> return ERR_PTR(ret);
> }
> EXPORT_SYMBOL_GPL(coresight_get_platform_data);
> diff --git a/drivers/hwtracing/coresight/coresight-priv.h b/drivers/hwtracing/coresight/coresight-priv.h
> index e0684d0..c216421 100644
> --- a/drivers/hwtracing/coresight/coresight-priv.h
> +++ b/drivers/hwtracing/coresight/coresight-priv.h
> @@ -200,4 +200,8 @@ static inline void *coresight_get_uci_data(const struct amba_id *id)
> return 0;
> }
>
> +static inline void
> +coresight_release_platform_data(struct coresight_platform_data *pdata)
> +{}
> +
> #endif
> diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c
> index 96e1515..526141c 100644
> --- a/drivers/hwtracing/coresight/coresight.c
> +++ b/drivers/hwtracing/coresight/coresight.c
> @@ -1250,6 +1250,8 @@ struct coresight_device *coresight_register(struct coresight_desc *desc)
> err_free_csdev:
> kfree(csdev);
> err_out:
> + /* Cleanup the connection information */
> + coresight_release_platform_data(desc->pdata);
> return ERR_PTR(ret);
> }
> EXPORT_SYMBOL_GPL(coresight_register);
> @@ -1259,6 +1261,7 @@ void coresight_unregister(struct coresight_device *csdev)
> etm_perf_del_symlink_sink(csdev);
> /* Remove references of that device in the topology */
> coresight_remove_conns(csdev);
> + coresight_release_platform_data(csdev->pdata);
> device_unregister(&csdev->dev);
> }
> EXPORT_SYMBOL_GPL(coresight_unregister);
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> --
> 2.7.4
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-05-13 22:40 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-07 10:52 [PATCH v3 00/30] coresight: Support for ACPI bindings Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 01/30] coresight: funnel: Clean up device book keeping Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 02/30] coresight: replicator: Cleanup device tracking Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 03/30] coresight: tmc: Clean up device specific data Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 04/30] coresight: catu: Cleanup " Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 05/30] coresight: tpiu: Clean up " Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 06/30] coresight: stm: Cleanup " Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 07/30] coresight: etm: Clean up " Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 08/30] coresight: etb10: " Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 09/30] coresight: Use coresight device names for sinks in PMU attribute Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 10/30] coresight: Rename of_coresight to coresight-platform Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 11/30] coresight: etm3x: Rearrange cp14 access detection Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 12/30] coresight: stm: Rearrange probing the stimulus area Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 13/30] coresight: tmc-etr: Rearrange probing default buffer size Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 14/30] coresight: platform: Make memory allocation helper generic Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 15/30] coresight: Make sure device uses DT for obsolete compatible check Suzuki K Poulose
2019-05-13 16:18 ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 16/30] coresight: Introduce generic platform data helper Suzuki K Poulose
2019-05-13 16:39 ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 17/30] coresight: Make device to CPU mapping generic Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 18/30] coresight: Remove cpu field from platform data Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 19/30] coresight: Remove name from platform description Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 20/30] coresight: Cleanup coresight_remove_conns Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 21/30] coresight: Reuse platform data structure for connection tracking Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 22/30] coresight: Rearrange platform data probing Suzuki K Poulose
2019-05-13 17:21 ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 23/30] coresight: Add support for releasing platform specific data Suzuki K Poulose
2019-05-13 22:40 ` Mathieu Poirier [this message]
2019-05-07 10:52 ` [PATCH v3 24/30] coresight: platform: Use fwnode handle for device search Suzuki K Poulose
2019-05-13 17:39 ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 25/30] coresight: Use fwnode handle instead of device names Suzuki K Poulose
2019-05-13 17:59 ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 26/30] coresight: Use platform agnostic names Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 27/30] coresight: stm: ACPI support for parsing stimulus base Suzuki K Poulose
2019-05-07 10:52 ` [PATCH v3 28/30] coresight: Support for ACPI bindings Suzuki K Poulose
2019-05-13 22:28 ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 29/30] coresight: acpi: Support for AMBA components Suzuki K Poulose
2019-05-13 22:33 ` Mathieu Poirier
2019-05-07 10:52 ` [PATCH v3 30/30] coresight: acpi: Support for platform devices Suzuki K Poulose
2019-05-07 10:52 ` [TEST PATCH 31/30][EDK2] edk2-platform: juno: Update ACPI CoreSight Bindings Suzuki K Poulose
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190513224046.GH16162@xps15 \
--to=mathieu.poirier@linaro.org \
--cc=coresight@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=suzuki.poulose@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).