Skip to content

Commit

Permalink
Merge branch 'Minor-improvements-to-b53-dmesg-output'
Browse files Browse the repository at this point in the history
Paul Barker says:

====================
Minor improvements to b53 dmesg output

These changes were made while debugging the b53 driver for use on a
custom board. They've been runtime tested on a patched 4.14.y kernel
which supports this board as well as build tested with 5.9-rc3. The
changes are straightforward enough that I think this testing is
sufficient but let me know if further testing is required.

Unfortunately I don't have a board to hand which boots with a more
recent kernel and has a switch supported by the b53 driver. I'd still
like to upstream these patches if possible though.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 3, 2020
2 parents 22b330b + 434d231 commit 7544abd
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions drivers/net/dsa/b53/b53_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/delay.h>
#include <linux/export.h>
#include <linux/gpio.h>
Expand Down Expand Up @@ -767,8 +765,11 @@ static int b53_switch_reset(struct b53_device *dev)
usleep_range(1000, 2000);
} while (timeout-- > 0);

if (timeout == 0)
if (timeout == 0) {
dev_err(dev->dev,
"Timeout waiting for SW_RST to clear!\n");
return -ETIMEDOUT;
}
}

b53_read8(dev, B53_CTRL_PAGE, B53_SWITCH_MODE, &mgmt);
Expand Down Expand Up @@ -2620,8 +2621,9 @@ int b53_switch_detect(struct b53_device *dev)
dev->chip_id = id32;
break;
default:
pr_err("unsupported switch detected (BCM53%02x/BCM%x)\n",
id8, id32);
dev_err(dev->dev,
"unsupported switch detected (BCM53%02x/BCM%x)\n",
id8, id32);
return -ENODEV;
}
}
Expand Down Expand Up @@ -2651,7 +2653,8 @@ int b53_switch_register(struct b53_device *dev)
if (ret)
return ret;

pr_info("found switch: %s, rev %i\n", dev->name, dev->core_rev);
dev_info(dev->dev, "found switch: %s, rev %i\n",
dev->name, dev->core_rev);

return dsa_register_switch(dev->ds);
}
Expand Down

0 comments on commit 7544abd

Please sign in to comment.