summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-09-16 14:10:41 +0900
committerTom Rini <trini@konsulko.com>2017-10-04 11:59:44 -0400
commit9b643e312d528f291966c1f30b0d90bf3b1d43dc (patch)
tree35e3780c0aabb8af73ce19a60bb8973b3f2479cd /drivers/phy
parentb44b30260ffa3dc82f4bb98b022483bb09e95353 (diff)
treewide: replace with error() with pr_err()
U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // <smpl> @@@@ -error +pr_err (...) // </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Re-run Coccinelle] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/marvell/comphy_cp110.c40
-rw-r--r--drivers/phy/sti_usb_phy.c22
-rw-r--r--drivers/phy/ti-pipe3-phy.c12
3 files changed, 37 insertions, 37 deletions
diff --git a/drivers/phy/marvell/comphy_cp110.c b/drivers/phy/marvell/comphy_cp110.c
index 3ac405a9be..37187885fa 100644
--- a/drivers/phy/marvell/comphy_cp110.c
+++ b/drivers/phy/marvell/comphy_cp110.c
@@ -509,7 +509,7 @@ static int comphy_pcie_power_up(u32 lane, u32 pcie_width, bool clk_src,
debug("Read from reg = %p - value = 0x%x\n",
hpipe_addr + HPIPE_LANE_STATUS1_REG,
data);
- error("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n");
+ pr_err("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n");
ret = 0;
}
}
@@ -633,7 +633,7 @@ static int comphy_usb3_power_up(u32 lane, void __iomem *hpipe_base,
if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n",
hpipe_addr + HPIPE_LANE_STATUS1_REG, data);
- error("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n");
+ pr_err("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n");
ret = 0;
}
@@ -666,14 +666,14 @@ static int comphy_sata_power_up(u32 lane, void __iomem *hpipe_base,
gd->fdt_blob, sata_node, "marvell,armada-8k-ahci");
if (sata_node == 0) {
- error("SATA node not found in FDT\n");
+ pr_err("SATA node not found in FDT\n");
return 0;
}
sata_base = (void __iomem *)fdtdec_get_addr_size_auto_noparent(
gd->fdt_blob, sata_node, "reg", 0, NULL, true);
if (sata_base == NULL) {
- error("SATA address not found in FDT\n");
+ pr_err("SATA address not found in FDT\n");
return 0;
}
@@ -976,7 +976,7 @@ static int comphy_sata_power_up(u32 lane, void __iomem *hpipe_base,
if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n",
hpipe_addr + HPIPE_LANE_STATUS1_REG, data);
- error("SD_EXTERNAL_STATUS0_PLL_TX is %d, SD_EXTERNAL_STATUS0_PLL_RX is %d\n",
+ pr_err("SD_EXTERNAL_STATUS0_PLL_TX is %d, SD_EXTERNAL_STATUS0_PLL_RX is %d\n",
(data & SD_EXTERNAL_STATUS0_PLL_TX_MASK),
(data & SD_EXTERNAL_STATUS0_PLL_RX_MASK));
ret = 0;
@@ -1099,7 +1099,7 @@ static int comphy_sgmii_power_up(u32 lane, u32 sgmii_speed,
if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n",
sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
- error("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
+ pr_err("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
(data & SD_EXTERNAL_STATUS0_PLL_RX_MASK),
(data & SD_EXTERNAL_STATUS0_PLL_TX_MASK));
ret = 0;
@@ -1117,7 +1117,7 @@ static int comphy_sgmii_power_up(u32 lane, u32 sgmii_speed,
data = polling_with_timeout(addr, data, mask, 100);
if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
- error("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
+ pr_err("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
ret = 0;
}
@@ -1398,7 +1398,7 @@ static int comphy_sfi_power_up(u32 lane, void __iomem *hpipe_base,
data = polling_with_timeout(addr, data, mask, 15000);
if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
- error("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
+ pr_err("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
(data & SD_EXTERNAL_STATUS0_PLL_RX_MASK),
(data & SD_EXTERNAL_STATUS0_PLL_TX_MASK));
ret = 0;
@@ -1418,7 +1418,7 @@ static int comphy_sfi_power_up(u32 lane, void __iomem *hpipe_base,
if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n",
sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
- error("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
+ pr_err("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
ret = 0;
}
@@ -1577,7 +1577,7 @@ static int comphy_rxauii_power_up(u32 lane, void __iomem *hpipe_base,
if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n",
sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
- error("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
+ pr_err("SD_EXTERNAL_STATUS0_PLL_RX is %d, SD_EXTERNAL_STATUS0_PLL_TX is %d\n",
(data & SD_EXTERNAL_STATUS0_PLL_RX_MASK),
(data & SD_EXTERNAL_STATUS0_PLL_TX_MASK));
ret = 0;
@@ -1596,7 +1596,7 @@ static int comphy_rxauii_power_up(u32 lane, void __iomem *hpipe_base,
if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n",
sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data);
- error("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
+ pr_err("SD_EXTERNAL_STATUS0_RX_INIT is 0\n");
ret = 0;
}
@@ -1742,7 +1742,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr,
mask = data;
data = polling_with_timeout(addr, data, mask, 100);
if (data != 0) {
- error("Impedance calibration is not done\n");
+ pr_err("Impedance calibration is not done\n");
debug("Read from reg = %p - value = 0x%x\n", addr, data);
ret = 0;
}
@@ -1751,7 +1751,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr,
mask = data;
data = polling_with_timeout(addr, data, mask, 100);
if (data != 0) {
- error("PLL calibration is not done\n");
+ pr_err("PLL calibration is not done\n");
debug("Read from reg = %p - value = 0x%x\n", addr, data);
ret = 0;
}
@@ -1761,7 +1761,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr,
mask = data;
data = polling_with_timeout(addr, data, mask, 100);
if (data != 0) {
- error("PLL is not ready\n");
+ pr_err("PLL is not ready\n");
debug("Read from reg = %p - value = 0x%x\n", addr, data);
ret = 0;
}
@@ -1818,7 +1818,7 @@ static void comphy_utmi_phy_init(u32 utmi_phy_count,
cp110_utmi_data[i].usb_cfg_addr,
cp110_utmi_data[i].utmi_cfg_addr,
cp110_utmi_data[i].utmi_phy_port)) {
- error("Failed to initialize UTMI PHY %d\n", i);
+ pr_err("Failed to initialize UTMI PHY %d\n", i);
continue;
}
printf("UTMI PHY %d initialized to ", i);
@@ -1864,7 +1864,7 @@ void comphy_dedicated_phys_init(void)
(void __iomem *)fdtdec_get_addr_size_auto_noparent(
gd->fdt_blob, node, "reg", 0, NULL, true);
if (cp110_utmi_data[i].utmi_base_addr == NULL) {
- error("UTMI PHY base address is invalid\n");
+ pr_err("UTMI PHY base address is invalid\n");
i++;
continue;
}
@@ -1874,7 +1874,7 @@ void comphy_dedicated_phys_init(void)
(void __iomem *)fdtdec_get_addr_size_auto_noparent(
gd->fdt_blob, node, "reg", 1, NULL, true);
if (cp110_utmi_data[i].usb_cfg_addr == NULL) {
- error("UTMI PHY base address is invalid\n");
+ pr_err("UTMI PHY base address is invalid\n");
i++;
continue;
}
@@ -1884,7 +1884,7 @@ void comphy_dedicated_phys_init(void)
(void __iomem *)fdtdec_get_addr_size_auto_noparent(
gd->fdt_blob, node, "reg", 2, NULL, true);
if (cp110_utmi_data[i].utmi_cfg_addr == NULL) {
- error("UTMI PHY base address is invalid\n");
+ pr_err("UTMI PHY base address is invalid\n");
i++;
continue;
}
@@ -1896,7 +1896,7 @@ void comphy_dedicated_phys_init(void)
cp110_utmi_data[i].utmi_phy_port = fdtdec_get_int(
gd->fdt_blob, node, "utmi-port", UTMI_PHY_INVALID);
if (cp110_utmi_data[i].utmi_phy_port == UTMI_PHY_INVALID) {
- error("UTMI PHY port type is invalid\n");
+ pr_err("UTMI PHY port type is invalid\n");
i++;
continue;
}
@@ -2049,7 +2049,7 @@ int comphy_cp110_init(struct chip_serdes_phy_config *ptr_chip_cfg,
* PHY_TYPE_UNCONNECTED state.
*/
ptr_comphy_map->type = PHY_TYPE_UNCONNECTED;
- error("PLL is not locked - Failed to initialize lane %d\n",
+ pr_err("PLL is not locked - Failed to initialize lane %d\n",
lane);
}
}
diff --git a/drivers/phy/sti_usb_phy.c b/drivers/phy/sti_usb_phy.c
index 0e0b1c02d2..88fcfbb3e5 100644
--- a/drivers/phy/sti_usb_phy.c
+++ b/drivers/phy/sti_usb_phy.c
@@ -47,13 +47,13 @@ static int sti_usb_phy_deassert(struct sti_usb_phy *phy)
ret = reset_deassert(&phy->global_ctl);
if (ret < 0) {
- error("PHY global deassert failed: %d", ret);
+ pr_err("PHY global deassert failed: %d", ret);
return ret;
}
ret = reset_deassert(&phy->port_ctl);
if (ret < 0)
- error("PHY port deassert failed: %d", ret);
+ pr_err("PHY port deassert failed: %d", ret);
return ret;
}
@@ -85,13 +85,13 @@ static int sti_usb_phy_exit(struct phy *usb_phy)
ret = reset_assert(&phy->port_ctl);
if (ret < 0) {
- error("PHY port assert failed: %d", ret);
+ pr_err("PHY port assert failed: %d", ret);
return ret;
}
ret = reset_assert(&phy->global_ctl);
if (ret < 0)
- error("PHY global assert failed: %d", ret);
+ pr_err("PHY global assert failed: %d", ret);
return ret;
}
@@ -114,20 +114,20 @@ int sti_usb_phy_probe(struct udevice *dev)
&syscfg_phandle);
if (ret < 0) {
- error("Can't get syscfg phandle: %d\n", ret);
+ pr_err("Can't get syscfg phandle: %d\n", ret);
return ret;
}
ret = uclass_get_device_by_ofnode(UCLASS_SYSCON, syscfg_phandle.node,
&syscon);
if (ret) {
- error("unable to find syscon device (%d)\n", ret);
+ pr_err("unable to find syscon device (%d)\n", ret);
return ret;
}
priv->regmap = syscon_get_regmap(syscon);
if (!priv->regmap) {
- error("unable to find regmap\n");
+ pr_err("unable to find regmap\n");
return -ENODEV;
}
@@ -137,12 +137,12 @@ int sti_usb_phy_probe(struct udevice *dev)
ARRAY_SIZE(cells));
if (count < 0) {
- error("Bad PHY st,syscfg property %d\n", count);
+ pr_err("Bad PHY st,syscfg property %d\n", count);
return -EINVAL;
}
if (count > PHYPARAM_NB) {
- error("Unsupported PHY param count %d\n", count);
+ pr_err("Unsupported PHY param count %d\n", count);
return -EINVAL;
}
@@ -152,14 +152,14 @@ int sti_usb_phy_probe(struct udevice *dev)
/* get global reset control */
ret = reset_get_by_name(dev, "global", &priv->global_ctl);
if (ret) {
- error("can't get global reset for %s (%d)", dev->name, ret);
+ pr_err("can't get global reset for %s (%d)", dev->name, ret);
return ret;
}
/* get port reset control */
ret = reset_get_by_name(dev, "port", &priv->port_ctl);
if (ret) {
- error("can't get port reset for %s (%d)", dev->name, ret);
+ pr_err("can't get port reset for %s (%d)", dev->name, ret);
return ret;
}
diff --git a/drivers/phy/ti-pipe3-phy.c b/drivers/phy/ti-pipe3-phy.c
index 680e32f3ea..babf2ffe39 100644
--- a/drivers/phy/ti-pipe3-phy.c
+++ b/drivers/phy/ti-pipe3-phy.c
@@ -261,7 +261,7 @@ static int pipe3_exit(struct phy *phy)
} while (--timeout);
if (!(val & PLL_TICOPWDN) || !(val & PLL_LDOPWDN)) {
- error("%s: Failed to power down DPLL: PLL_STATUS 0x%x\n",
+ pr_err("%s: Failed to power down DPLL: PLL_STATUS 0x%x\n",
__func__, val);
return -EBUSY;
}
@@ -284,14 +284,14 @@ static void *get_reg(struct udevice *dev, const char *name)
err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
name, &syscon);
if (err) {
- error("unable to find syscon device for %s (%d)\n",
+ pr_err("unable to find syscon device for %s (%d)\n",
name, err);
return NULL;
}
regmap = syscon_get_regmap(syscon);
if (IS_ERR(regmap)) {
- error("unable to find regmap for %s (%ld)\n",
+ pr_err("unable to find regmap for %s (%ld)\n",
name, PTR_ERR(regmap));
return NULL;
}
@@ -299,7 +299,7 @@ static void *get_reg(struct udevice *dev, const char *name)
cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), name,
&len);
if (len < 2*sizeof(fdt32_t)) {
- error("offset not available for %s\n", name);
+ pr_err("offset not available for %s\n", name);
return NULL;
}
@@ -318,13 +318,13 @@ static int pipe3_phy_probe(struct udevice *dev)
addr = devfdt_get_addr_size_index(dev, 2, &sz);
if (addr == FDT_ADDR_T_NONE) {
- error("missing pll ctrl address\n");
+ pr_err("missing pll ctrl address\n");
return -EINVAL;
}
pipe3->pll_ctrl_base = map_physmem(addr, sz, MAP_NOCACHE);
if (!pipe3->pll_ctrl_base) {
- error("unable to remap pll ctrl\n");
+ pr_err("unable to remap pll ctrl\n");
return -EINVAL;
}