Subject: Re: [PATCH] tpm/tpm_tis: Add missing ifdef CONFIG_ACPI for pnp_acpi_device

From: Peter Hüwe <[email-masked]>
Date: Wed, 21 Jan 2015 23:40:04 +0100

Am Mittwoch, 21. Januar 2015, 22:34:32 schrieb Stephen Rothwell:
> Hi Peter,
> 
> On Thu, 22 Jan 2015 08:23:50 +1100 Stephen Rothwell <[email-masked]> 
wrote:
> > To save on the ifdef, why not
> > 
> > 	struct acpi_device *acpi;
> > 	
> > 	.
> > 	.
> > 	
> > 	acpi = pnp_acpi_device(dev);
> > 	if (acpi)
> > 	
> > 		acpi_dev_handle = acpi->handle;
> 
> I guess struct acpi_device may not be visible when CONFIG_ACPI is not
> set? That would be a pain :-(

Yeah seems like it :(
I also thought about this way but then decided against it for the obvious 
reason.

Stephen, do you pull this patch in directly or shall it go via my tpmdd-tree -
> james -> -next ?

> As an aside, the dummy pnp_acpi_device() should be returning NULL not
> 0, and could be a static inline function (as could several other things
> in that header.
Yeah, probably.
(although this function is only in exactly two places within the kernel... so 
not much is gained here:)
Maybe I'll post a patch or maybe we can get rid of this whole thing 
altogether.
Let me think about it.

Peter