linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] macintosh/ams: linux/platform_device.h is needed
@ 2023-08-29 22:58 Randy Dunlap
  2023-08-30  5:46 ` Christophe Leroy
  2023-08-31 12:09 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Randy Dunlap @ 2023-08-29 22:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Rob Herring, linuxppc-dev, Michael Ellerman

ams.h uses struct platform_device, so the header should be used
to prevent build errors:

drivers/macintosh/ams/ams-input.c: In function 'ams_input_enable':
drivers/macintosh/ams/ams-input.c:68:45: error: invalid use of undefined type 'struct platform_device'
   68 |         input->dev.parent = &ams_info.of_dev->dev;
drivers/macintosh/ams/ams-input.c: In function 'ams_input_init':
drivers/macintosh/ams/ams-input.c:146:51: error: invalid use of undefined type 'struct platform_device'
  146 |         return device_create_file(&ams_info.of_dev->dev, &dev_attr_joystick);
drivers/macintosh/ams/ams-input.c: In function 'ams_input_exit':
drivers/macintosh/ams/ams-input.c:151:44: error: invalid use of undefined type 'struct platform_device'
  151 |         device_remove_file(&ams_info.of_dev->dev, &dev_attr_joystick);
drivers/macintosh/ams/ams-input.c: In function 'ams_input_init':
drivers/macintosh/ams/ams-input.c:147:1: error: control reaches end of non-void function [-Werror=return-type]
  147 | }

Fixes: 233d687d1b78 ("macintosh: Explicitly include correct DT includes")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Rob Herring <robh@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Michael Ellerman <mpe@ellerman.id.au>
---
 drivers/macintosh/ams/ams.h |    1 +
 1 file changed, 1 insertion(+)

diff -- a/drivers/macintosh/ams/ams.h b/drivers/macintosh/ams/ams.h
--- a/drivers/macintosh/ams/ams.h
+++ b/drivers/macintosh/ams/ams.h
@@ -6,6 +6,7 @@
 #include <linux/input.h>
 #include <linux/kthread.h>
 #include <linux/mutex.h>
+#include <linux/platform_device.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] macintosh/ams: linux/platform_device.h is needed
  2023-08-29 22:58 [PATCH] macintosh/ams: linux/platform_device.h is needed Randy Dunlap
@ 2023-08-30  5:46 ` Christophe Leroy
  2023-08-30 15:32   ` Randy Dunlap
  2023-08-31 12:09 ` Michael Ellerman
  1 sibling, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2023-08-30  5:46 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel; +Cc: Rob Herring, linuxppc-dev



Le 30/08/2023 à 00:58, Randy Dunlap a écrit :
> ams.h uses struct platform_device, so the header should be used
> to prevent build errors:
> 
> drivers/macintosh/ams/ams-input.c: In function 'ams_input_enable':
> drivers/macintosh/ams/ams-input.c:68:45: error: invalid use of undefined type 'struct platform_device'
>     68 |         input->dev.parent = &ams_info.of_dev->dev;
> drivers/macintosh/ams/ams-input.c: In function 'ams_input_init':
> drivers/macintosh/ams/ams-input.c:146:51: error: invalid use of undefined type 'struct platform_device'
>    146 |         return device_create_file(&ams_info.of_dev->dev, &dev_attr_joystick);
> drivers/macintosh/ams/ams-input.c: In function 'ams_input_exit':
> drivers/macintosh/ams/ams-input.c:151:44: error: invalid use of undefined type 'struct platform_device'
>    151 |         device_remove_file(&ams_info.of_dev->dev, &dev_attr_joystick);
> drivers/macintosh/ams/ams-input.c: In function 'ams_input_init':
> drivers/macintosh/ams/ams-input.c:147:1: error: control reaches end of non-void function [-Werror=return-type]
>    147 | }
> 
> Fixes: 233d687d1b78 ("macintosh: Explicitly include correct DT includes")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Rob Herring <robh@kernel.org>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> ---
>   drivers/macintosh/ams/ams.h |    1 +
>   1 file changed, 1 insertion(+)
> 
> diff -- a/drivers/macintosh/ams/ams.h b/drivers/macintosh/ams/ams.h
> --- a/drivers/macintosh/ams/ams.h
> +++ b/drivers/macintosh/ams/ams.h
> @@ -6,6 +6,7 @@
>   #include <linux/input.h>
>   #include <linux/kthread.h>
>   #include <linux/mutex.h>
> +#include <linux/platform_device.h>

You modify ams.h to fix a problem in ams-input.c
Is that correct ?

Shouldn't the include be in ams-input.c instead ?

>   #include <linux/spinlock.h>
>   #include <linux/types.h>
>   

Christophe

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] macintosh/ams: linux/platform_device.h is needed
  2023-08-30  5:46 ` Christophe Leroy
@ 2023-08-30 15:32   ` Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2023-08-30 15:32 UTC (permalink / raw)
  To: Christophe Leroy, linux-kernel; +Cc: Rob Herring, linuxppc-dev

Hi,

On 8/29/23 22:46, Christophe Leroy wrote:
> 
> 
> Le 30/08/2023 à 00:58, Randy Dunlap a écrit :
>> ams.h uses struct platform_device, so the header should be used
>> to prevent build errors:
>>
>> drivers/macintosh/ams/ams-input.c: In function 'ams_input_enable':
>> drivers/macintosh/ams/ams-input.c:68:45: error: invalid use of undefined type 'struct platform_device'
>>     68 |         input->dev.parent = &ams_info.of_dev->dev;
>> drivers/macintosh/ams/ams-input.c: In function 'ams_input_init':
>> drivers/macintosh/ams/ams-input.c:146:51: error: invalid use of undefined type 'struct platform_device'
>>    146 |         return device_create_file(&ams_info.of_dev->dev, &dev_attr_joystick);
>> drivers/macintosh/ams/ams-input.c: In function 'ams_input_exit':
>> drivers/macintosh/ams/ams-input.c:151:44: error: invalid use of undefined type 'struct platform_device'
>>    151 |         device_remove_file(&ams_info.of_dev->dev, &dev_attr_joystick);
>> drivers/macintosh/ams/ams-input.c: In function 'ams_input_init':
>> drivers/macintosh/ams/ams-input.c:147:1: error: control reaches end of non-void function [-Werror=return-type]
>>    147 | }
>>
>> Fixes: 233d687d1b78 ("macintosh: Explicitly include correct DT includes")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Rob Herring <robh@kernel.org>
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> ---
>>   drivers/macintosh/ams/ams.h |    1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff -- a/drivers/macintosh/ams/ams.h b/drivers/macintosh/ams/ams.h
>> --- a/drivers/macintosh/ams/ams.h
>> +++ b/drivers/macintosh/ams/ams.h
>> @@ -6,6 +6,7 @@
>>   #include <linux/input.h>
>>   #include <linux/kthread.h>
>>   #include <linux/mutex.h>
>> +#include <linux/platform_device.h>
> 
> You modify ams.h to fix a problem in ams-input.c
> Is that correct ?
> 

struct platform_device is used in ams.h so I think the change
needs to be there.

> Shouldn't the include be in ams-input.c instead ?
> 
>>   #include <linux/spinlock.h>
>>   #include <linux/types.h>
>>   
> 
> Christophe

-- 
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] macintosh/ams: linux/platform_device.h is needed
  2023-08-29 22:58 [PATCH] macintosh/ams: linux/platform_device.h is needed Randy Dunlap
  2023-08-30  5:46 ` Christophe Leroy
@ 2023-08-31 12:09 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2023-08-31 12:09 UTC (permalink / raw)
  To: linux-kernel, Randy Dunlap; +Cc: Rob Herring, linuxppc-dev

On Tue, 29 Aug 2023 15:58:37 -0700, Randy Dunlap wrote:
> ams.h uses struct platform_device, so the header should be used
> to prevent build errors:
> 
> drivers/macintosh/ams/ams-input.c: In function 'ams_input_enable':
> drivers/macintosh/ams/ams-input.c:68:45: error: invalid use of undefined type 'struct platform_device'
>    68 |         input->dev.parent = &ams_info.of_dev->dev;
> drivers/macintosh/ams/ams-input.c: In function 'ams_input_init':
> drivers/macintosh/ams/ams-input.c:146:51: error: invalid use of undefined type 'struct platform_device'
>   146 |         return device_create_file(&ams_info.of_dev->dev, &dev_attr_joystick);
> drivers/macintosh/ams/ams-input.c: In function 'ams_input_exit':
> drivers/macintosh/ams/ams-input.c:151:44: error: invalid use of undefined type 'struct platform_device'
>   151 |         device_remove_file(&ams_info.of_dev->dev, &dev_attr_joystick);
> drivers/macintosh/ams/ams-input.c: In function 'ams_input_init':
> drivers/macintosh/ams/ams-input.c:147:1: error: control reaches end of non-void function [-Werror=return-type]
>   147 | }
> 
> [...]

Applied to powerpc/next.

[1/1] macintosh/ams: linux/platform_device.h is needed
      https://git.kernel.org/powerpc/c/85a616416e9e01db0bfa92f26457e92642e2236b

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-31 12:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-29 22:58 [PATCH] macintosh/ams: linux/platform_device.h is needed Randy Dunlap
2023-08-30  5:46 ` Christophe Leroy
2023-08-30 15:32   ` Randy Dunlap
2023-08-31 12:09 ` Michael Ellerman

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).