All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: Jens Wiklander <jens.wiklander@linaro.org>,
	Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	Sumit Garg <sumit.garg@kernel.org>,
	linux-integrity@vger.kernel.org,
	op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org,
	Sumit Garg <sumit.garg@oss.qualcomm.com>
Subject: Re: [PATCH v2 17/17] tpm/tpm_ftpm_tee: Make use of tee bus methods
Date: Tue, 16 Dec 2025 00:53:28 +0200	[thread overview]
Message-ID: <aUCRaIL9DFSZcA7O@kernel.org> (raw)
In-Reply-To: <7bb98eeb8a478ca69344499f2e58016bbf787313.1765791463.git.u.kleine-koenig@baylibre.com>

On Mon, Dec 15, 2025 at 03:16:47PM +0100, Uwe Kleine-König wrote:
> The tee bus got dedicated callbacks for probe and remove.

nit: "TEE subsystem has implemented callbacks for probe() and remove()".

Or this what I presume has happened: someone has implemented new
callbacks to subsystem (vs randomly appearing from the divine
skies).

> Make use of these. This fixes a runtime warning about the driver needing
> to be converted to the bus methods.
> 
> Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
>  drivers/char/tpm/tpm_ftpm_tee.c | 26 +++++++++++++++++++-------
>  1 file changed, 19 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_ftpm_tee.c b/drivers/char/tpm/tpm_ftpm_tee.c
> index e5fbc70b0eca..20294d1953a3 100644
> --- a/drivers/char/tpm/tpm_ftpm_tee.c
> +++ b/drivers/char/tpm/tpm_ftpm_tee.c
> @@ -169,7 +169,7 @@ static int ftpm_tee_match(struct tee_ioctl_version_data *ver, const void *data)
>   * Return:
>   *	On success, 0. On failure, -errno.
>   */
> -static int ftpm_tee_probe(struct device *dev)
> +static int ftpm_tee_probe_generic(struct device *dev)
>  {
>  	int rc;
>  	struct tpm_chip *chip;
> @@ -251,11 +251,18 @@ static int ftpm_tee_probe(struct device *dev)
>  	return rc;
>  }
>  
> +static int ftpm_tee_probe(struct tee_client_device *tcdev)
> +{
> +	struct device *dev = &tcdev->dev;
> +
> +	return ftpm_tee_probe_generic(dev);
> +}
> +
>  static int ftpm_plat_tee_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  
> -	return ftpm_tee_probe(dev);
> +	return ftpm_tee_probe_generic(dev);
>  }
>  
>  /**
> @@ -265,7 +272,7 @@ static int ftpm_plat_tee_probe(struct platform_device *pdev)
>   * Return:
>   *	0 always.
>   */
> -static int ftpm_tee_remove(struct device *dev)
> +static void ftpm_tee_remove_generic(struct device *dev)
>  {
>  	struct ftpm_tee_private *pvt_data = dev_get_drvdata(dev);
>  
> @@ -285,15 +292,20 @@ static int ftpm_tee_remove(struct device *dev)
>  	tee_client_close_context(pvt_data->ctx);
>  
>  	/* memory allocated with devm_kzalloc() is freed automatically */
> +}
>  
> -	return 0;
> +static void ftpm_tee_remove(struct tee_client_device *tcdev)
> +{
> +	struct device *dev = &tcdev->dev;
> +
> +	ftpm_tee_remove_generic(dev);
>  }
>  
>  static void ftpm_plat_tee_remove(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  
> -	ftpm_tee_remove(dev);
> +	ftpm_tee_remove_generic(dev);
>  }
>  
>  /**
> @@ -335,11 +347,11 @@ static const struct tee_client_device_id optee_ftpm_id_table[] = {
>  MODULE_DEVICE_TABLE(tee, optee_ftpm_id_table);
>  
>  static struct tee_client_driver ftpm_tee_driver = {
> +	.probe		= ftpm_tee_probe,
> +	.remove		= ftpm_tee_remove,
>  	.id_table	= optee_ftpm_id_table,
>  	.driver		= {
>  		.name		= "optee-ftpm",
> -		.probe		= ftpm_tee_probe,
> -		.remove		= ftpm_tee_remove,
>  	},
>  };
>  
> -- 
> 2.47.3
> 

BR, Jarkko

WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen via OP-TEE <op-tee@lists.trustedfirmware.org>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	Sumit Garg <sumit.garg@kernel.org>,
	linux-integrity@vger.kernel.org,
	op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org,
	Sumit Garg <sumit.garg@oss.qualcomm.com>
Subject: Re: [PATCH v2 17/17] tpm/tpm_ftpm_tee: Make use of tee bus methods
Date: Tue, 16 Dec 2025 00:53:28 +0200	[thread overview]
Message-ID: <aUCRaIL9DFSZcA7O@kernel.org> (raw)
In-Reply-To: <7bb98eeb8a478ca69344499f2e58016bbf787313.1765791463.git.u.kleine-koenig@baylibre.com>

On Mon, Dec 15, 2025 at 03:16:47PM +0100, Uwe Kleine-König wrote:
> The tee bus got dedicated callbacks for probe and remove.

nit: "TEE subsystem has implemented callbacks for probe() and remove()".

Or this what I presume has happened: someone has implemented new
callbacks to subsystem (vs randomly appearing from the divine
skies).

> Make use of these. This fixes a runtime warning about the driver needing
> to be converted to the bus methods.
> 
> Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
>  drivers/char/tpm/tpm_ftpm_tee.c | 26 +++++++++++++++++++-------
>  1 file changed, 19 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_ftpm_tee.c b/drivers/char/tpm/tpm_ftpm_tee.c
> index e5fbc70b0eca..20294d1953a3 100644
> --- a/drivers/char/tpm/tpm_ftpm_tee.c
> +++ b/drivers/char/tpm/tpm_ftpm_tee.c
> @@ -169,7 +169,7 @@ static int ftpm_tee_match(struct tee_ioctl_version_data *ver, const void *data)
>   * Return:
>   *	On success, 0. On failure, -errno.
>   */
> -static int ftpm_tee_probe(struct device *dev)
> +static int ftpm_tee_probe_generic(struct device *dev)
>  {
>  	int rc;
>  	struct tpm_chip *chip;
> @@ -251,11 +251,18 @@ static int ftpm_tee_probe(struct device *dev)
>  	return rc;
>  }
>  
> +static int ftpm_tee_probe(struct tee_client_device *tcdev)
> +{
> +	struct device *dev = &tcdev->dev;
> +
> +	return ftpm_tee_probe_generic(dev);
> +}
> +
>  static int ftpm_plat_tee_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  
> -	return ftpm_tee_probe(dev);
> +	return ftpm_tee_probe_generic(dev);
>  }
>  
>  /**
> @@ -265,7 +272,7 @@ static int ftpm_plat_tee_probe(struct platform_device *pdev)
>   * Return:
>   *	0 always.
>   */
> -static int ftpm_tee_remove(struct device *dev)
> +static void ftpm_tee_remove_generic(struct device *dev)
>  {
>  	struct ftpm_tee_private *pvt_data = dev_get_drvdata(dev);
>  
> @@ -285,15 +292,20 @@ static int ftpm_tee_remove(struct device *dev)
>  	tee_client_close_context(pvt_data->ctx);
>  
>  	/* memory allocated with devm_kzalloc() is freed automatically */
> +}
>  
> -	return 0;
> +static void ftpm_tee_remove(struct tee_client_device *tcdev)
> +{
> +	struct device *dev = &tcdev->dev;
> +
> +	ftpm_tee_remove_generic(dev);
>  }
>  
>  static void ftpm_plat_tee_remove(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  
> -	ftpm_tee_remove(dev);
> +	ftpm_tee_remove_generic(dev);
>  }
>  
>  /**
> @@ -335,11 +347,11 @@ static const struct tee_client_device_id optee_ftpm_id_table[] = {
>  MODULE_DEVICE_TABLE(tee, optee_ftpm_id_table);
>  
>  static struct tee_client_driver ftpm_tee_driver = {
> +	.probe		= ftpm_tee_probe,
> +	.remove		= ftpm_tee_remove,
>  	.id_table	= optee_ftpm_id_table,
>  	.driver		= {
>  		.name		= "optee-ftpm",
> -		.probe		= ftpm_tee_probe,
> -		.remove		= ftpm_tee_remove,
>  	},
>  };
>  
> -- 
> 2.47.3
> 

BR, Jarkko

  reply	other threads:[~2025-12-15 22:53 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15 14:16 [PATCH v2 00/17] tee: Use bus callbacks instead of driver callbacks Uwe Kleine-König
2025-12-15 14:16 ` [PATCH v2 01/17] tee: Add some helpers to reduce boilerplate for tee client drivers Uwe Kleine-König
2025-12-15 14:16 ` [PATCH v2 02/17] tee: Add probe, remove and shutdown bus callbacks to tee_client_driver Uwe Kleine-König
2025-12-17  8:54   ` Sumit Garg via OP-TEE
2025-12-17  8:54     ` Sumit Garg
2025-12-17 11:31     ` Uwe Kleine-König
2025-12-17 11:31       ` Uwe Kleine-König
2025-12-15 14:16 ` [PATCH v2 03/17] tee: Adapt documentation to cover recent additions Uwe Kleine-König
2025-12-15 14:16 ` [PATCH v2 04/17] hwrng: optee - Make use of module_tee_client_driver() Uwe Kleine-König
2025-12-19  6:22   ` Herbert Xu
2025-12-19  6:22     ` Herbert Xu via OP-TEE
2025-12-15 14:16 ` [PATCH v2 05/17] hwrng: optee - Make use of tee bus methods Uwe Kleine-König
2025-12-19  6:22   ` Herbert Xu
2025-12-19  6:22     ` Herbert Xu via OP-TEE
2025-12-15 14:16 ` [PATCH v2 06/17] rtc: optee: Migrate to use tee specific driver registration function Uwe Kleine-König
2025-12-15 14:16 ` [PATCH v2 07/17] rtc: optee: Make use of tee bus methods Uwe Kleine-König
2025-12-15 14:16 ` [PATCH v2 08/17] efi: stmm: Make use of module_tee_client_driver() Uwe Kleine-König
2025-12-16  9:20   ` Ilias Apalodimas
2025-12-16  9:20     ` Ilias Apalodimas
2025-12-15 14:16 ` [PATCH v2 09/17] efi: stmm: Make use of tee bus methods Uwe Kleine-König
2025-12-16  9:19   ` Ilias Apalodimas
2025-12-16  9:19     ` Ilias Apalodimas
2025-12-15 14:16 ` [PATCH v2 10/17] firmware: arm_scmi: optee: Make use of module_tee_client_driver() Uwe Kleine-König
2025-12-15 14:16 ` [PATCH v2 11/17] firmware: arm_scmi: Make use of tee bus methods Uwe Kleine-König
2025-12-15 14:16 ` [PATCH v2 12/17] firmware: tee_bnxt: Make use of module_tee_client_driver() Uwe Kleine-König
2025-12-15 14:16 ` [PATCH v2 13/17] firmware: tee_bnxt: Make use of tee bus methods Uwe Kleine-König
2025-12-15 14:16 ` [PATCH v2 14/17] KEYS: trusted: Migrate to use tee specific driver registration function Uwe Kleine-König
2025-12-15 22:01   ` Jarkko Sakkinen
2025-12-15 22:01     ` Jarkko Sakkinen via OP-TEE
2025-12-15 14:16 ` [PATCH v2 15/17] KEYS: trusted: Make use of tee bus methods Uwe Kleine-König
2025-12-15 22:04   ` Jarkko Sakkinen
2025-12-15 22:04     ` Jarkko Sakkinen via OP-TEE
2025-12-15 14:16 ` [PATCH v2 16/17] tpm/tpm_ftpm_tee: Make use of tee specific driver registration Uwe Kleine-König
2025-12-15 22:48   ` Jarkko Sakkinen
2025-12-15 22:48     ` Jarkko Sakkinen via OP-TEE
2025-12-15 14:16 ` [PATCH v2 17/17] tpm/tpm_ftpm_tee: Make use of tee bus methods Uwe Kleine-König
2025-12-15 22:53   ` Jarkko Sakkinen [this message]
2025-12-15 22:53     ` Jarkko Sakkinen via OP-TEE
2025-12-18  7:21 ` [PATCH v2 00/17] tee: Use bus callbacks instead of driver callbacks Jens Wiklander
2025-12-18 13:53   ` Alexandre Belloni
2025-12-18 13:53     ` Alexandre Belloni via OP-TEE
2025-12-18 16:29     ` Jens Wiklander
2026-01-05  9:16       ` Jens Wiklander
2026-01-06  5:04         ` Herbert Xu
2026-01-06 13:40         ` Sudeep Holla
2026-01-07  9:38           ` Jens Wiklander
2026-01-08 12:38         ` Jarkko Sakkinen
2026-01-06  9:39 ` Jon Hunter
2026-01-06  9:39   ` Jon Hunter via OP-TEE
2026-01-07  9:36   ` Jens Wiklander

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=aUCRaIL9DFSZcA7O@kernel.org \
    --to=jarkko@kernel.org \
    --cc=jens.wiklander@linaro.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=op-tee@lists.trustedfirmware.org \
    --cc=peterhuewe@gmx.de \
    --cc=sumit.garg@kernel.org \
    --cc=sumit.garg@oss.qualcomm.com \
    --cc=u.kleine-koenig@baylibre.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.