From: Nathan Lynch <ntl@pobox.com>
To: Will Schmidt <will_schmidt@vnet.ibm.com>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>, paulus@samba.org
Subject: Re: [RFC , PATCH] support for the ibm,pa_features cpu property
Date: Fri, 28 Apr 2006 14:31:59 -0500 [thread overview]
Message-ID: <20060428193159.GJ8550@localdomain> (raw)
In-Reply-To: <1146249684.27214.18.camel@localhost.localdomain>
Will Schmidt wrote:
> +static int get_pa_features(int pabyte,int pabit)
> +{
> + struct device_node *cpu;
> + char *pa_feature_table;
> +
> + cpu = of_find_node_by_type(NULL, "cpu");
> + pa_feature_table =
> + (char *)get_property(cpu, "ibm,pa-features", NULL);
> +
> + if ( pa_feature_table == NULL ) {
> + printk("ibm,pa-features property is missing.\n");
> + return -1;
> + }
> +
> + /* sanity check */
> + if ( pabyte > pa_feature_table[0] ) {
> + printk("%s: %d out of range for table of size %d\n",
> + __FUNCTION__,pabyte,pa_feature_table[0]);
> + return -1;
> + }
> +
> + return pa_feature_table[2+pabyte*8+pabit];
> +}
This function needs to of_node_put(cpu) before returning or we won't
be able to deconfigure the processor.
next prev parent reply other threads:[~2006-04-28 19:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-28 18:41 [RFC , PATCH] support for the ibm,pa_features cpu property Will Schmidt
2006-04-28 19:21 ` Olof Johansson
2006-04-29 1:57 ` Paul Mackerras
2006-04-29 3:46 ` Olof Johansson
2006-04-28 19:31 ` Nathan Lynch [this message]
2006-04-28 21:53 ` Will Schmidt
2006-04-29 2:20 ` Paul Mackerras
2006-04-29 2:38 ` Stephen Rothwell
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=20060428193159.GJ8550@localdomain \
--to=ntl@pobox.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=will_schmidt@vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).