From 6115fd88719f159ef3c818067e664324977c8589 Mon Sep 17 00:00:00 2001 From: Madalin Bucur Date: Mon, 25 Aug 2014 17:21:07 +0300 Subject: dpaa_eth: fix dpa_get_channel return value check Signed-off-by: Madalin Bucur Change-Id: I5594b9f26210f9a7237bdd51f529d40a2b008115 Reviewed-on: http://git.am.freescale.net:8181/17400 Reviewed-by: Cristian Bercaru diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c index f27ce5c..0258c90 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c @@ -310,7 +310,7 @@ struct proxy_device *dpa_macless_proxy_probe(struct platform_device *_of_dev) static int dpaa_eth_macless_probe(struct platform_device *_of_dev) { - int err = 0, i; + int err = 0, i, channel; struct device *dev; struct device_node *dpa_node; struct dpa_bp *dpa_bp; @@ -393,13 +393,15 @@ static int dpaa_eth_macless_probe(struct platform_device *_of_dev) if (err < 0) goto bp_create_failed; - priv->channel = dpa_get_channel(); + channel = dpa_get_channel(); - if (priv->channel < 0) { - err = priv->channel; + if (channel < 0) { + err = channel; goto get_channel_failed; } + priv->channel = (uint16_t)channel; + /* Start a thread that will walk the cpus with affine portals * and add this pool channel to each's dequeue mask. */ diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c index 17dc86f..90d2849 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c @@ -670,7 +670,7 @@ static const struct dev_pm_ops shared_pm_ops = { static int dpaa_eth_shared_probe(struct platform_device *_of_dev) { - int err = 0, i; + int err = 0, i, channel; struct device *dev; struct device_node *dpa_node; struct dpa_bp *dpa_bp; @@ -755,13 +755,15 @@ dpaa_eth_shared_probe(struct platform_device *_of_dev) priv->mac_dev = mac_dev; - priv->channel = dpa_get_channel(); + channel = dpa_get_channel(); - if (priv->channel < 0) { - err = priv->channel; + if (channel < 0) { + err = channel; goto get_channel_failed; } + priv->channel = (uint16_t)channel; + /* Start a thread that will walk the cpus with affine portals * and add this pool channel to each's dequeue mask. */ -- cgit v0.10.2