Skip to contentSkip to conversation

tpm: remove extraneous #ifdef

PATCH In review Arnd Bergmann 4 participants 9 messages Sep 15 – Sep 24

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: remove extraneous #ifdef

From: Arnd Bergmann <[email protected]>

Changing to DEFINE_SIMPLE_DEV_PM_OPS() broke here because the tpm_inf_resume() function is hidden in an #ifdef:

drivers/char/tpm/tpm_infineon.c:615:61: error: 'tpm_inf_resume' undeclared here (not in a function); did you mean 'tpm_pm_resume'?
615 | static DEFINE_SIMPLE_DEV_PM_OPS(tpm_inf_pm, tpm_pm_suspend, tpm_inf_resume);
| ^~~~~~~~~~~~~~

Remove the #ifdef check.

Fixes 2249200ee420 ("tpm: use DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr()")
---
 drivers/char/tpm/tpm_infineon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/char/tpm/tpm_infineon.c +1 -2
index 84a0d3e5f679..d6edd2ca39a5 100644
@@ -594,7 +594,6 @@ static void tpm_inf_pnp_remove(struct pnp_dev *dev)
 	}
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tpm_inf_resume(struct device *dev)
 {
 	/* Re-configure TPM after suspending */
@@ -611,7 +610,7 @@ static int tpm_inf_resume(struct device *dev)
 	tpm_data_out(RESET_LP_IRQC_DISABLE, CMD);
 	return tpm_pm_resume(dev);
 }
-#endif
+
 static DEFINE_SIMPLE_DEV_PM_OPS(tpm_inf_pm, tpm_pm_suspend, tpm_inf_resume);
 
 static struct pnp_driver tpm_inf_pnp_driver = {
Signature · 1 line
2.53.0
Tested-by on v1 1/1
#1 lore raw
Quoted 5 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Changing to DEFINE_SIMPLE_DEV_PM_OPS() broke here because the tpm_inf_resume() function is hidden in an #ifdef:

Quoted 8 lines

drivers/char/tpm/tpm_infineon.c:615:61: error: 'tpm_inf_resume' undeclared here (not in a function); did you mean 'tpm_pm_resume'?
615 | static DEFINE_SIMPLE_DEV_PM_OPS(tpm_inf_pm, tpm_pm_suspend, tpm_inf_resume);
| ^~~~~~~~~~~~~~

Remove the #ifdef check.

Fixes 2249200ee420 ("tpm: use DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr()")

I hit the same issue during my build tests. Thanks for your patch.

Best regards
Uwe

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 41 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Changing to DEFINE_SIMPLE_DEV_PM_OPS() broke here because the tpm_inf_resume() function is hidden in an #ifdef:

drivers/char/tpm/tpm_infineon.c:615:61: error: 'tpm_inf_resume' undeclared here (not in a function); did you mean 'tpm_pm_resume'?
615 | static DEFINE_SIMPLE_DEV_PM_OPS(tpm_inf_pm, tpm_pm_suspend, tpm_inf_resume);
| ^~~~~~~~~~~~~~

Remove the #ifdef check.

Fixes 2249200ee420 ("tpm: use DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr()")
---
 drivers/char/tpm/tpm_infineon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/char/tpm/tpm_infineon.c +1 -2
index 84a0d3e5f679..d6edd2ca39a5 100644
@@ -594,7 +594,6 @@ static void tpm_inf_pnp_remove(struct pnp_dev *dev)
 	}
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tpm_inf_resume(struct device *dev)
 {
 	/* Re-configure TPM after suspending */
@@ -611,7 +610,7 @@ static int tpm_inf_resume(struct device *dev)
 	tpm_data_out(RESET_LP_IRQC_DISABLE, CMD);
 	return tpm_pm_resume(dev);
 }
-#endif
+
 static DEFINE_SIMPLE_DEV_PM_OPS(tpm_inf_pm, tpm_pm_suspend, tpm_inf_resume);
 
 static struct pnp_driver tpm_inf_pnp_driver = {
Signature · 1 line
2.53.0

BR, Jarkko

maintainer
#3 lore raw
Quoted 38 lines · Jarkko Sakkinen
Quoted 37 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Changing to DEFINE_SIMPLE_DEV_PM_OPS() broke here because the tpm_inf_resume() function is hidden in an #ifdef:

drivers/char/tpm/tpm_infineon.c:615:61: error: 'tpm_inf_resume' undeclared here (not in a function); did you mean 'tpm_pm_resume'?
615 | static DEFINE_SIMPLE_DEV_PM_OPS(tpm_inf_pm, tpm_pm_suspend, tpm_inf_resume);
| ^~~~~~~~~~~~~~

Remove the #ifdef check.

Fixes 2249200ee420 ("tpm: use DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr()")
---
 drivers/char/tpm/tpm_infineon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/char/tpm/tpm_infineon.c +1 -2
index 84a0d3e5f679..d6edd2ca39a5 100644
@@ -594,7 +594,6 @@ static void tpm_inf_pnp_remove(struct pnp_dev *dev)
 	}
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tpm_inf_resume(struct device *dev)
 {
 	/* Re-configure TPM after suspending */
@@ -611,7 +610,7 @@ static int tpm_inf_resume(struct device *dev)
 	tpm_data_out(RESET_LP_IRQC_DISABLE, CMD);
 	return tpm_pm_resume(dev);
 }
-#endif
+
 static DEFINE_SIMPLE_DEV_PM_OPS(tpm_inf_pm, tpm_pm_suspend, tpm_inf_resume);
 
Quoted 7 lines
Quoted 4 lines
drivers/char/tpm/tpm_infineon.c +0 -0
 static struct pnp_driver tpm_inf_pnp_driver = {
Signature · 1 line
2.53.0

I pushed this to for-next-tpm, which mirrors to linux-next.

However, since this is -next only bug, I guess I should squash these to the original commit?

Just sanity checking before taking action :-)

BR, Jarkko

maintainer
#4 lore raw
Quoted 47 lines · Jarkko Sakkinen
Quoted 38 lines · Jarkko Sakkinen
Quoted 37 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Changing to DEFINE_SIMPLE_DEV_PM_OPS() broke here because the tpm_inf_resume() function is hidden in an #ifdef:

drivers/char/tpm/tpm_infineon.c:615:61: error: 'tpm_inf_resume' undeclared here (not in a function); did you mean 'tpm_pm_resume'?
615 | static DEFINE_SIMPLE_DEV_PM_OPS(tpm_inf_pm, tpm_pm_suspend, tpm_inf_resume);
| ^~~~~~~~~~~~~~

Remove the #ifdef check.

Fixes 2249200ee420 ("tpm: use DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr()")
---
 drivers/char/tpm/tpm_infineon.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/char/tpm/tpm_infineon.c +1 -2
index 84a0d3e5f679..d6edd2ca39a5 100644
@@ -594,7 +594,6 @@ static void tpm_inf_pnp_remove(struct pnp_dev *dev)
 	}
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int tpm_inf_resume(struct device *dev)
 {
 	/* Re-configure TPM after suspending */
@@ -611,7 +610,7 @@ static int tpm_inf_resume(struct device *dev)
 	tpm_data_out(RESET_LP_IRQC_DISABLE, CMD);
 	return tpm_pm_resume(dev);
 }
-#endif
+
 static DEFINE_SIMPLE_DEV_PM_OPS(tpm_inf_pm, tpm_pm_suspend, tpm_inf_resume);
 
Quoted 7 lines
Quoted 4 lines
drivers/char/tpm/tpm_infineon.c +0 -0
 static struct pnp_driver tpm_inf_pnp_driver = {
Signature · 1 line
2.53.0
Quoted 6 lines

I pushed this to for-next-tpm, which mirrors to linux-next.

However, since this is -next only bug, I guess I should squash these to the original commit?

Just sanity checking before taking action :-)

My suggestion would be to amend Co-authored-by to the original commit message as two bug fixes is significant amount of effort to make the change right.

BR, Jarkko

#5 lore raw

Hello Jarkko,

Quoted 2 lines · Jarkko Sakkinen
Quoted 1 line · Jarkko Sakkinen

I pushed this to for-next-tpm, which mirrors to linux-next.

I don't spot it in

https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git for-next-tpm

, do I look at the wrong tree?

Quoted 8 lines
Quoted 4 lines

However, since this is -next only bug, I guess I should squash these to the original commit?

Just sanity checking before taking action :-)

My suggestion would be to amend Co-authored-by to the original commit message as two bug fixes is significant amount of effort to make the change right.

I don't care much about my Tested-by: tag, so feel free to drop it. Promoting that to a Tested-by: on the squashed commit is wrong for sure.

Best regards
Uwe

#7 lore raw
In reply to Jarkko Sakkinen
Quoted 6 lines · Jarkko Sakkinen

On Fri, Sep 18, 2026 at 03:58:11AM +0300, Jarkko Sakkinen wrote:

I pushed this to for-next-tpm, which mirrors to linux-next.

However, since this is -next only bug, I guess I should squash these to the original commit?

Yes, please do, it's just a drive-by patch, which I find easier to do than reporting it as a bug.

No need for Co-authored-by here either.

Arnd

maintainer
#6 lore raw
In reply to Uwe Kleine-König
Quoted 21 lines · Uwe Kleine-König

Hello Jarkko,

Quoted 2 lines · Jarkko Sakkinen
Quoted 1 line · Jarkko Sakkinen

I pushed this to for-next-tpm, which mirrors to linux-next.

I don't spot it in

https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git for-next-tpm

, do I look at the wrong tree?

Quoted 8 lines
Quoted 4 lines

However, since this is -next only bug, I guess I should squash these to the original commit?

Just sanity checking before taking action :-)

My suggestion would be to amend Co-authored-by to the original commit message as two bug fixes is significant amount of effort to make the change right.

Quoted 5 lines

I don't care much about my Tested-by: tag, so feel free to drop it. Promoting that to a Tested-by: on the squashed commit is wrong for sure.

Best regards
Uwe

Sorry I had my tree in bad state as per syncing with remotes.

I now squashed fix to the original commit from Li.

Br, Jarkko

maintainer
#8 lore raw
In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann
Quoted 6 lines · Jarkko Sakkinen

On Fri, Sep 18, 2026 at 03:58:11AM +0300, Jarkko Sakkinen wrote:

I pushed this to for-next-tpm, which mirrors to linux-next.

However, since this is -next only bug, I guess I should squash these to the original commit?

Quoted 6 lines

Yes, please do, it's just a drive-by patch, which I find easier to do than reporting it as a bug.

No need for Co-authored-by here either.

Arnd

Thank you. I've updated my tree accordingly.

BR, Jarkko