2012-06-13 17:06:19

by Fabio Estevam

[permalink] [raw]
Subject: [PATCH] pinctrl: mxs: Use kfree to fix build error

commit 0bf7481 (pinctrl: pinctrl-mxs: Take care of frees if the kzalloc fails)
introduced the following build error:

drivers/pinctrl/pinctrl-mxs.c:140:3: error: implicit declaration of function 'free'

Use kfree function instead.

Signed-off-by: Fabio Estevam <[email protected]>
---
This applies against linux-next
drivers/pinctrl/pinctrl-mxs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-mxs.c b/drivers/pinctrl/pinctrl-mxs.c
index afb50ee..4ba4636 100644
--- a/drivers/pinctrl/pinctrl-mxs.c
+++ b/drivers/pinctrl/pinctrl-mxs.c
@@ -137,7 +137,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev,

free_group:
if (!purecfg)
- free(group);
+ kfree(group);
free:
kfree(new_map);
return ret;
--
1.7.1


2012-06-13 17:30:34

by devendra.aaru

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: mxs: Use kfree to fix build error

Hi Fabio,

On Wed, Jun 13, 2012 at 10:36 PM, Fabio Estevam
<[email protected]> wrote:
> commit 0bf7481 (pinctrl: pinctrl-mxs: Take care of frees if the kzalloc fails)
> introduced the following build error:
>
> drivers/pinctrl/pinctrl-mxs.c:140:3: error: implicit declaration of function 'free'
>
> Use kfree function instead.
>
> Signed-off-by: Fabio Estevam <[email protected]>
> ---
> This applies against linux-next
> ?drivers/pinctrl/pinctrl-mxs.c | ? ?2 +-
> ?1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-mxs.c b/drivers/pinctrl/pinctrl-mxs.c
> index afb50ee..4ba4636 100644
> --- a/drivers/pinctrl/pinctrl-mxs.c
> +++ b/drivers/pinctrl/pinctrl-mxs.c
> @@ -137,7 +137,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev,
>
> ?free_group:
> ? ? ? ?if (!purecfg)
> - ? ? ? ? ? ? ? free(group);
> + ? ? ? ? ? ? ? kfree(group);
> ?free:
> ? ? ? ?kfree(new_map);
> ? ? ? ?return ret;
> --
> 1.7.1
>
>



agh, i am very sorry that i didn't built this because it was not
selectable in make allconfig. (mine is x86 intel corei3),
anyway its wrong that i used a userspace free instead kfree.

Thanks for fixing this.

Acked-by: Devendra Naga <[email protected]>

2012-06-17 17:26:09

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: mxs: Use kfree to fix build error

On Wed, Jun 13, 2012 at 7:06 PM, Fabio Estevam
<[email protected]> wrote:

> commit 0bf7481 (pinctrl: pinctrl-mxs: Take care of frees if the kzalloc fails)
> introduced the following build error:
>
> drivers/pinctrl/pinctrl-mxs.c:140:3: error: implicit declaration of function 'free'
>
> Use kfree function instead.
>
> Signed-off-by: Fabio Estevam <[email protected]>

Applied, hm, Devendra please compile-test your patches ;-)

thanks,
Linus Walleij

2012-06-18 06:15:18

by devendra.aaru

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: mxs: Use kfree to fix build error

Hi Linus,

On Sun, Jun 17, 2012 at 10:56 PM, Linus Walleij
<[email protected]> wrote:
> On Wed, Jun 13, 2012 at 7:06 PM, Fabio Estevam
> <[email protected]> wrote:
>
>> commit 0bf7481 (pinctrl: pinctrl-mxs: Take care of frees if the kzalloc fails)
>> introduced the following build error:
>>
>> drivers/pinctrl/pinctrl-mxs.c:140:3: error: implicit declaration of function 'free'
>>
>> Use kfree function instead.
>>
>> Signed-off-by: Fabio Estevam <[email protected]>
>
> Applied, hm, Devendra please compile-test your patches ;-)

Sorry again for the build errors. :(

The pinctrl is not selectable even with make allyesconfig. is it for a
different arch than x86?
may i know which cross compiler to use to build the pinctrl subsystem :) ?
>
> thanks,
> Linus Walleij

Thanks,
Devendra

2012-06-18 06:27:28

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: mxs: Use kfree to fix build error

On Mon, Jun 18, 2012 at 8:15 AM, devendra.aaru <[email protected]> wrote:

> The pinctrl is not selectable even with make allyesconfig. is it for a
> different arch than x86?

At the request of Linus (Torvalds) machines and drivers that need pinctrl
shall select it explicitly in the Kconfig, and it's hidden for all others so
as not to confuse people and present them with strange stuff.

So currently only some ARM machines that actually use it will select it and
enable the sub-menu. But there is also a MIPS patch in the works.

> may i know which cross compiler to use to build the pinctrl subsystem :) ?

I use the prebuilt Linaro GCC toolchain:
https://launchpad.net/linaro-toolchain-binaries/+download

Put the /bin subdir in your path and e.g.:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- mxs_defconfig
etc

Linus Walleij

2012-06-18 11:36:14

by devendra.aaru

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: mxs: Use kfree to fix build error

Hi Linus,

On Mon, Jun 18, 2012 at 11:57 AM, Linus Walleij
<[email protected]> wrote:
> On Mon, Jun 18, 2012 at 8:15 AM, devendra.aaru <[email protected]> wrote:
>
>> The pinctrl is not selectable even with make allyesconfig. is it for a
>> different arch than x86?
>
> At the request of Linus (Torvalds) machines and drivers that need pinctrl
> shall select it explicitly in the Kconfig, and it's hidden for all others so
> as not to confuse people and present them with strange stuff.
>
> So currently only some ARM machines that actually use it will select it and
> enable the sub-menu. But there is also a MIPS patch in the works.

Thanks for letting me know about the pinctrl build configuration.
>
>> may i know which cross compiler to use to build the pinctrl subsystem :) ?
>
> I use the prebuilt Linaro GCC toolchain:
> https://launchpad.net/linaro-toolchain-binaries/+download
>
> Put the /bin subdir in your path and e.g.:
> make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- mxs_defconfig
> etc
>
Thanks! i set up the cross toolchain now. :)

>From now onwards you can expect at least compile tested patches from me.

> Linus Walleij

Thanks,
Devendra.