gmac: create /sys/class/vmac/exist
authorhwg <hwg@rock-chips.com>
Tue, 12 Aug 2014 02:52:18 +0000 (10:52 +0800)
committerhwg <hwg@rock-chips.com>
Tue, 12 Aug 2014 02:52:18 +0000 (10:52 +0800)
drivers/net/ethernet/rockchip/gmac/stmmac_platform.c

index b37c6198fcc1fed0931c8db60d424171dfd4bfdb..0b71f532d3f4cc9c0552b1f2575a8c5ce598846b 100755 (executable)
@@ -138,18 +138,18 @@ int stmmc_pltfr_init(struct platform_device *pdev) {
        } else {
                err = gpio_request(bsp_priv->power_io, "gmac_phy_power");
                if (err) {
-                       pr_err("%s: ERROR: Request gmac phy power pin failed.\n", __func__);
+                       //pr_err("%s: ERROR: Request gmac phy power pin failed.\n", __func__);
                        //return -EINVAL;
                }
        }
 
        if (!gpio_is_valid(bsp_priv->reset_io)) {
-               pr_err("%s: ERROR: Get reset-gpio failed.\n", __func__);
+               //pr_err("%s: ERROR: Get reset-gpio failed.\n", __func__);
                //return -EINVAL;
        } else {
                err = gpio_request(bsp_priv->reset_io, "gmac_phy_reset");
                if (err) {
-                       pr_err("%s: ERROR: Request gmac phy reset pin failed.\n", __func__);
+                       //pr_err("%s: ERROR: Request gmac phy reset pin failed.\n", __func__);
                        //return -EINVAL;
                }
        }
@@ -310,6 +310,21 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
 }
 #endif /* CONFIG_OF */
 
+static struct class *vmac_class = NULL;
+static CLASS_ATTR(exist, 0664, NULL, NULL);
+int rockchip_gmac_sysif_init(void)
+{
+       int ret;
+
+       vmac_class = class_create(THIS_MODULE, "vmac");
+       ret = class_create_file(vmac_class, &class_attr_exist);
+       if(ret) {
+           printk("%s: Fail to creat class\n",__func__);
+           return ret;
+       }
+       return 0;
+}
+
 /**
  * stmmac_pltfr_probe
  * @pdev: platform device pointer
@@ -394,6 +409,8 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, priv->dev);
 
+       rockchip_gmac_sysif_init();
+
        pr_debug("STMMAC platform driver registration completed");
 
        return 0;