From: Arnd Bergmann <arnd@arndb•de>
To: linuxppc-dev@ozlabs•org
Subject: Re: [PATCH 4/5] PowerPC 74xx: Katana Qp base support
Date: Sat, 24 Nov 2007 19:51:59 +0100 [thread overview]
Message-ID: <200711241952.00186.arnd@arndb.de> (raw)
In-Reply-To: <20071116163116.GE25062@ru.mvista.com>
On Friday 16 November 2007, Andrei Dolnikov wrote:
> +static int __init katanaqp_is_monarch(void)
> +{
> + return !(in_8((volatile char *)(cpld_base + KATANAQP_CPLD_PSR)) &
> + KATANAQP_CPLD_PSR_PMCM);
> +}
The pointer here needs to be __iomem, not volatile. Same in other places.
Please use 'sparse' to check your code for bugs like this.
> +
> +static void __init katanaqp_setup_arch(void)
> +{
> + struct device_node *cpld;
> + const unsigned int *reg;
> +
> + /*
> + * ioremap cpld registers in case they are later
> + * needed by katanaqp_reset_board().
> + */
> + cpld = of_find_node_by_path("/mv64x60@f8100000/cpld@f8200000");
It doesn't sounds good to hardcode the path for this device.
Instead, it would be much better to look for the 'compatible' property
here.
> +static int __init katanaqp_of_init(void)
> +{
> + struct device_node *np;
> +
> + np = of_find_compatible_node(NULL, NULL, "cfi-flash");
> + if (np)
> + of_platform_device_create(np, "of-flash", NULL);
> +
> + return 0;
> +}
> +
> +device_initcall(katanaqp_of_init);
This should be done automatically using of_platform_bus_probe().
Arnd <><
next prev parent reply other threads:[~2007-11-24 18:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-16 15:43 [PATCH 0/1] PowerPC 74xx: Add Emerson Katana Qp support Andrei Dolnikov
2007-11-16 16:12 ` [PATCH 1/5] PowerPC 74xx: Katana Qp device tree Andrei Dolnikov
2007-11-21 18:08 ` Vitaly Bordug
2007-11-16 16:31 ` [PATCH 4/5] PowerPC 74xx: Katana Qp base support Andrei Dolnikov
2007-11-21 16:30 ` Vitaly Bordug
2007-11-24 18:51 ` Arnd Bergmann [this message]
2007-11-24 22:28 ` Benjamin Herrenschmidt
-- strict thread matches above, loose matches on Subject: below --
2007-11-29 15:07 [PATCH 0/5] PowerPC 74xx: Add Emerson Katana Qp support Andrei Dolnikov
2007-11-29 15:42 ` [PATCH 4/5] PowerPC 74xx: Katana Qp base support Andrei Dolnikov
2007-12-03 20:54 ` Benjamin Herrenschmidt
2007-12-04 2:12 ` Mark A. Greer
2007-12-12 0:48 ` Mark A. Greer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200711241952.00186.arnd@arndb.de \
--to=arnd@arndb$(echo .)de \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox