* [PATCH v1] ARM:sunxi:sid: Make use of the of_match_ptr
@ 2015-01-07 7:41 Olliver Schinagl
2015-01-07 8:49 ` Maxime Ripard
2015-01-07 9:00 ` Arnd Bergmann
0 siblings, 2 replies; 4+ messages in thread
From: Olliver Schinagl @ 2015-01-07 7:41 UTC (permalink / raw)
To: linux-arm-kernel
From: Olliver Schinagl <oliver@schinagl.nl>
I probably have forgotten to use this macro for the of_match pointer, so
this patch adds the of_match_ptr macro.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
drivers/misc/eeprom/sunxi_sid.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/eeprom/sunxi_sid.c b/drivers/misc/eeprom/sunxi_sid.c
index 8385177..5a330d9 100644
--- a/drivers/misc/eeprom/sunxi_sid.c
+++ b/drivers/misc/eeprom/sunxi_sid.c
@@ -25,6 +25,7 @@
#include <linux/kernel.h>
#include <linux/kobject.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/random.h>
@@ -146,7 +147,7 @@ static struct platform_driver sunxi_sid_driver = {
.remove = sunxi_sid_remove,
.driver = {
.name = DRV_NAME,
- .of_match_table = sunxi_sid_of_match,
+ .of_match_table = of_match_ptr(sunxi_sid_of_match),
},
};
module_platform_driver(sunxi_sid_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v1] ARM:sunxi:sid: Make use of the of_match_ptr
2015-01-07 7:41 [PATCH v1] ARM:sunxi:sid: Make use of the of_match_ptr Olliver Schinagl
@ 2015-01-07 8:49 ` Maxime Ripard
2015-01-07 9:00 ` Arnd Bergmann
1 sibling, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2015-01-07 8:49 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Wed, Jan 07, 2015 at 08:41:08AM +0100, Olliver Schinagl wrote:
> From: Olliver Schinagl <oliver@schinagl.nl>
>
> I probably have forgotten to use this macro for the of_match pointer, so
> this patch adds the of_match_ptr macro.
>
> Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
> ---
> drivers/misc/eeprom/sunxi_sid.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/eeprom/sunxi_sid.c b/drivers/misc/eeprom/sunxi_sid.c
> index 8385177..5a330d9 100644
> --- a/drivers/misc/eeprom/sunxi_sid.c
> +++ b/drivers/misc/eeprom/sunxi_sid.c
> @@ -25,6 +25,7 @@
> #include <linux/kernel.h>
> #include <linux/kobject.h>
> #include <linux/module.h>
> +#include <linux/of.h>
> #include <linux/of_device.h>
> #include <linux/platform_device.h>
> #include <linux/random.h>
> @@ -146,7 +147,7 @@ static struct platform_driver sunxi_sid_driver = {
> .remove = sunxi_sid_remove,
> .driver = {
> .name = DRV_NAME,
> - .of_match_table = sunxi_sid_of_match,
> + .of_match_table = of_match_ptr(sunxi_sid_of_match),
Why do you need this ? The sunxi_sid_of_match array is always defined.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150107/27a0aa53/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v1] ARM:sunxi:sid: Make use of the of_match_ptr
2015-01-07 7:41 [PATCH v1] ARM:sunxi:sid: Make use of the of_match_ptr Olliver Schinagl
2015-01-07 8:49 ` Maxime Ripard
@ 2015-01-07 9:00 ` Arnd Bergmann
2015-01-07 9:26 ` Olliver Schinagl
1 sibling, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2015-01-07 9:00 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 07 January 2015 08:41:08 Olliver Schinagl wrote:
> From: Olliver Schinagl <oliver@schinagl.nl>
>
> I probably have forgotten to use this macro for the of_match pointer, so
> this patch adds the of_match_ptr macro.
>
> Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
> ---
> drivers/misc/eeprom/sunxi_sid.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/eeprom/sunxi_sid.c b/drivers/misc/eeprom/sunxi_sid.c
> index 8385177..5a330d9 100644
> --- a/drivers/misc/eeprom/sunxi_sid.c
> +++ b/drivers/misc/eeprom/sunxi_sid.c
> @@ -25,6 +25,7 @@
> #include <linux/kernel.h>
> #include <linux/kobject.h>
> #include <linux/module.h>
> +#include <linux/of.h>
> #include <linux/of_device.h>
> #include <linux/platform_device.h>
> #include <linux/random.h>
> @@ -146,7 +147,7 @@ static struct platform_driver sunxi_sid_driver = {
> .remove = sunxi_sid_remove,
> .driver = {
> .name = DRV_NAME,
> - .of_match_table = sunxi_sid_of_match,
> + .of_match_table = of_match_ptr(sunxi_sid_of_match),
> },
> };
> module_platform_driver(sunxi_sid_driver);
This looks wrong: sunxi_sid_of_match is defined unconditionally, so
now you get a compiler warning if CONFIG_OF is disabled.
The existing code is good, we only add the of_match_ptr() for drivers
that are useful without CONFIG_OF and that want to save a few bytes
in .data size.
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v1] ARM:sunxi:sid: Make use of the of_match_ptr
2015-01-07 9:00 ` Arnd Bergmann
@ 2015-01-07 9:26 ` Olliver Schinagl
0 siblings, 0 replies; 4+ messages in thread
From: Olliver Schinagl @ 2015-01-07 9:26 UTC (permalink / raw)
To: linux-arm-kernel
Hey Arnd,
On 07-01-15 10:00, Arnd Bergmann wrote:
> On Wednesday 07 January 2015 08:41:08 Olliver Schinagl wrote:
>> From: Olliver Schinagl <oliver@schinagl.nl>
>>
>> I probably have forgotten to use this macro for the of_match pointer, so
>> this patch adds the of_match_ptr macro.
>>
>> Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
>> ---
>> drivers/misc/eeprom/sunxi_sid.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/misc/eeprom/sunxi_sid.c b/drivers/misc/eeprom/sunxi_sid.c
>> index 8385177..5a330d9 100644
>> --- a/drivers/misc/eeprom/sunxi_sid.c
>> +++ b/drivers/misc/eeprom/sunxi_sid.c
>> @@ -25,6 +25,7 @@
>> #include <linux/kernel.h>
>> #include <linux/kobject.h>
>> #include <linux/module.h>
>> +#include <linux/of.h>
>> #include <linux/of_device.h>
>> #include <linux/platform_device.h>
>> #include <linux/random.h>
>> @@ -146,7 +147,7 @@ static struct platform_driver sunxi_sid_driver = {
>> .remove = sunxi_sid_remove,
>> .driver = {
>> .name = DRV_NAME,
>> - .of_match_table = sunxi_sid_of_match,
>> + .of_match_table = of_match_ptr(sunxi_sid_of_match),
>> },
>> };
>> module_platform_driver(sunxi_sid_driver);
> This looks wrong: sunxi_sid_of_match is defined unconditionally, so
> now you get a compiler warning if CONFIG_OF is disabled.
>
> The existing code is good, we only add the of_match_ptr() for drivers
> that are useful without CONFIG_OF and that want to save a few bytes
> in .data size.
Ah, I missunderstood its use then!It looked like the of_match_ptr() got
defined away otherwise. Sorry for the noise!
Olliver
>
> Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-01-07 9:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-07 7:41 [PATCH v1] ARM:sunxi:sid: Make use of the of_match_ptr Olliver Schinagl
2015-01-07 8:49 ` Maxime Ripard
2015-01-07 9:00 ` Arnd Bergmann
2015-01-07 9:26 ` Olliver Schinagl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox