Re: [PATCH] tpm: tpm_tis_spi: fix nodef CR50 tpm_tis_spi_resume is null

Jarkko Sakkinen <[email protected]>
Newsgroups org.kernel.vger.linux-integrity
Message-ID <[email protected]>
On Wed, Aug 12, 2026 at 06:09:14PM +0800, Li Jun wrote:
> if no define CONFIG_TCG_TIS_SPI_CR50 in config,
> the add of tpm_tis_spi_resume is null, this cause the tpm chip to
> fail to resume.
> 
> Signed-off-by: Li Jun <[email protected]>
> ---
>  drivers/char/tpm/tpm_tis_spi.h | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis_spi.h b/drivers/char/tpm/tpm_tis_spi.h
> index d0f66f6f1931..ced416ecd92c 100644
> --- a/drivers/char/tpm/tpm_tis_spi.h
> +++ b/drivers/char/tpm/tpm_tis_spi.h
> @@ -40,8 +40,12 @@ static inline int cr50_spi_probe(struct spi_device *spi)
>  }
>  #endif
>  
> -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_TCG_TIS_SPI_CR50)
> -extern int tpm_tis_spi_resume(struct device *dev);
> +#if defined(CONFIG_PM_SLEEP)
> +	#if defined(CONFIG_TCG_TIS_SPI_CR50)
> +		extern int tpm_tis_spi_resume(struct device *dev);
> +	#else
> +		#define  tpm_tis_spi_resume tpm_tis_resume
> +	#endif
>  #else
>  #define tpm_tis_spi_resume	NULL
>  #endif
> -- 
> 2.25.1
> 

Reviewed-by: Jarkko Sakkinen <[email protected]>

thanks

BR, Jarkko
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.