2011-03-08 13:43:00

by Subhasish Ghosh

[permalink] [raw]
Subject: [PATCH v3 3/7] da850: pruss board specific additions.

This patch adds board specific initializations and setup routines.

Signed-off-by: Subhasish Ghosh <[email protected]>
---
arch/arm/mach-davinci/board-da850-evm.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 11f986b..c614c82 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1053,6 +1053,26 @@ static __init int da850_evm_init_cpufreq(void)
static __init int da850_evm_init_cpufreq(void) { return 0; }
#endif

+static struct da8xx_pruss_devices pruss_devices[] = {
+ {.dev_name = NULL,},
+};
+
+static int __init da8xx_evm_setup_pruss(void)
+{
+ u32 ret = 0;
+ u32 count;
+
+ for (count = 0; count < ARRAY_SIZE(pruss_devices); count++) {
+ if (pruss_devices[count].setup != NULL) {
+ ret = pruss_devices[count].setup();
+ if (ret)
+ return ret;
+ }
+ }
+
+ return da8xx_register_pruss_mfd(pruss_devices);
+}
+
static __init void da850_evm_init(void)
{
int ret;
@@ -1127,6 +1147,11 @@ static __init void da850_evm_init(void)

da8xx_register_mcasp(0, &da850_evm_snd_data);

+ ret = da8xx_evm_setup_pruss();
+ if (ret)
+ pr_warning("%s: pruss initialization failed: %d\n",
+ __func__, ret);
+
ret = davinci_cfg_reg_list(da850_lcdcntl_pins);
if (ret)
pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",
--
1.7.2.3


2011-03-08 15:20:51

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v3 3/7] da850: pruss board specific additions.

Hello.

On 08-03-2011 16:57, Subhasish Ghosh wrote:

> This patch adds board specific initializations and setup routines.

> Signed-off-by: Subhasish Ghosh<[email protected]>
[...]

> diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> index 11f986b..c614c82 100644
> --- a/arch/arm/mach-davinci/board-da850-evm.c
> +++ b/arch/arm/mach-davinci/board-da850-evm.c
> @@ -1053,6 +1053,26 @@ static __init int da850_evm_init_cpufreq(void)
> static __init int da850_evm_init_cpufreq(void) { return 0; }
> #endif
>
> +static struct da8xx_pruss_devices pruss_devices[] = {
> + {.dev_name = NULL,},

No need to explictly intialize to NULL.

WBR, Sergei

2011-03-09 04:27:19

by Subhasish Ghosh

[permalink] [raw]
Subject: Re: [PATCH v3 3/7] da850: pruss board specific additions.

Hello,

If I don't initialize it to NULL, its getting initialized to some garbage
string.

--------------------------------------------------
From: "Sergei Shtylyov" <[email protected]>
Sent: Tuesday, March 08, 2011 8:49 PM
To: "Subhasish Ghosh" <[email protected]>
Cc: <[email protected]>;
<[email protected]>; "Russell King" <[email protected]>; "open
list" <[email protected]>; <[email protected]>;
<[email protected]>
Subject: Re: [PATCH v3 3/7] da850: pruss board specific additions.

> Hello.
>
> On 08-03-2011 16:57, Subhasish Ghosh wrote:
>
>> This patch adds board specific initializations and setup routines.
>
>> Signed-off-by: Subhasish Ghosh<[email protected]>
> [...]
>
>> diff --git a/arch/arm/mach-davinci/board-da850-evm.c
>> b/arch/arm/mach-davinci/board-da850-evm.c
>> index 11f986b..c614c82 100644
>> --- a/arch/arm/mach-davinci/board-da850-evm.c
>> +++ b/arch/arm/mach-davinci/board-da850-evm.c
>> @@ -1053,6 +1053,26 @@ static __init int da850_evm_init_cpufreq(void)
>> static __init int da850_evm_init_cpufreq(void) { return 0; }
>> #endif
>>
>> +static struct da8xx_pruss_devices pruss_devices[] = {
>> + {.dev_name = NULL,},
>
> No need to explictly intialize to NULL.
>
> WBR, Sergei

2011-03-09 11:59:51

by Marc Kleine-Budde

[permalink] [raw]
Subject: Re: [PATCH v3 3/7] da850: pruss board specific additions.

On 03/08/2011 02:57 PM, Subhasish Ghosh wrote:
> This patch adds board specific initializations and setup routines.
>
> Signed-off-by: Subhasish Ghosh <[email protected]>
> ---
> arch/arm/mach-davinci/board-da850-evm.c | 25 +++++++++++++++++++++++++
> 1 files changed, 25 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> index 11f986b..c614c82 100644
> --- a/arch/arm/mach-davinci/board-da850-evm.c
> +++ b/arch/arm/mach-davinci/board-da850-evm.c
> @@ -1053,6 +1053,26 @@ static __init int da850_evm_init_cpufreq(void)
> static __init int da850_evm_init_cpufreq(void) { return 0; }
> #endif
>
> +static struct da8xx_pruss_devices pruss_devices[] = {
> + {.dev_name = NULL,},
> +};
> +
> +static int __init da8xx_evm_setup_pruss(void)
> +{
> + u32 ret = 0;
your functions returns an int, not an u32
> + u32 count;

use "int i" for loop counter.

> +
> + for (count = 0; count < ARRAY_SIZE(pruss_devices); count++) {
> + if (pruss_devices[count].setup != NULL) {

you may omit the "!= NULL"

> + ret = pruss_devices[count].setup();
> + if (ret)
> + return ret;

in case of an error you don't clean up correct

> + }
> + }
> +
> + return da8xx_register_pruss_mfd(pruss_devices);
> +}
> +
> static __init void da850_evm_init(void)
> {
> int ret;
> @@ -1127,6 +1147,11 @@ static __init void da850_evm_init(void)
>
> da8xx_register_mcasp(0, &da850_evm_snd_data);
>
> + ret = da8xx_evm_setup_pruss();
> + if (ret)
> + pr_warning("%s: pruss initialization failed: %d\n",
> + __func__, ret);
> +
> ret = davinci_cfg_reg_list(da850_lcdcntl_pins);
> if (ret)
> pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",


--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |


Attachments:
signature.asc (262.00 B)
OpenPGP digital signature