| From f06f021d625c05db6c0114828e87bfe816a3c2aa Mon Sep 17 00:00:00 2001 |
| From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
| Date: Tue, 16 Apr 2013 12:34:09 +0200 |
| Subject: [PATCH] net/cpsw: Use fallback for active_slave |
| |
| In case the .dts has not been yet updated we also try to look for the |
| old "cpts_active_slave" property. |
| |
| Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
| --- |
| drivers/net/ethernet/ti/cpsw.c | 8 ++++++-- |
| 1 file changed, 6 insertions(+), 2 deletions(-) |
| |
| --- a/drivers/net/ethernet/ti/cpsw.c |
| +++ b/drivers/net/ethernet/ti/cpsw.c |
| @@ -1467,8 +1467,12 @@ static int cpsw_probe_dt(struct cpsw_pla |
| |
| if (of_property_read_u32(node, "active_slave", &prop)) { |
| pr_err("Missing active_slave property in the DT.\n"); |
| - ret = -EINVAL; |
| - goto error_ret; |
| + if (of_property_read_u32(node, "cpts_active_slave", &prop)) { |
| + ret = -EINVAL; |
| + goto error_ret; |
| + } else { |
| + pr_err("Using old cpts_active_slave as fallback.\n"); |
| + } |
| } |
| data->active_slave = prop; |
| |