]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: socionext: ave: Avoid using netdev_err() before calling register_netdev()
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Thu, 26 Sep 2019 06:35:10 +0000 (15:35 +0900)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Sep 2019 18:26:28 +0000 (20:26 +0200)
Until calling register_netdev(), ndev->dev_name isn't specified, and
netdev_err() displays "(unnamed net_device)".

    ave 65000000.ethernet (unnamed net_device) (uninitialized): invalid phy-mode setting
    ave: probe of 65000000.ethernet failed with error -22

This replaces netdev_err() with dev_err() before calling register_netdev().

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/socionext/sni_ave.c

index d047a53f34f26394abf059c3d6b0e159f0560acf..6e984d5a729fe9d0ea176b0cb87313e94a18a616 100644 (file)
@@ -1662,19 +1662,19 @@ static int ave_probe(struct platform_device *pdev)
                                               "socionext,syscon-phy-mode",
                                               1, 0, &args);
        if (ret) {
-               netdev_err(ndev, "can't get syscon-phy-mode property\n");
+               dev_err(dev, "can't get syscon-phy-mode property\n");
                goto out_free_netdev;
        }
        priv->regmap = syscon_node_to_regmap(args.np);
        of_node_put(args.np);
        if (IS_ERR(priv->regmap)) {
-               netdev_err(ndev, "can't map syscon-phy-mode\n");
+               dev_err(dev, "can't map syscon-phy-mode\n");
                ret = PTR_ERR(priv->regmap);
                goto out_free_netdev;
        }
        ret = priv->data->get_pinmode(priv, phy_mode, args.args[0]);
        if (ret) {
-               netdev_err(ndev, "invalid phy-mode setting\n");
+               dev_err(dev, "invalid phy-mode setting\n");
                goto out_free_netdev;
        }