diff mbox

[RESEND] platforms/astbmc: Don't validate model on palmetto

Message ID 1491182328-20556-1-git-send-email-gwshan@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Gavin Shan April 3, 2017, 1:18 a.m. UTC
The platform isn't compatible with palmetto until the root device-tree
node's "model" property is NULL or "palmetto". However, we could have
"TN71-BP012" for the property on palmetto.

   linux# cat /proc/device-tree/model
   TN71-BP012

This skips the validation on root device-tree node's "model" property
on palmetto, meaning we check the "compatible" property only.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 platforms/astbmc/palmetto.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Benjamin Herrenschmidt June 15, 2017, 5:26 a.m. UTC | #1
On Mon, 2017-04-03 at 11:18 +1000, Gavin Shan wrote:
> The platform isn't compatible with palmetto until the root device-tree
> node's "model" property is NULL or "palmetto". However, we could have
> "TN71-BP012" for the property on palmetto.
> 
>    linux# cat /proc/device-tree/model
>    TN71-BP012
> 
> This skips the validation on root device-tree node's "model" property
> on palmetto, meaning we check the "compatible" property only.
> 
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> ---
>  platforms/astbmc/palmetto.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/platforms/astbmc/palmetto.c b/platforms/astbmc/palmetto.c
> index aadb2fc..69f111c 100644
> --- a/platforms/astbmc/palmetto.c
> +++ b/platforms/astbmc/palmetto.c
> @@ -105,15 +105,8 @@ static const struct slot_table_entry palmetto_phb_table[] = {
>  
>  static bool palmetto_probe(void)
>  {
> -	const char *model;
> -
> -	if (!dt_node_is_compatible(dt_root, "ibm,powernv"))
> -		return false;
> -
> -	/* Temporary ... eventually we'll get that in compatible */
> -	model = dt_prop_get_def(dt_root, "model", NULL);
> -	if ((!model || !strstr(model, "palmetto")) &&
> -	    (!dt_node_is_compatible(dt_root, "tyan,palmetto")))
> +	if (!dt_node_is_compatible(dt_root, "ibm,powernv") ||
> +	    !dt_node_is_compatible(dt_root, "tyan,palmetto"))
>  		return false;
>  
>  	/* Lot of common early inits here */
Stewart Smith June 19, 2017, 6:46 a.m. UTC | #2
Gavin Shan <gwshan@linux.vnet.ibm.com> writes:
> The platform isn't compatible with palmetto until the root device-tree
> node's "model" property is NULL or "palmetto". However, we could have
> "TN71-BP012" for the property on palmetto.
>
>    linux# cat /proc/device-tree/model
>    TN71-BP012
>
> This skips the validation on root device-tree node's "model" property
> on palmetto, meaning we check the "compatible" property only.
>
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> ---
>  platforms/astbmc/palmetto.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)

thanks, merged to master as of 7f5e5d0c2df88bf265301c57dbc8d96074df0770
diff mbox

Patch

diff --git a/platforms/astbmc/palmetto.c b/platforms/astbmc/palmetto.c
index aadb2fc..69f111c 100644
--- a/platforms/astbmc/palmetto.c
+++ b/platforms/astbmc/palmetto.c
@@ -105,15 +105,8 @@  static const struct slot_table_entry palmetto_phb_table[] = {
 
 static bool palmetto_probe(void)
 {
-	const char *model;
-
-	if (!dt_node_is_compatible(dt_root, "ibm,powernv"))
-		return false;
-
-	/* Temporary ... eventually we'll get that in compatible */
-	model = dt_prop_get_def(dt_root, "model", NULL);
-	if ((!model || !strstr(model, "palmetto")) &&
-	    (!dt_node_is_compatible(dt_root, "tyan,palmetto")))
+	if (!dt_node_is_compatible(dt_root, "ibm,powernv") ||
+	    !dt_node_is_compatible(dt_root, "tyan,palmetto"))
 		return false;
 
 	/* Lot of common early inits here */