pch_gbe: convert pr_* to netdev_*
[pandora-kernel.git] / drivers / net / ethernet / oki-semi / pch_gbe / pch_gbe_api.c
index 82e72b2..ff3ad70 100644 (file)
@@ -71,7 +71,9 @@ static s32 pch_gbe_plat_init_hw(struct pch_gbe_hw *hw)
 
        ret_val = pch_gbe_phy_get_id(hw);
        if (ret_val) {
-               pr_err("pch_gbe_phy_get_id error\n");
+               struct pch_gbe_adapter *adapter = pch_gbe_hw_to_adapter(hw);
+
+               netdev_err(adapter->netdev, "pch_gbe_phy_get_id error\n");
                return ret_val;
        }
        pch_gbe_phy_init_setting(hw);
@@ -116,7 +118,9 @@ static void pch_gbe_plat_init_function_pointers(struct pch_gbe_hw *hw)
 s32 pch_gbe_hal_setup_init_funcs(struct pch_gbe_hw *hw)
 {
        if (!hw->reg) {
-               pr_err("ERROR: Registers not mapped\n");
+               struct pch_gbe_adapter *adapter = pch_gbe_hw_to_adapter(hw);
+
+               netdev_err(adapter->netdev, "ERROR: Registers not mapped\n");
                return -ENOSYS;
        }
        pch_gbe_plat_init_function_pointers(hw);
@@ -129,10 +133,13 @@ s32 pch_gbe_hal_setup_init_funcs(struct pch_gbe_hw *hw)
  */
 void pch_gbe_hal_get_bus_info(struct pch_gbe_hw *hw)
 {
-       if (!hw->func->get_bus_info)
-               pr_err("ERROR: configuration\n");
-       else
-               hw->func->get_bus_info(hw);
+       if (!hw->func->get_bus_info) {
+               struct pch_gbe_adapter *adapter = pch_gbe_hw_to_adapter(hw);
+
+               netdev_err(adapter->netdev, "ERROR: configuration\n");
+               return;
+       }
+       hw->func->get_bus_info(hw);
 }
 
 /**
@@ -145,7 +152,9 @@ void pch_gbe_hal_get_bus_info(struct pch_gbe_hw *hw)
 s32 pch_gbe_hal_init_hw(struct pch_gbe_hw *hw)
 {
        if (!hw->func->init_hw) {
-               pr_err("ERROR: configuration\n");
+               struct pch_gbe_adapter *adapter = pch_gbe_hw_to_adapter(hw);
+
+               netdev_err(adapter->netdev, "ERROR: configuration\n");
                return -ENOSYS;
        }
        return hw->func->init_hw(hw);
@@ -191,10 +200,13 @@ s32 pch_gbe_hal_write_phy_reg(struct pch_gbe_hw *hw, u32 offset,
  */
 void pch_gbe_hal_phy_hw_reset(struct pch_gbe_hw *hw)
 {
-       if (!hw->func->reset_phy)
-               pr_err("ERROR: configuration\n");
-       else
-               hw->func->reset_phy(hw);
+       if (!hw->func->reset_phy) {
+               struct pch_gbe_adapter *adapter = pch_gbe_hw_to_adapter(hw);
+
+               netdev_err(adapter->netdev, "ERROR: configuration\n");
+               return;
+       }
+       hw->func->reset_phy(hw);
 }
 
 /**
@@ -203,10 +215,13 @@ void pch_gbe_hal_phy_hw_reset(struct pch_gbe_hw *hw)
  */
 void pch_gbe_hal_phy_sw_reset(struct pch_gbe_hw *hw)
 {
-       if (!hw->func->sw_reset_phy)
-               pr_err("ERROR: configuration\n");
-       else
-               hw->func->sw_reset_phy(hw);
+       if (!hw->func->sw_reset_phy) {
+               struct pch_gbe_adapter *adapter = pch_gbe_hw_to_adapter(hw);
+
+               netdev_err(adapter->netdev, "ERROR: configuration\n");
+               return;
+       }
+       hw->func->sw_reset_phy(hw);
 }
 
 /**
@@ -219,7 +234,9 @@ void pch_gbe_hal_phy_sw_reset(struct pch_gbe_hw *hw)
 s32 pch_gbe_hal_read_mac_addr(struct pch_gbe_hw *hw)
 {
        if (!hw->func->read_mac_addr) {
-               pr_err("ERROR: configuration\n");
+               struct pch_gbe_adapter *adapter = pch_gbe_hw_to_adapter(hw);
+
+               netdev_err(adapter->netdev, "ERROR: configuration\n");
                return -ENOSYS;
        }
        return hw->func->read_mac_addr(hw);