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>
This commit is contained in:
Masahiro Yamada 2017-09-16 14:10:41 +09:00 committed by Tom Rini
parent b44b30260f
commit 9b643e312d
128 changed files with 560 additions and 560 deletions

View file

@ -241,7 +241,7 @@ int arch_misc_init(void)
#if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER) #if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER)
ret = usb_ether_init(); ret = usb_ether_init();
if (ret) { if (ret) {
error("USB ether init failed\n"); pr_err("USB ether init failed\n");
return ret; return ret;
} }
#endif #endif

View file

@ -87,13 +87,13 @@ static u32 omap_mmc_get_part_size(const char *part)
dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV); dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) { if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) {
error("invalid mmc device\n"); pr_err("invalid mmc device\n");
return 0; return 0;
} }
res = part_get_info_by_name(dev_desc, part, &info); res = part_get_info_by_name(dev_desc, part, &info);
if (res < 0) { if (res < 0) {
error("cannot find partition: '%s'\n", part); pr_err("cannot find partition: '%s'\n", part);
return 0; return 0;
} }

View file

@ -151,7 +151,7 @@ void board_init_f(ulong dummy)
*/ */
pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU); pmu = syscon_get_first_range(ROCKCHIP_SYSCON_PMU);
if (IS_ERR(pmu)) if (IS_ERR(pmu))
error("pmu syscon returned %ld\n", PTR_ERR(pmu)); pr_err("pmu syscon returned %ld\n", PTR_ERR(pmu));
SAVE_SP_ADDR = readl(&pmu->sys_reg[2]); SAVE_SP_ADDR = readl(&pmu->sys_reg[2]);
ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl); ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);

View file

@ -26,7 +26,7 @@ int board_late_init(void)
grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
if (IS_ERR(grf)) { if (IS_ERR(grf)) {
error("grf syscon returned %ld\n", PTR_ERR(grf)); pr_err("grf syscon returned %ld\n", PTR_ERR(grf));
} else { } else {
/* enable noc remap to mimic legacy loaders */ /* enable noc remap to mimic legacy loaders */
rk_clrsetreg(&grf->soc_con0, rk_clrsetreg(&grf->soc_con0,

View file

@ -38,13 +38,13 @@ void board_init_f(ulong dummy)
/* Set up our preloader console */ /* Set up our preloader console */
ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl); ret = uclass_get_device(UCLASS_PINCTRL, 0, &pinctrl);
if (ret) { if (ret) {
error("%s: pinctrl init failed: %d\n", __func__, ret); pr_err("%s: pinctrl init failed: %d\n", __func__, ret);
hang(); hang();
} }
ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART0); ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_UART0);
if (ret) { if (ret) {
error("%s: failed to set up console UART\n", __func__); pr_err("%s: failed to set up console UART\n", __func__);
hang(); hang();
} }

View file

@ -174,7 +174,7 @@ void socfpga_emac_manage_reset(ulong emacbase, u32 state)
emacmask = ALT_RSTMGR_PER0MODRST_EMAC2_SET_MSK; emacmask = ALT_RSTMGR_PER0MODRST_EMAC2_SET_MSK;
break; break;
default: default:
error("emac base address unexpected! %lx", emacbase); pr_err("emac base address unexpected! %lx", emacbase);
hang(); hang();
break; break;
} }

View file

@ -493,7 +493,7 @@ static int check_ivc_params(ulong qbase1, ulong qbase2, uint32_t nframes,
(TEGRA_IVC_ALIGN - 1)); (TEGRA_IVC_ALIGN - 1));
if ((uint64_t)nframes * (uint64_t)frame_size >= 0x100000000) { if ((uint64_t)nframes * (uint64_t)frame_size >= 0x100000000) {
error("tegra_ivc: nframes * frame_size overflows\n"); pr_err("tegra_ivc: nframes * frame_size overflows\n");
return -EINVAL; return -EINVAL;
} }
@ -503,12 +503,12 @@ static int check_ivc_params(ulong qbase1, ulong qbase2, uint32_t nframes,
*/ */
if ((qbase1 & (TEGRA_IVC_ALIGN - 1)) || if ((qbase1 & (TEGRA_IVC_ALIGN - 1)) ||
(qbase2 & (TEGRA_IVC_ALIGN - 1))) { (qbase2 & (TEGRA_IVC_ALIGN - 1))) {
error("tegra_ivc: channel start not aligned\n"); pr_err("tegra_ivc: channel start not aligned\n");
return -EINVAL; return -EINVAL;
} }
if (frame_size & (TEGRA_IVC_ALIGN - 1)) { if (frame_size & (TEGRA_IVC_ALIGN - 1)) {
error("tegra_ivc: frame size not adequately aligned\n"); pr_err("tegra_ivc: frame size not adequately aligned\n");
return -EINVAL; return -EINVAL;
} }
@ -521,7 +521,7 @@ static int check_ivc_params(ulong qbase1, ulong qbase2, uint32_t nframes,
} }
if (ret) { if (ret) {
error("tegra_ivc: queue regions overlap\n"); pr_err("tegra_ivc: queue regions overlap\n");
return ret; return ret;
} }

View file

@ -137,7 +137,7 @@ static int tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl)
u32 value; u32 value;
if (padctl->enable == 0) { if (padctl->enable == 0) {
error("unbalanced enable/disable"); pr_err("unbalanced enable/disable");
return 0; return 0;
} }

View file

@ -45,12 +45,12 @@ int dram_init(void)
node = fdt_path_offset(nvtboot_blob, "/memory"); node = fdt_path_offset(nvtboot_blob, "/memory");
if (node < 0) { if (node < 0) {
error("Can't find /memory node in nvtboot DTB"); pr_err("Can't find /memory node in nvtboot DTB");
hang(); hang();
} }
prop = fdt_getprop(nvtboot_blob, node, "reg", &len); prop = fdt_getprop(nvtboot_blob, node, "reg", &len);
if (!prop) { if (!prop) {
error("Can't find /memory/reg property in nvtboot DTB"); pr_err("Can't find /memory/reg property in nvtboot DTB");
hang(); hang();
} }

View file

@ -667,7 +667,7 @@ static int tegra_plle_train(void)
} while (--timeout); } while (--timeout);
if (timeout == 0) { if (timeout == 0) {
error("timeout waiting for PLLE to become ready"); pr_err("timeout waiting for PLLE to become ready");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
@ -697,7 +697,7 @@ int tegra_plle_enable(void)
if ((value & PLLE_MISC_PLL_READY) == 0) { if ((value & PLLE_MISC_PLL_READY) == 0) {
err = tegra_plle_train(); err = tegra_plle_train();
if (err < 0) { if (err < 0) {
error("failed to train PLLE: %d", err); pr_err("failed to train PLLE: %d", err);
return err; return err;
} }
} }
@ -726,7 +726,7 @@ int tegra_plle_enable(void)
} while (--timeout); } while (--timeout);
if (timeout == 0) { if (timeout == 0) {
error("timeout waiting for PLLE to lock"); pr_err("timeout waiting for PLLE to lock");
return -ETIMEDOUT; return -ETIMEDOUT;
} }

View file

@ -125,7 +125,7 @@ static int tegra_xusb_padctl_disable(struct tegra_xusb_padctl *padctl)
u32 value; u32 value;
if (padctl->enable == 0) { if (padctl->enable == 0) {
error("unbalanced enable/disable"); pr_err("unbalanced enable/disable");
return 0; return 0;
} }

View file

@ -696,7 +696,7 @@ static int tegra_plle_train(void)
} while (--timeout); } while (--timeout);
if (timeout == 0) { if (timeout == 0) {
error("timeout waiting for PLLE to become ready"); pr_err("timeout waiting for PLLE to become ready");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
@ -726,7 +726,7 @@ int tegra_plle_enable(void)
if ((value & PLLE_MISC_PLL_READY) == 0) { if ((value & PLLE_MISC_PLL_READY) == 0) {
err = tegra_plle_train(); err = tegra_plle_train();
if (err < 0) { if (err < 0) {
error("failed to train PLLE: %d", err); pr_err("failed to train PLLE: %d", err);
return err; return err;
} }
} }
@ -772,7 +772,7 @@ int tegra_plle_enable(void)
} while (--timeout); } while (--timeout);
if (timeout == 0) { if (timeout == 0) {
error("timeout waiting for PLLE to lock"); pr_err("timeout waiting for PLLE to lock");
return -ETIMEDOUT; return -ETIMEDOUT;
} }

View file

@ -84,7 +84,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl,
len = ofnode_read_string_count(node, "nvidia,lanes"); len = ofnode_read_string_count(node, "nvidia,lanes");
if (len < 0) { if (len < 0) {
error("failed to parse \"nvidia,lanes\" property"); pr_err("failed to parse \"nvidia,lanes\" property");
return -EINVAL; return -EINVAL;
} }
@ -94,7 +94,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl,
ret = ofnode_read_string_index(node, "nvidia,lanes", i, ret = ofnode_read_string_index(node, "nvidia,lanes", i,
&group->pins[i]); &group->pins[i]);
if (ret) { if (ret) {
error("failed to read string from \"nvidia,lanes\" property"); pr_err("failed to read string from \"nvidia,lanes\" property");
return -EINVAL; return -EINVAL;
} }
} }
@ -104,7 +104,7 @@ tegra_xusb_padctl_group_parse_dt(struct tegra_xusb_padctl *padctl,
ret = ofnode_read_string_index(node, "nvidia,function", 0, ret = ofnode_read_string_index(node, "nvidia,function", 0,
&group->func); &group->func);
if (ret) { if (ret) {
error("failed to parse \"nvidia,func\" property"); pr_err("failed to parse \"nvidia,func\" property");
return -EINVAL; return -EINVAL;
} }
@ -157,14 +157,14 @@ tegra_xusb_padctl_group_apply(struct tegra_xusb_padctl *padctl,
lane = tegra_xusb_padctl_find_lane(padctl, group->pins[i]); lane = tegra_xusb_padctl_find_lane(padctl, group->pins[i]);
if (!lane) { if (!lane) {
error("no lane for pin %s", group->pins[i]); pr_err("no lane for pin %s", group->pins[i]);
continue; continue;
} }
func = tegra_xusb_padctl_lane_find_function(padctl, lane, func = tegra_xusb_padctl_lane_find_function(padctl, lane,
group->func); group->func);
if (func < 0) { if (func < 0) {
error("function %s invalid for lane %s: %d", pr_err("function %s invalid for lane %s: %d",
group->func, lane->name, func); group->func, lane->name, func);
continue; continue;
} }
@ -206,7 +206,7 @@ tegra_xusb_padctl_config_apply(struct tegra_xusb_padctl *padctl,
err = tegra_xusb_padctl_group_apply(padctl, group); err = tegra_xusb_padctl_group_apply(padctl, group);
if (err < 0) { if (err < 0) {
error("failed to apply group %s: %d", pr_err("failed to apply group %s: %d",
group->name, err); group->name, err);
continue; continue;
} }
@ -232,7 +232,7 @@ tegra_xusb_padctl_config_parse_dt(struct tegra_xusb_padctl *padctl,
err = tegra_xusb_padctl_group_parse_dt(padctl, group, subnode); err = tegra_xusb_padctl_group_parse_dt(padctl, group, subnode);
if (err < 0) { if (err < 0) {
error("failed to parse group %s", group->name); pr_err("failed to parse group %s", group->name);
return err; return err;
} }
@ -250,7 +250,7 @@ static int tegra_xusb_padctl_parse_dt(struct tegra_xusb_padctl *padctl,
err = ofnode_read_resource(node, 0, &padctl->regs); err = ofnode_read_resource(node, 0, &padctl->regs);
if (err < 0) { if (err < 0) {
error("registers not found"); pr_err("registers not found");
return err; return err;
} }
@ -261,7 +261,7 @@ static int tegra_xusb_padctl_parse_dt(struct tegra_xusb_padctl *padctl,
err = tegra_xusb_padctl_config_parse_dt(padctl, config, err = tegra_xusb_padctl_config_parse_dt(padctl, config,
subnode); subnode);
if (err < 0) { if (err < 0) {
error("failed to parse entry %s: %d", pr_err("failed to parse entry %s: %d",
config->name, err); config->name, err);
continue; continue;
} }
@ -289,7 +289,7 @@ int tegra_xusb_process_nodes(ofnode nodes[], unsigned int count,
err = tegra_xusb_padctl_parse_dt(&padctl, nodes[i]); err = tegra_xusb_padctl_parse_dt(&padctl, nodes[i]);
if (err < 0) { if (err < 0) {
error("failed to parse DT: %d", err); pr_err("failed to parse DT: %d", err);
continue; continue;
} }
@ -298,7 +298,7 @@ int tegra_xusb_process_nodes(ofnode nodes[], unsigned int count,
err = tegra_xusb_padctl_config_apply(&padctl, &padctl.config); err = tegra_xusb_padctl_config_apply(&padctl, &padctl.config);
if (err < 0) { if (err < 0) {
error("failed to apply pinmux: %d", err); pr_err("failed to apply pinmux: %d", err);
continue; continue;
} }

View file

@ -39,7 +39,7 @@ static int sfi_table_check(struct sfi_table_header *sbh)
chksum += *pos++; chksum += *pos++;
if (chksum) if (chksum)
error("sfi: Invalid checksum\n"); pr_err("sfi: Invalid checksum\n");
/* Checksum is OK if zero */ /* Checksum is OK if zero */
return chksum ? -EILSEQ : 0; return chksum ? -EILSEQ : 0;
@ -76,7 +76,7 @@ static struct sfi_table_simple *sfi_search_mmap(void)
/* Find SYST table */ /* Find SYST table */
sb = sfi_get_table_by_sig(SFI_BASE_ADDR, SFI_SIG_SYST); sb = sfi_get_table_by_sig(SFI_BASE_ADDR, SFI_SIG_SYST);
if (!sb) { if (!sb) {
error("sfi: failed to locate SYST table\n"); pr_err("sfi: failed to locate SYST table\n");
return NULL; return NULL;
} }
@ -90,7 +90,7 @@ static struct sfi_table_simple *sfi_search_mmap(void)
return (struct sfi_table_simple *)sbh; return (struct sfi_table_simple *)sbh;
} }
error("sfi: failed to locate SFI MMAP table\n"); pr_err("sfi: failed to locate SFI MMAP table\n");
return NULL; return NULL;
} }

View file

@ -49,7 +49,7 @@ static int as3722_sd_enable(struct udevice *pmic, unsigned int sd)
err = pmic_clrsetbits(pmic, AS3722_SD_CONTROL, 0, 1 << sd); err = pmic_clrsetbits(pmic, AS3722_SD_CONTROL, 0, 1 << sd);
if (err) { if (err) {
error("failed to update SD control register: %d", err); pr_err("failed to update SD control register: %d", err);
return err; return err;
} }
@ -70,13 +70,13 @@ int tegra_pcie_board_init(void)
ret = as3722_sd_enable(dev, 4); ret = as3722_sd_enable(dev, 4);
if (ret < 0) { if (ret < 0) {
error("failed to enable SD4: %d\n", ret); pr_err("failed to enable SD4: %d\n", ret);
return ret; return ret;
} }
ret = as3722_sd_set_voltage(dev, 4, 0x24); ret = as3722_sd_set_voltage(dev, 4, 0x24);
if (ret < 0) { if (ret < 0) {
error("failed to set SD4 voltage: %d\n", ret); pr_err("failed to set SD4 voltage: %d\n", ret);
return ret; return ret;
} }

View file

@ -161,7 +161,7 @@ int board_usb_init(int index, enum usb_init_type init)
samsung_get_base_usb3_phy(); samsung_get_base_usb3_phy();
if (!phy) { if (!phy) {
error("usb3 phy not supported"); pr_err("usb3 phy not supported");
return -ENODEV; return -ENODEV;
} }

View file

@ -457,7 +457,7 @@ void draw_logo(void)
addr = panel_info.logo_addr; addr = panel_info.logo_addr;
if (!addr) { if (!addr) {
error("There is no logo data."); pr_err("There is no logo data.");
return; return;
} }

View file

@ -102,7 +102,7 @@ int board_mmc_init(bd_t *bis)
ret = s5p_mmc_init(0, 4); ret = s5p_mmc_init(0, 4);
if (ret) if (ret)
error("MMC: Failed to init MMC:0.\n"); pr_err("MMC: Failed to init MMC:0.\n");
/* /*
* SD card (T_FLASH) detect and init * SD card (T_FLASH) detect and init
@ -127,7 +127,7 @@ int board_mmc_init(bd_t *bis)
ret_sd = s5p_mmc_init(2, 4); ret_sd = s5p_mmc_init(2, 4);
if (ret_sd) if (ret_sd)
error("MMC: Failed to init SD card (MMC:2).\n"); pr_err("MMC: Failed to init SD card (MMC:2).\n");
} }
return ret & ret_sd; return ret & ret_sd;

View file

@ -429,7 +429,7 @@ int exynos_power_init(void)
}; };
if (regulator_list_autoset(mmc_regulators, NULL, true)) if (regulator_list_autoset(mmc_regulators, NULL, true))
error("Unable to init all mmc regulators"); pr_err("Unable to init all mmc regulators");
return 0; return 0;
} }
@ -442,7 +442,7 @@ static int s5pc210_phy_control(int on)
ret = regulator_get_by_platname("VDD_UOTG_3.0V", &dev); ret = regulator_get_by_platname("VDD_UOTG_3.0V", &dev);
if (ret) { if (ret) {
error("Regulator get error: %d", ret); pr_err("Regulator get error: %d", ret);
return ret; return ret;
} }
@ -487,25 +487,25 @@ int board_usb_init(int index, enum usb_init_type init)
ret = regulator_get_by_platname("VCC_P3V3_2.85V", &dev); ret = regulator_get_by_platname("VCC_P3V3_2.85V", &dev);
if (ret) { if (ret) {
error("Regulator get error: %d", ret); pr_err("Regulator get error: %d", ret);
return ret; return ret;
} }
ret = regulator_set_enable(dev, true); ret = regulator_set_enable(dev, true);
if (ret) { if (ret) {
error("Regulator %s enable setting error: %d", dev->name, ret); pr_err("Regulator %s enable setting error: %d", dev->name, ret);
return ret; return ret;
} }
ret = regulator_set_value(dev, 750000); ret = regulator_set_value(dev, 750000);
if (ret) { if (ret) {
error("Regulator %s value setting error: %d", dev->name, ret); pr_err("Regulator %s value setting error: %d", dev->name, ret);
return ret; return ret;
} }
ret = regulator_set_value(dev, 3300000); ret = regulator_set_value(dev, 3300000);
if (ret) { if (ret) {
error("Regulator %s value setting error: %d", dev->name, ret); pr_err("Regulator %s value setting error: %d", dev->name, ret);
return ret; return ret;
} }
#endif #endif

View file

@ -27,7 +27,7 @@ static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
ret = board_usb_init(controller_index, USB_INIT_DEVICE); ret = board_usb_init(controller_index, USB_INIT_DEVICE);
if (ret) { if (ret) {
error("USB init failed: %d", ret); pr_err("USB init failed: %d", ret);
return CMD_RET_FAILURE; return CMD_RET_FAILURE;
} }

View file

@ -927,7 +927,7 @@ NXTARG: ;
H_MATCH_KEY | H_MATCH_IDENT, H_MATCH_KEY | H_MATCH_IDENT,
&ptr, size, argc, argv); &ptr, size, argc, argv);
if (len < 0) { if (len < 0) {
error("Cannot export environment: errno = %d\n", errno); pr_err("Cannot export environment: errno = %d\n", errno);
return 1; return 1;
} }
sprintf(buf, "%zX", (size_t)len); sprintf(buf, "%zX", (size_t)len);
@ -947,7 +947,7 @@ NXTARG: ;
H_MATCH_KEY | H_MATCH_IDENT, H_MATCH_KEY | H_MATCH_IDENT,
&res, ENV_SIZE, argc, argv); &res, ENV_SIZE, argc, argv);
if (len < 0) { if (len < 0) {
error("Cannot export environment: errno = %d\n", errno); pr_err("Cannot export environment: errno = %d\n", errno);
return 1; return 1;
} }
@ -1082,7 +1082,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
if (himport_r(&env_htab, ptr, size, sep, del ? 0 : H_NOCLEAR, if (himport_r(&env_htab, ptr, size, sep, del ? 0 : H_NOCLEAR,
crlf_is_lf, 0, NULL) == 0) { crlf_is_lf, 0, NULL) == 0) {
error("Environment import failed: errno = %d\n", errno); pr_err("Environment import failed: errno = %d\n", errno);
return 1; return 1;
} }
gd->flags |= GD_FLG_ENV_READY; gd->flags |= GD_FLG_ENV_READY;

View file

@ -71,7 +71,7 @@ static int curr_dev_and_platdata(struct udevice **devp,
*uc_pdata = dev_get_uclass_platdata(*devp); *uc_pdata = dev_get_uclass_platdata(*devp);
if (!*uc_pdata) { if (!*uc_pdata) {
error("Regulator: %s - missing platform data!", currdev->name); pr_err("Regulator: %s - missing platform data!", currdev->name);
return CMD_RET_FAILURE; return CMD_RET_FAILURE;
} }

View file

@ -33,7 +33,7 @@ int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int controller_index = simple_strtoul(usb_controller, NULL, 0); int controller_index = simple_strtoul(usb_controller, NULL, 0);
ret = board_usb_init(controller_index, USB_INIT_DEVICE); ret = board_usb_init(controller_index, USB_INIT_DEVICE);
if (ret) { if (ret) {
error("USB init failed: %d", ret); pr_err("USB init failed: %d", ret);
ret = CMD_RET_FAILURE; ret = CMD_RET_FAILURE;
goto exit; goto exit;
} }
@ -42,14 +42,14 @@ int do_thor_down(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
ret = thor_init(); ret = thor_init();
if (ret) { if (ret) {
error("THOR DOWNLOAD failed: %d", ret); pr_err("THOR DOWNLOAD failed: %d", ret);
ret = CMD_RET_FAILURE; ret = CMD_RET_FAILURE;
goto exit; goto exit;
} }
ret = thor_handle(); ret = thor_handle();
if (ret) { if (ret) {
error("THOR failed: %d", ret); pr_err("THOR failed: %d", ret);
ret = CMD_RET_FAILURE; ret = CMD_RET_FAILURE;
goto exit; goto exit;
} }

View file

@ -303,12 +303,12 @@ static int test_readonly(void)
index_0 += 1; index_0 += 1;
if (tpm_nv_write_value(INDEX0, (uint8_t *)&index_0, sizeof(index_0) != if (tpm_nv_write_value(INDEX0, (uint8_t *)&index_0, sizeof(index_0) !=
TPM_SUCCESS)) { TPM_SUCCESS)) {
error("\tcould not write index 0\n"); pr_err("\tcould not write index 0\n");
} }
tpm_nv_write_value_lock(INDEX0); tpm_nv_write_value_lock(INDEX0);
if (tpm_nv_write_value(INDEX0, (uint8_t *)&index_0, sizeof(index_0)) == if (tpm_nv_write_value(INDEX0, (uint8_t *)&index_0, sizeof(index_0)) ==
TPM_SUCCESS) TPM_SUCCESS)
error("\tindex 0 is not locked\n"); pr_err("\tindex 0 is not locked\n");
printf("\tdone\n"); printf("\tdone\n");
return 0; return 0;
@ -471,7 +471,7 @@ static int test_write_limit(void)
case TPM_MAXNVWRITES: case TPM_MAXNVWRITES:
assert(i >= TPM_MAX_NV_WRITES_NOOWNER); assert(i >= TPM_MAX_NV_WRITES_NOOWNER);
default: default:
error("\tunexpected error code %d (0x%x)\n", pr_err("\tunexpected error code %d (0x%x)\n",
result, result); result, result);
} }
} }

View file

@ -28,13 +28,13 @@ static int do_sdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
ret = sdp_init(controller_index); ret = sdp_init(controller_index);
if (ret) { if (ret) {
error("SDP init failed: %d", ret); pr_err("SDP init failed: %d", ret);
goto exit; goto exit;
} }
/* This command typically does not return but jumps to an image */ /* This command typically does not return but jumps to an image */
sdp_handle(controller_index); sdp_handle(controller_index);
error("SDP ended"); pr_err("SDP ended");
exit: exit:
g_dnl_unregister(); g_dnl_unregister();

View file

@ -162,21 +162,21 @@ static int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
controller_index = (unsigned int)(simple_strtoul( controller_index = (unsigned int)(simple_strtoul(
usb_controller, NULL, 0)); usb_controller, NULL, 0));
if (board_usb_init(controller_index, USB_INIT_DEVICE)) { if (board_usb_init(controller_index, USB_INIT_DEVICE)) {
error("Couldn't init USB controller."); pr_err("Couldn't init USB controller.");
rc = CMD_RET_FAILURE; rc = CMD_RET_FAILURE;
goto cleanup_ums_init; goto cleanup_ums_init;
} }
rc = fsg_init(ums, ums_count); rc = fsg_init(ums, ums_count);
if (rc) { if (rc) {
error("fsg_init failed"); pr_err("fsg_init failed");
rc = CMD_RET_FAILURE; rc = CMD_RET_FAILURE;
goto cleanup_board; goto cleanup_board;
} }
rc = g_dnl_register("usb_dnl_ums"); rc = g_dnl_register("usb_dnl_ums");
if (rc) { if (rc) {
error("g_dnl_register failed"); pr_err("g_dnl_register failed");
rc = CMD_RET_FAILURE; rc = CMD_RET_FAILURE;
goto cleanup_board; goto cleanup_board;
} }

View file

@ -26,13 +26,13 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget)
ret = board_usb_init(usbctrl_index, USB_INIT_DEVICE); ret = board_usb_init(usbctrl_index, USB_INIT_DEVICE);
if (ret) { if (ret) {
error("board usb init failed\n"); pr_err("board usb init failed\n");
return CMD_RET_FAILURE; return CMD_RET_FAILURE;
} }
g_dnl_clear_detach(); g_dnl_clear_detach();
ret = g_dnl_register(usb_dnl_gadget); ret = g_dnl_register(usb_dnl_gadget);
if (ret) { if (ret) {
error("g_dnl_register failed"); pr_err("g_dnl_register failed");
return CMD_RET_FAILURE; return CMD_RET_FAILURE;
} }
@ -75,7 +75,7 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget)
ret = dfu_flush(dfu_get_defer_flush(), NULL, 0, 0); ret = dfu_flush(dfu_get_defer_flush(), NULL, 0, 0);
dfu_set_defer_flush(NULL); dfu_set_defer_flush(NULL);
if (ret) { if (ret) {
error("Deferred dfu_flush() failed!"); pr_err("Deferred dfu_flush() failed!");
goto exit; goto exit;
} }
} }

View file

@ -84,7 +84,7 @@ static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info,
blkcnt = lldiv(blkcnt, info->blksz); blkcnt = lldiv(blkcnt, info->blksz);
if (blkcnt > info->size) { if (blkcnt > info->size) {
error("too large for partition: '%s'\n", part_name); pr_err("too large for partition: '%s'\n", part_name);
fastboot_fail("too large for partition"); fastboot_fail("too large for partition");
return; return;
} }
@ -93,7 +93,7 @@ static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info,
blks = blk_dwrite(dev_desc, info->start, blkcnt, buffer); blks = blk_dwrite(dev_desc, info->start, blkcnt, buffer);
if (blks != blkcnt) { if (blks != blkcnt) {
error("failed writing to device %d\n", dev_desc->devnum); pr_err("failed writing to device %d\n", dev_desc->devnum);
fastboot_fail("failed writing to device"); fastboot_fail("failed writing to device");
return; return;
} }
@ -125,7 +125,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc,
sector_size = info->blksz; sector_size = info->blksz;
hdr_sectors = DIV_ROUND_UP(sizeof(struct andr_img_hdr), sector_size); hdr_sectors = DIV_ROUND_UP(sizeof(struct andr_img_hdr), sector_size);
if (hdr_sectors == 0) { if (hdr_sectors == 0) {
error("invalid number of boot sectors: 0"); pr_err("invalid number of boot sectors: 0");
fastboot_fail("invalid number of boot sectors: 0"); fastboot_fail("invalid number of boot sectors: 0");
return 0; return 0;
} }
@ -133,7 +133,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc,
/* Read the boot image header */ /* Read the boot image header */
res = blk_dread(dev_desc, info->start, hdr_sectors, (void *)hdr); res = blk_dread(dev_desc, info->start, hdr_sectors, (void *)hdr);
if (res != hdr_sectors) { if (res != hdr_sectors) {
error("cannot read header from boot partition"); pr_err("cannot read header from boot partition");
fastboot_fail("cannot read header from boot partition"); fastboot_fail("cannot read header from boot partition");
return 0; return 0;
} }
@ -141,7 +141,7 @@ static lbaint_t fb_mmc_get_boot_header(struct blk_desc *dev_desc,
/* Check boot header magic string */ /* Check boot header magic string */
res = android_image_check_header(hdr); res = android_image_check_header(hdr);
if (res != 0) { if (res != 0) {
error("bad boot image magic"); pr_err("bad boot image magic");
fastboot_fail("boot partition not initialized"); fastboot_fail("boot partition not initialized");
return 0; return 0;
} }
@ -179,7 +179,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
/* Get boot partition info */ /* Get boot partition info */
res = part_get_info_by_name(dev_desc, BOOT_PARTITION_NAME, &info); res = part_get_info_by_name(dev_desc, BOOT_PARTITION_NAME, &info);
if (res < 0) { if (res < 0) {
error("cannot find boot partition"); pr_err("cannot find boot partition");
fastboot_fail("cannot find boot partition"); fastboot_fail("cannot find boot partition");
return -1; return -1;
} }
@ -191,14 +191,14 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
/* Read boot image header */ /* Read boot image header */
hdr_sectors = fb_mmc_get_boot_header(dev_desc, &info, hdr); hdr_sectors = fb_mmc_get_boot_header(dev_desc, &info, hdr);
if (hdr_sectors == 0) { if (hdr_sectors == 0) {
error("unable to read boot image header"); pr_err("unable to read boot image header");
fastboot_fail("unable to read boot image header"); fastboot_fail("unable to read boot image header");
return -1; return -1;
} }
/* Check if boot image has second stage in it (we don't support it) */ /* Check if boot image has second stage in it (we don't support it) */
if (hdr->second_size > 0) { if (hdr->second_size > 0) {
error("moving second stage is not supported yet"); pr_err("moving second stage is not supported yet");
fastboot_fail("moving second stage is not supported yet"); fastboot_fail("moving second stage is not supported yet");
return -1; return -1;
} }
@ -216,7 +216,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
res = blk_dread(dev_desc, ramdisk_sector_start, ramdisk_sectors, res = blk_dread(dev_desc, ramdisk_sector_start, ramdisk_sectors,
ramdisk_buffer); ramdisk_buffer);
if (res != ramdisk_sectors) { if (res != ramdisk_sectors) {
error("cannot read ramdisk from boot partition"); pr_err("cannot read ramdisk from boot partition");
fastboot_fail("cannot read ramdisk from boot partition"); fastboot_fail("cannot read ramdisk from boot partition");
return -1; return -1;
} }
@ -225,7 +225,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
hdr->kernel_size = download_bytes; hdr->kernel_size = download_bytes;
res = blk_dwrite(dev_desc, info.start, hdr_sectors, (void *)hdr); res = blk_dwrite(dev_desc, info.start, hdr_sectors, (void *)hdr);
if (res == 0) { if (res == 0) {
error("cannot writeback boot image header"); pr_err("cannot writeback boot image header");
fastboot_fail("cannot write back boot image header"); fastboot_fail("cannot write back boot image header");
return -1; return -1;
} }
@ -237,7 +237,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
res = blk_dwrite(dev_desc, kernel_sector_start, kernel_sectors, res = blk_dwrite(dev_desc, kernel_sector_start, kernel_sectors,
download_buffer); download_buffer);
if (res == 0) { if (res == 0) {
error("cannot write new kernel"); pr_err("cannot write new kernel");
fastboot_fail("cannot write new kernel"); fastboot_fail("cannot write new kernel");
return -1; return -1;
} }
@ -249,7 +249,7 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
res = blk_dwrite(dev_desc, ramdisk_sector_start, ramdisk_sectors, res = blk_dwrite(dev_desc, ramdisk_sector_start, ramdisk_sectors,
ramdisk_buffer); ramdisk_buffer);
if (res == 0) { if (res == 0) {
error("cannot write back original ramdisk"); pr_err("cannot write back original ramdisk");
fastboot_fail("cannot write back original ramdisk"); fastboot_fail("cannot write back original ramdisk");
return -1; return -1;
} }
@ -268,7 +268,7 @@ void fb_mmc_flash_write(const char *cmd, void *download_buffer,
dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV); dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) { if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) {
error("invalid mmc device\n"); pr_err("invalid mmc device\n");
fastboot_fail("invalid mmc device"); fastboot_fail("invalid mmc device");
return; return;
} }
@ -322,7 +322,7 @@ void fb_mmc_flash_write(const char *cmd, void *download_buffer,
#endif #endif
if (part_get_info_by_name_or_alias(dev_desc, cmd, &info) < 0) { if (part_get_info_by_name_or_alias(dev_desc, cmd, &info) < 0) {
error("cannot find partition: '%s'\n", cmd); pr_err("cannot find partition: '%s'\n", cmd);
fastboot_fail("cannot find partition"); fastboot_fail("cannot find partition");
return; return;
} }
@ -360,21 +360,21 @@ void fb_mmc_erase(const char *cmd)
struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV); struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV);
if (mmc == NULL) { if (mmc == NULL) {
error("invalid mmc device"); pr_err("invalid mmc device");
fastboot_fail("invalid mmc device"); fastboot_fail("invalid mmc device");
return; return;
} }
dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV); dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) { if (!dev_desc || dev_desc->type == DEV_TYPE_UNKNOWN) {
error("invalid mmc device"); pr_err("invalid mmc device");
fastboot_fail("invalid mmc device"); fastboot_fail("invalid mmc device");
return; return;
} }
ret = part_get_info_by_name_or_alias(dev_desc, cmd, &info); ret = part_get_info_by_name_or_alias(dev_desc, cmd, &info);
if (ret < 0) { if (ret < 0) {
error("cannot find partition: '%s'", cmd); pr_err("cannot find partition: '%s'", cmd);
fastboot_fail("cannot find partition"); fastboot_fail("cannot find partition");
return; return;
} }
@ -393,7 +393,7 @@ void fb_mmc_erase(const char *cmd)
blks = blk_derase(dev_desc, blks_start, blks_size); blks = blk_derase(dev_desc, blks_start, blks_size);
if (blks != blks_size) { if (blks != blks_size) {
error("failed erasing from device %d", dev_desc->devnum); pr_err("failed erasing from device %d", dev_desc->devnum);
fastboot_fail("failed erasing from device"); fastboot_fail("failed erasing from device");
return; return;
} }

View file

@ -40,20 +40,20 @@ static int fb_nand_lookup(const char *partname,
ret = mtdparts_init(); ret = mtdparts_init();
if (ret) { if (ret) {
error("Cannot initialize MTD partitions\n"); pr_err("Cannot initialize MTD partitions\n");
fastboot_fail("cannot init mtdparts"); fastboot_fail("cannot init mtdparts");
return ret; return ret;
} }
ret = find_dev_and_part(partname, &dev, &pnum, part); ret = find_dev_and_part(partname, &dev, &pnum, part);
if (ret) { if (ret) {
error("cannot find partition: '%s'", partname); pr_err("cannot find partition: '%s'", partname);
fastboot_fail("cannot find partition"); fastboot_fail("cannot find partition");
return ret; return ret;
} }
if (dev->id->type != MTD_DEV_TYPE_NAND) { if (dev->id->type != MTD_DEV_TYPE_NAND) {
error("partition '%s' is not stored on a NAND device", pr_err("partition '%s' is not stored on a NAND device",
partname); partname);
fastboot_fail("not a NAND device"); fastboot_fail("not a NAND device");
return -EINVAL; return -EINVAL;
@ -154,7 +154,7 @@ void fb_nand_flash_write(const char *cmd, void *download_buffer,
ret = fb_nand_lookup(cmd, &mtd, &part); ret = fb_nand_lookup(cmd, &mtd, &part);
if (ret) { if (ret) {
error("invalid NAND device"); pr_err("invalid NAND device");
fastboot_fail("invalid NAND device"); fastboot_fail("invalid NAND device");
return; return;
} }
@ -209,7 +209,7 @@ void fb_nand_erase(const char *cmd)
ret = fb_nand_lookup(cmd, &mtd, &part); ret = fb_nand_lookup(cmd, &mtd, &part);
if (ret) { if (ret) {
error("invalid NAND device"); pr_err("invalid NAND device");
fastboot_fail("invalid NAND device"); fastboot_fail("invalid NAND device");
return; return;
} }
@ -220,7 +220,7 @@ void fb_nand_erase(const char *cmd)
ret = _fb_nand_erase(mtd, part); ret = _fb_nand_erase(mtd, part);
if (ret) { if (ret) {
error("failed erasing from device %s", mtd->name); pr_err("failed erasing from device %s", mtd->name);
fastboot_fail("failed erasing from device"); fastboot_fail("failed erasing from device");
return; return;
} }

View file

@ -42,13 +42,13 @@ int spl_dfu_cmd(int usbctrl, char *dfu_alt_info, char *interface, char *devstr)
set_default_env(0); set_default_env(0);
str_env = env_get(dfu_alt_info); str_env = env_get(dfu_alt_info);
if (!str_env) { if (!str_env) {
error("\"dfu_alt_info\" env variable not defined!\n"); pr_err("\"dfu_alt_info\" env variable not defined!\n");
return -EINVAL; return -EINVAL;
} }
ret = env_set("dfu_alt_info", str_env); ret = env_set("dfu_alt_info", str_env);
if (ret) { if (ret) {
error("unable to set env variable \"dfu_alt_info\"!\n"); pr_err("unable to set env variable \"dfu_alt_info\"!\n");
return -EINVAL; return -EINVAL;
} }

View file

@ -24,13 +24,13 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image,
ret = sdp_init(controller_index); ret = sdp_init(controller_index);
if (ret) { if (ret) {
error("SDP init failed: %d", ret); pr_err("SDP init failed: %d", ret);
return -ENODEV; return -ENODEV;
} }
/* This command typically does not return but jumps to an image */ /* This command typically does not return but jumps to an image */
sdp_handle(controller_index); sdp_handle(controller_index);
error("SDP ended"); pr_err("SDP ended");
return -EINVAL; return -EINVAL;
} }

View file

@ -242,7 +242,7 @@ int update_tftp(ulong addr, char *interface, char *devstring)
} else if (interface && devstring) { } else if (interface && devstring) {
update_tftp_dfu = true; update_tftp_dfu = true;
} else { } else {
error("Interface: %s and devstring: %s not supported!\n", pr_err("Interface: %s and devstring: %s not supported!\n",
interface, devstring); interface, devstring);
return -EINVAL; return -EINVAL;
} }

View file

@ -360,7 +360,7 @@ static int set_protective_mbr(struct blk_desc *dev_desc)
/* Read MBR to backup boot code if it exists */ /* Read MBR to backup boot code if it exists */
if (blk_dread(dev_desc, 0, 1, p_mbr) != 1) { if (blk_dread(dev_desc, 0, 1, p_mbr) != 1) {
error("** Can't read from device %d **\n", dev_desc->devnum); pr_err("** Can't read from device %d **\n", dev_desc->devnum);
return -1; return -1;
} }
@ -716,7 +716,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
for (i = 0; i < parts; i++) { for (i = 0; i < parts; i++) {
if (i == gpt_head->num_partition_entries) { if (i == gpt_head->num_partition_entries) {
error("More partitions than allowed!\n"); pr_err("More partitions than allowed!\n");
return -1; return -1;
} }
@ -729,7 +729,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
if (strncmp(efi_str, (char *)partitions[i].name, if (strncmp(efi_str, (char *)partitions[i].name,
sizeof(partitions->name))) { sizeof(partitions->name))) {
error("Partition name: %s does not match %s!\n", pr_err("Partition name: %s does not match %s!\n",
efi_str, (char *)partitions[i].name); efi_str, (char *)partitions[i].name);
return -1; return -1;
} }
@ -746,7 +746,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
if ((i == parts - 1) && (partitions[i].size == 0)) if ((i == parts - 1) && (partitions[i].size == 0))
continue; continue;
error("Partition %s size: %llu does not match %llu!\n", pr_err("Partition %s size: %llu does not match %llu!\n",
efi_str, (unsigned long long)gpt_part_size, efi_str, (unsigned long long)gpt_part_size,
(unsigned long long)partitions[i].size); (unsigned long long)partitions[i].size);
return -1; return -1;
@ -767,7 +767,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc,
(unsigned long long)partitions[i].start); (unsigned long long)partitions[i].start);
if (le64_to_cpu(gpt_e[i].starting_lba) != partitions[i].start) { if (le64_to_cpu(gpt_e[i].starting_lba) != partitions[i].start) {
error("Partition %s start: %llu does not match %llu!\n", pr_err("Partition %s start: %llu does not match %llu!\n",
efi_str, le64_to_cpu(gpt_e[i].starting_lba), efi_str, le64_to_cpu(gpt_e[i].starting_lba),
(unsigned long long)partitions[i].start); (unsigned long long)partitions[i].start);
return -1; return -1;

View file

@ -64,7 +64,7 @@ static int adc_supply_enable(struct udevice *dev)
} }
if (ret) if (ret)
error("%s: can't enable %s-supply!", dev->name, supply_type); pr_err("%s: can't enable %s-supply!", dev->name, supply_type);
return ret; return ret;
} }
@ -389,12 +389,12 @@ static int adc_pre_probe(struct udevice *dev)
/* Set ADC VDD platdata: polarity, uV, regulator (phandle). */ /* Set ADC VDD platdata: polarity, uV, regulator (phandle). */
ret = adc_vdd_platdata_set(dev); ret = adc_vdd_platdata_set(dev);
if (ret) if (ret)
error("%s: Can't update Vdd. Error: %d", dev->name, ret); pr_err("%s: Can't update Vdd. Error: %d", dev->name, ret);
/* Set ADC VSS platdata: polarity, uV, regulator (phandle). */ /* Set ADC VSS platdata: polarity, uV, regulator (phandle). */
ret = adc_vss_platdata_set(dev); ret = adc_vss_platdata_set(dev);
if (ret) if (ret)
error("%s: Can't update Vss. Error: %d", dev->name, ret); pr_err("%s: Can't update Vss. Error: %d", dev->name, ret);
return 0; return 0;
} }

View file

@ -22,7 +22,7 @@ int exynos_adc_channel_data(struct udevice *dev, int channel,
struct exynos_adc_v2 *regs = priv->regs; struct exynos_adc_v2 *regs = priv->regs;
if (channel != priv->active_channel) { if (channel != priv->active_channel) {
error("Requested channel is not active!"); pr_err("Requested channel is not active!");
return -EINVAL; return -EINVAL;
} }
@ -80,7 +80,7 @@ int exynos_adc_probe(struct udevice *dev)
/* Check HW version */ /* Check HW version */
if (readl(&regs->version) != ADC_V2_VERSION) { if (readl(&regs->version) != ADC_V2_VERSION) {
error("This driver supports only ADC v2!"); pr_err("This driver supports only ADC v2!");
return -ENXIO; return -ENXIO;
} }
@ -109,7 +109,7 @@ int exynos_adc_ofdata_to_platdata(struct udevice *dev)
priv->regs = (struct exynos_adc_v2 *)devfdt_get_addr(dev); priv->regs = (struct exynos_adc_v2 *)devfdt_get_addr(dev);
if (priv->regs == (struct exynos_adc_v2 *)FDT_ADDR_T_NONE) { if (priv->regs == (struct exynos_adc_v2 *)FDT_ADDR_T_NONE) {
error("Dev: %s - can't get address!", dev->name); pr_err("Dev: %s - can't get address!", dev->name);
return -ENODATA; return -ENODATA;
} }

View file

@ -46,7 +46,7 @@ int rockchip_saradc_channel_data(struct udevice *dev, int channel,
struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev); struct adc_uclass_platdata *uc_pdata = dev_get_uclass_platdata(dev);
if (channel != priv->active_channel) { if (channel != priv->active_channel) {
error("Requested channel is not active!"); pr_err("Requested channel is not active!");
return -EINVAL; return -EINVAL;
} }
@ -69,7 +69,7 @@ int rockchip_saradc_start_channel(struct udevice *dev, int channel)
struct rockchip_saradc_priv *priv = dev_get_priv(dev); struct rockchip_saradc_priv *priv = dev_get_priv(dev);
if (channel < 0 || channel >= priv->data->num_channels) { if (channel < 0 || channel >= priv->data->num_channels) {
error("Requested channel is invalid!"); pr_err("Requested channel is invalid!");
return -EINVAL; return -EINVAL;
} }
@ -125,7 +125,7 @@ int rockchip_saradc_ofdata_to_platdata(struct udevice *dev)
data = (struct rockchip_saradc_data *)dev_get_driver_data(dev); data = (struct rockchip_saradc_data *)dev_get_driver_data(dev);
priv->regs = (struct rockchip_saradc_regs *)dev_read_addr(dev); priv->regs = (struct rockchip_saradc_regs *)dev_read_addr(dev);
if (priv->regs == (struct rockchip_saradc_regs *)FDT_ADDR_T_NONE) { if (priv->regs == (struct rockchip_saradc_regs *)FDT_ADDR_T_NONE) {
error("Dev: %s - can't get address!", dev->name); pr_err("Dev: %s - can't get address!", dev->name);
return -ENODATA; return -ENODATA;
} }

View file

@ -61,7 +61,7 @@ int sandbox_adc_channel_data(struct udevice *dev, int channel,
/* For single-channel conversion mode, check if channel was selected */ /* For single-channel conversion mode, check if channel was selected */
if ((priv->conversion_mode == SANDBOX_ADC_MODE_SINGLE_CHANNEL) && if ((priv->conversion_mode == SANDBOX_ADC_MODE_SINGLE_CHANNEL) &&
!(priv->active_channel_mask & (1 << channel))) { !(priv->active_channel_mask & (1 << channel))) {
error("Request for an inactive channel!"); pr_err("Request for an inactive channel!");
return -EINVAL; return -EINVAL;
} }
@ -82,12 +82,12 @@ int sandbox_adc_channels_data(struct udevice *dev, unsigned int channel_mask,
/* Return error for single-channel conversion mode */ /* Return error for single-channel conversion mode */
if (priv->conversion_mode == SANDBOX_ADC_MODE_SINGLE_CHANNEL) { if (priv->conversion_mode == SANDBOX_ADC_MODE_SINGLE_CHANNEL) {
error("ADC in single-channel mode!"); pr_err("ADC in single-channel mode!");
return -EPERM; return -EPERM;
} }
/* Check channel selection */ /* Check channel selection */
if (!(priv->active_channel_mask & channel_mask)) { if (!(priv->active_channel_mask & channel_mask)) {
error("Request for an inactive channel!"); pr_err("Request for an inactive channel!");
return -EINVAL; return -EINVAL;
} }
/* The conversion must be started before reading the data */ /* The conversion must be started before reading the data */

View file

@ -58,19 +58,19 @@ static int dwc_ahci_probe(struct udevice *dev)
ret = generic_phy_get_by_name(dev, "sata-phy", &phy); ret = generic_phy_get_by_name(dev, "sata-phy", &phy);
if (ret) { if (ret) {
error("can't get the phy from DT\n"); pr_err("can't get the phy from DT\n");
return ret; return ret;
} }
ret = generic_phy_init(&phy); ret = generic_phy_init(&phy);
if (ret) { if (ret) {
error("unable to initialize the sata phy\n"); pr_err("unable to initialize the sata phy\n");
return ret; return ret;
} }
ret = generic_phy_power_on(&phy); ret = generic_phy_power_on(&phy);
if (ret) { if (ret) {
error("unable to power on the sata phy\n"); pr_err("unable to power on the sata phy\n");
return ret; return ret;
} }

View file

@ -67,13 +67,13 @@ static int clk_boston_ofdata_to_platdata(struct udevice *dev)
err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
"regmap", &syscon); "regmap", &syscon);
if (err) { if (err) {
error("unable to find syscon device\n"); pr_err("unable to find syscon device\n");
return err; return err;
} }
state->regmap = syscon_get_regmap(syscon); state->regmap = syscon_get_regmap(syscon);
if (!state->regmap) { if (!state->regmap) {
error("unable to find regmap\n"); pr_err("unable to find regmap\n");
return -ENODEV; return -ENODEV;
} }

View file

@ -224,7 +224,7 @@ static unsigned long stm32_clk_get_rate(struct clk *clk)
return sysclk >>= shift; return sysclk >>= shift;
break; break;
default: default:
error("clock index %ld out of range\n", clk->id); pr_err("clock index %ld out of range\n", clk->id);
return -EINVAL; return -EINVAL;
break; break;
} }

View file

@ -472,13 +472,13 @@ static ulong stm32_get_rate(struct stm32_rcc_regs *regs, enum pllsrc pllsrc)
clk.id = 0; clk.id = 0;
ret = uclass_get_device_by_name(UCLASS_CLK, name, &fixed_clock_dev); ret = uclass_get_device_by_name(UCLASS_CLK, name, &fixed_clock_dev);
if (ret) { if (ret) {
error("Can't find clk %s (%d)", name, ret); pr_err("Can't find clk %s (%d)", name, ret);
return 0; return 0;
} }
ret = clk_request(fixed_clock_dev, &clk); ret = clk_request(fixed_clock_dev, &clk);
if (ret) { if (ret) {
error("Can't request %s clk (%d)", name, ret); pr_err("Can't request %s clk (%d)", name, ret);
return 0; return 0;
} }
@ -518,7 +518,7 @@ static u32 stm32_get_PLL1_rate(struct stm32_rcc_regs *regs,
break; break;
case RCC_PLLCKSELR_PLLSRC_NO_CLK: case RCC_PLLCKSELR_PLLSRC_NO_CLK:
/* shouldn't happen */ /* shouldn't happen */
error("wrong value for RCC_PLLCKSELR register\n"); pr_err("wrong value for RCC_PLLCKSELR register\n");
pllsrc = 0; pllsrc = 0;
break; break;
} }
@ -695,7 +695,7 @@ static ulong stm32_clk_get_rate(struct clk *clk)
break; break;
default: default:
error("unexpected gate_offset value (0x%x)\n", gate_offset); pr_err("unexpected gate_offset value (0x%x)\n", gate_offset);
return -EINVAL; return -EINVAL;
break; break;
} }
@ -739,13 +739,13 @@ static int stm32_clk_probe(struct udevice *dev)
"st,syscfg", &syscon); "st,syscfg", &syscon);
if (err) { if (err) {
error("unable to find syscon device\n"); pr_err("unable to find syscon device\n");
return err; return err;
} }
priv->pwr_regmap = syscon_get_regmap(syscon); priv->pwr_regmap = syscon_get_regmap(syscon);
if (!priv->pwr_regmap) { if (!priv->pwr_regmap) {
error("unable to find regmap\n"); pr_err("unable to find regmap\n");
return -ENODEV; return -ENODEV;
} }

View file

@ -302,7 +302,7 @@ static ulong rk3368_ddr_set_clk(struct rk3368_cru *cru, ulong set_rate)
dpll_cfg = &dpll_1600; dpll_cfg = &dpll_1600;
break; break;
default: default:
error("Unsupported SDRAM frequency!,%ld\n", set_rate); pr_err("Unsupported SDRAM frequency!,%ld\n", set_rate);
} }
rkclk_set_pll(cru, DPLL, dpll_cfg); rkclk_set_pll(cru, DPLL, dpll_cfg);
@ -360,7 +360,7 @@ static ulong rk3368_spi_get_clk(struct rk3368_cru *cru, ulong clk_id)
break; break;
default: default:
error("%s: SPI clk-id %ld not supported\n", __func__, clk_id); pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
return -EINVAL; return -EINVAL;
} }
@ -385,7 +385,7 @@ static ulong rk3368_spi_set_clk(struct rk3368_cru *cru, ulong clk_id, uint hz)
break; break;
default: default:
error("%s: SPI clk-id %ld not supported\n", __func__, clk_id); pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
return -EINVAL; return -EINVAL;
} }
@ -530,7 +530,7 @@ static int rk3368_clk_bind(struct udevice *dev)
/* The reset driver does not have a device node, so bind it here */ /* The reset driver does not have a device node, so bind it here */
ret = device_bind_driver(gd->dm_root, "rk3368_sysreset", "reset", &dev); ret = device_bind_driver(gd->dm_root, "rk3368_sysreset", "reset", &dev);
if (ret) if (ret)
error("bind RK3368 reset driver failed: ret=%d\n", ret); pr_err("bind RK3368 reset driver failed: ret=%d\n", ret);
return ret; return ret;
} }

View file

@ -663,7 +663,7 @@ static ulong rk3399_spi_get_clk(struct rk3399_cru *cru, ulong clk_id)
break; break;
default: default:
error("%s: SPI clk-id %ld not supported\n", __func__, clk_id); pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
return -EINVAL; return -EINVAL;
} }
@ -687,7 +687,7 @@ static ulong rk3399_spi_set_clk(struct rk3399_cru *cru, ulong clk_id, uint hz)
break; break;
default: default:
error("%s: SPI clk-id %ld not supported\n", __func__, clk_id); pr_err("%s: SPI clk-id %ld not supported\n", __func__, clk_id);
return -EINVAL; return -EINVAL;
} }
@ -856,7 +856,7 @@ static ulong rk3399_ddr_set_clk(struct rk3399_cru *cru,
{.refdiv = 1, .fbdiv = 116, .postdiv1 = 3, .postdiv2 = 1}; {.refdiv = 1, .fbdiv = 116, .postdiv1 = 3, .postdiv2 = 1};
break; break;
default: default:
error("Unsupported SDRAM frequency!,%ld\n", set_rate); pr_err("Unsupported SDRAM frequency!,%ld\n", set_rate);
} }
rkclk_set_pll(&cru->dpll_con[0], &dpll_cfg); rkclk_set_pll(&cru->dpll_con[0], &dpll_cfg);

View file

@ -227,7 +227,7 @@ static int rv1108_clk_bind(struct udevice *dev)
/* The reset driver does not have a device node, so bind it here */ /* The reset driver does not have a device node, so bind it here */
ret = device_bind_driver(gd->dm_root, "rv1108_sysreset", "reset", &dev); ret = device_bind_driver(gd->dm_root, "rv1108_sysreset", "reset", &dev);
if (ret) if (ret)
error("No Rv1108 reset driver: ret=%d\n", ret); pr_err("No Rv1108 reset driver: ret=%d\n", ret);
return 0; return 0;
} }

View file

@ -64,14 +64,14 @@ int dfu_init_env_entities(char *interface, char *devstr)
#endif #endif
str_env = env_get("dfu_alt_info"); str_env = env_get("dfu_alt_info");
if (!str_env) { if (!str_env) {
error("\"dfu_alt_info\" env variable not defined!\n"); pr_err("\"dfu_alt_info\" env variable not defined!\n");
return -EINVAL; return -EINVAL;
} }
env_bkp = strdup(str_env); env_bkp = strdup(str_env);
ret = dfu_config_entities(env_bkp, interface, devstr); ret = dfu_config_entities(env_bkp, interface, devstr);
if (ret) { if (ret) {
error("DFU entities configuration failed!\n"); pr_err("DFU entities configuration failed!\n");
return ret; return ret;
} }
@ -132,7 +132,7 @@ static char *dfu_get_hash_algo(void)
return s; return s;
} }
error("DFU hash method: %s not supported!\n", s); pr_err("DFU hash method: %s not supported!\n", s);
return NULL; return NULL;
} }
@ -273,7 +273,7 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
/* we should be in buffer now (if not then size too large) */ /* we should be in buffer now (if not then size too large) */
if ((dfu->i_buf + size) > dfu->i_buf_end) { if ((dfu->i_buf + size) > dfu->i_buf_end) {
error("Buffer overflow! (0x%p + 0x%x > 0x%p)\n", dfu->i_buf, pr_err("Buffer overflow! (0x%p + 0x%x > 0x%p)\n", dfu->i_buf,
size, dfu->i_buf_end); size, dfu->i_buf_end);
dfu_transaction_cleanup(dfu); dfu_transaction_cleanup(dfu);
return -1; return -1;
@ -451,7 +451,7 @@ int dfu_config_entities(char *env, char *interface, char *devstr)
if (s) { if (s) {
ret = hash_lookup_algo(s, &dfu_hash_algo); ret = hash_lookup_algo(s, &dfu_hash_algo);
if (ret) if (ret)
error("Hash algorithm %s not supported\n", s); pr_err("Hash algorithm %s not supported\n", s);
} }
dfu = calloc(sizeof(*dfu), dfu_alt_num); dfu = calloc(sizeof(*dfu), dfu_alt_num);
@ -576,7 +576,7 @@ int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size)
dp, left, write); dp, left, write);
ret = dfu_write(dfu, dp, write, i); ret = dfu_write(dfu, dp, write, i);
if (ret) { if (ret) {
error("DFU write failed\n"); pr_err("DFU write failed\n");
return ret; return ret;
} }
@ -586,7 +586,7 @@ int dfu_write_from_mem_addr(struct dfu_entity *dfu, void *buf, int size)
ret = dfu_flush(dfu, NULL, 0, i); ret = dfu_flush(dfu, NULL, 0, i);
if (ret) if (ret)
error("DFU flush failed!"); pr_err("DFU flush failed!");
return ret; return ret;
} }

View file

@ -29,7 +29,7 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
mmc = find_mmc_device(dfu->data.mmc.dev_num); mmc = find_mmc_device(dfu->data.mmc.dev_num);
if (!mmc) { if (!mmc) {
error("Device MMC %d - not found!", dfu->data.mmc.dev_num); pr_err("Device MMC %d - not found!", dfu->data.mmc.dev_num);
return -ENODEV; return -ENODEV;
} }
@ -69,11 +69,11 @@ static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
buf); buf);
break; break;
default: default:
error("Operation not supported\n"); pr_err("Operation not supported\n");
} }
if (n != blk_count) { if (n != blk_count) {
error("MMC operation failed"); pr_err("MMC operation failed");
if (dfu->data.mmc.hw_partition >= 0) if (dfu->data.mmc.hw_partition >= 0)
blk_select_hwpart_devnum(IF_TYPE_MMC, blk_select_hwpart_devnum(IF_TYPE_MMC,
dfu->data.mmc.dev_num, dfu->data.mmc.dev_num,
@ -312,7 +312,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
for (; parg < argv + sizeof(argv) / sizeof(*argv); ++parg) { for (; parg < argv + sizeof(argv) / sizeof(*argv); ++parg) {
*parg = strsep(&s, " "); *parg = strsep(&s, " ");
if (*parg == NULL) { if (*parg == NULL) {
error("Invalid number of arguments.\n"); pr_err("Invalid number of arguments.\n");
return -ENODEV; return -ENODEV;
} }
} }
@ -327,13 +327,13 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
mmc = find_mmc_device(dfu->data.mmc.dev_num); mmc = find_mmc_device(dfu->data.mmc.dev_num);
if (mmc == NULL) { if (mmc == NULL) {
error("Couldn't find MMC device no. %d.\n", pr_err("Couldn't find MMC device no. %d.\n",
dfu->data.mmc.dev_num); dfu->data.mmc.dev_num);
return -ENODEV; return -ENODEV;
} }
if (mmc_init(mmc)) { if (mmc_init(mmc)) {
error("Couldn't init MMC device.\n"); pr_err("Couldn't init MMC device.\n");
return -ENODEV; return -ENODEV;
} }
@ -360,7 +360,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
int mmcpart = third_arg; int mmcpart = third_arg;
if (part_get_info(blk_dev, mmcpart, &partinfo) != 0) { if (part_get_info(blk_dev, mmcpart, &partinfo) != 0) {
error("Couldn't find part #%d on mmc device #%d\n", pr_err("Couldn't find part #%d on mmc device #%d\n",
mmcpart, mmcdev); mmcpart, mmcdev);
return -ENODEV; return -ENODEV;
} }
@ -374,7 +374,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
} else if (!strcmp(entity_type, "ext4")) { } else if (!strcmp(entity_type, "ext4")) {
dfu->layout = DFU_FS_EXT4; dfu->layout = DFU_FS_EXT4;
} else { } else {
error("Memory layout (%s) not supported!\n", entity_type); pr_err("Memory layout (%s) not supported!\n", entity_type);
return -ENODEV; return -ENODEV;
} }
@ -397,7 +397,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
dfu_file_buf = memalign(CONFIG_SYS_CACHELINE_SIZE, dfu_file_buf = memalign(CONFIG_SYS_CACHELINE_SIZE,
CONFIG_SYS_DFU_MAX_FILE_SIZE); CONFIG_SYS_DFU_MAX_FILE_SIZE);
if (!dfu_file_buf) { if (!dfu_file_buf) {
error("Could not memalign 0x%x bytes", pr_err("Could not memalign 0x%x bytes",
CONFIG_SYS_DFU_MAX_FILE_SIZE); CONFIG_SYS_DFU_MAX_FILE_SIZE);
return -ENOMEM; return -ENOMEM;
} }

View file

@ -18,12 +18,12 @@ static int dfu_transfer_medium_ram(enum dfu_op op, struct dfu_entity *dfu,
u64 offset, void *buf, long *len) u64 offset, void *buf, long *len)
{ {
if (dfu->layout != DFU_RAM_ADDR) { if (dfu->layout != DFU_RAM_ADDR) {
error("unsupported layout: %s\n", dfu_get_layout(dfu->layout)); pr_err("unsupported layout: %s\n", dfu_get_layout(dfu->layout));
return -EINVAL; return -EINVAL;
} }
if (offset > dfu->data.ram.size) { if (offset > dfu->data.ram.size) {
error("request exceeds allowed area\n"); pr_err("request exceeds allowed area\n");
return -EINVAL; return -EINVAL;
} }
@ -62,14 +62,14 @@ int dfu_fill_entity_ram(struct dfu_entity *dfu, char *devstr, char *s)
for (; parg < argv + sizeof(argv) / sizeof(*argv); ++parg) { for (; parg < argv + sizeof(argv) / sizeof(*argv); ++parg) {
*parg = strsep(&s, " "); *parg = strsep(&s, " ");
if (*parg == NULL) { if (*parg == NULL) {
error("Invalid number of arguments.\n"); pr_err("Invalid number of arguments.\n");
return -ENODEV; return -ENODEV;
} }
} }
dfu->dev_type = DFU_DEV_RAM; dfu->dev_type = DFU_DEV_RAM;
if (strcmp(argv[0], "ram")) { if (strcmp(argv[0], "ram")) {
error("unsupported device: %s\n", argv[0]); pr_err("unsupported device: %s\n", argv[0]);
return -ENODEV; return -ENODEV;
} }

View file

@ -43,7 +43,7 @@ int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len,
alt_setting_num = dfu_get_alt(sb); alt_setting_num = dfu_get_alt(sb);
free(sb); free(sb);
if (alt_setting_num < 0) { if (alt_setting_num < 0) {
error("Alt setting [%d] to write not found!", pr_err("Alt setting [%d] to write not found!",
alt_setting_num); alt_setting_num);
ret = -ENODEV; ret = -ENODEV;
goto done; goto done;
@ -51,7 +51,7 @@ int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int len,
dfu = dfu_get_entity(alt_setting_num); dfu = dfu_get_entity(alt_setting_num);
if (!dfu) { if (!dfu) {
error("DFU entity for alt: %d not found!", alt_setting_num); pr_err("DFU entity for alt: %d not found!", alt_setting_num);
ret = -ENODEV; ret = -ENODEV;
goto done; goto done;
} }

View file

@ -33,7 +33,7 @@ int dma_get_device(u32 transfer_type, struct udevice **devp)
} }
if (!dev) { if (!dev) {
error("No DMA device found that supports %x type\n", pr_err("No DMA device found that supports %x type\n",
transfer_type); transfer_type);
return -EPROTONOSUPPORT; return -EPROTONOSUPPORT;
} }

View file

@ -96,7 +96,7 @@ int lpc32xx_dma_start_xfer(unsigned int channel,
{ {
if (unlikely(((BIT_MASK(channel) & alloc_ch) == 0) || if (unlikely(((BIT_MASK(channel) & alloc_ch) == 0) ||
(channel >= DMA_NO_OF_CHANNELS))) { (channel >= DMA_NO_OF_CHANNELS))) {
error("Request for xfer on unallocated channel %d", channel); pr_err("Request for xfer on unallocated channel %d", channel);
return -1; return -1;
} }
writel(BIT_MASK(channel), &dma->int_tc_clear); writel(BIT_MASK(channel), &dma->int_tc_clear);
@ -117,7 +117,7 @@ int lpc32xx_dma_wait_status(unsigned int channel)
/* Check if given channel is valid */ /* Check if given channel is valid */
if (unlikely(channel >= DMA_NO_OF_CHANNELS)) { if (unlikely(channel >= DMA_NO_OF_CHANNELS)) {
error("Request for status on unallocated channel %d", channel); pr_err("Request for status on unallocated channel %d", channel);
return -1; return -1;
} }
@ -129,7 +129,7 @@ int lpc32xx_dma_wait_status(unsigned int channel)
break; break;
if (get_timer(start) > CONFIG_SYS_HZ) { if (get_timer(start) > CONFIG_SYS_HZ) {
error("DMA status timeout channel %d\n", channel); pr_err("DMA status timeout channel %d\n", channel);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
udelay(1); udelay(1);
@ -138,7 +138,7 @@ int lpc32xx_dma_wait_status(unsigned int channel)
if (unlikely(readl(&dma->raw_err_stat) & BIT_MASK(channel))) { if (unlikely(readl(&dma->raw_err_stat) & BIT_MASK(channel))) {
setbits_le32(&dma->int_err_clear, BIT_MASK(channel)); setbits_le32(&dma->int_err_clear, BIT_MASK(channel));
setbits_le32(&dma->raw_err_stat, BIT_MASK(channel)); setbits_le32(&dma->raw_err_stat, BIT_MASK(channel));
error("DMA error on channel %d\n", channel); pr_err("DMA error on channel %d\n", channel);
return -1; return -1;
} }
setbits_le32(&dma->int_tc_clear, BIT_MASK(channel)); setbits_le32(&dma->int_tc_clear, BIT_MASK(channel));

View file

@ -491,7 +491,7 @@ static int ti_edma3_transfer(struct udevice *dev, int direction, void *dst,
__edma3_transfer(priv->base, 1, dst, src, len); __edma3_transfer(priv->base, 1, dst, src, len);
break; break;
default: default:
error("Transfer type not implemented in DMA driver\n"); pr_err("Transfer type not implemented in DMA driver\n");
break; break;
} }

View file

@ -322,7 +322,7 @@ static int i2c_gpio_ofdata_to_platdata(struct udevice *dev)
return 0; return 0;
error: error:
error("Can't get %s gpios! Error: %d", dev->name, ret); pr_err("Can't get %s gpios! Error: %d", dev->name, ret);
return ret; return ret;
} }

View file

@ -755,7 +755,7 @@ static uint omap24_i2c_setspeed(struct i2c_adapter *adap, uint speed)
ret = __omap24_i2c_setspeed(i2c_base, speed, &adap->waitdelay); ret = __omap24_i2c_setspeed(i2c_base, speed, &adap->waitdelay);
if (ret) { if (ret) {
error("%s: set i2c speed failed\n", __func__); pr_err("%s: set i2c speed failed\n", __func__);
return ret; return ret;
} }

View file

@ -549,7 +549,7 @@ static int stm32_i2c_compute_solutions(struct stm32_i2c_setup *setup,
} }
if (list_empty(solutions)) { if (list_empty(solutions)) {
error("%s: no Prescaler solution\n", __func__); pr_err("%s: no Prescaler solution\n", __func__);
ret = -EPERM; ret = -EPERM;
} }
@ -627,7 +627,7 @@ static int stm32_i2c_choose_solution(struct stm32_i2c_setup *setup,
} }
if (!s) { if (!s) {
error("%s: no solution at all\n", __func__); pr_err("%s: no solution at all\n", __func__);
ret = -EPERM; ret = -EPERM;
} }
@ -643,14 +643,14 @@ static int stm32_i2c_compute_timing(struct stm32_i2c_priv *i2c_priv,
int ret; int ret;
if (setup->speed >= STM32_I2C_SPEED_END) { if (setup->speed >= STM32_I2C_SPEED_END) {
error("%s: speed out of bound {%d/%d}\n", __func__, pr_err("%s: speed out of bound {%d/%d}\n", __func__,
setup->speed, STM32_I2C_SPEED_END - 1); setup->speed, STM32_I2C_SPEED_END - 1);
return -EINVAL; return -EINVAL;
} }
if ((setup->rise_time > i2c_specs[setup->speed].rise_max) || if ((setup->rise_time > i2c_specs[setup->speed].rise_max) ||
(setup->fall_time > i2c_specs[setup->speed].fall_max)) { (setup->fall_time > i2c_specs[setup->speed].fall_max)) {
error("%s :timings out of bound Rise{%d>%d}/Fall{%d>%d}\n", pr_err("%s :timings out of bound Rise{%d>%d}/Fall{%d>%d}\n",
__func__, __func__,
setup->rise_time, i2c_specs[setup->speed].rise_max, setup->rise_time, i2c_specs[setup->speed].rise_max,
setup->fall_time, i2c_specs[setup->speed].fall_max); setup->fall_time, i2c_specs[setup->speed].fall_max);
@ -658,13 +658,13 @@ static int stm32_i2c_compute_timing(struct stm32_i2c_priv *i2c_priv,
} }
if (setup->dnf > STM32_I2C_DNF_MAX) { if (setup->dnf > STM32_I2C_DNF_MAX) {
error("%s: DNF out of bound %d/%d\n", __func__, pr_err("%s: DNF out of bound %d/%d\n", __func__,
setup->dnf, STM32_I2C_DNF_MAX); setup->dnf, STM32_I2C_DNF_MAX);
return -EINVAL; return -EINVAL;
} }
if (setup->speed_freq > i2c_specs[setup->speed].rate) { if (setup->speed_freq > i2c_specs[setup->speed].rate) {
error("%s: Freq {%d/%d}\n", __func__, pr_err("%s: Freq {%d/%d}\n", __func__,
setup->speed_freq, i2c_specs[setup->speed].rate); setup->speed_freq, i2c_specs[setup->speed].rate);
return -EINVAL; return -EINVAL;
} }
@ -711,7 +711,7 @@ static int stm32_i2c_setup_timing(struct stm32_i2c_priv *i2c_priv,
setup->clock_src = clk_get_rate(&i2c_priv->clk); setup->clock_src = clk_get_rate(&i2c_priv->clk);
if (!setup->clock_src) { if (!setup->clock_src) {
error("%s: clock rate is 0\n", __func__); pr_err("%s: clock rate is 0\n", __func__);
return -EINVAL; return -EINVAL;
} }
@ -734,7 +734,7 @@ static int stm32_i2c_setup_timing(struct stm32_i2c_priv *i2c_priv,
} while (ret); } while (ret);
if (ret) { if (ret) {
error("%s: impossible to compute I2C timings.\n", __func__); pr_err("%s: impossible to compute I2C timings.\n", __func__);
return ret; return ret;
} }

View file

@ -372,12 +372,12 @@ static int tegra_i2c_probe(struct udevice *dev)
ret = reset_get_by_name(dev, "i2c", &i2c_bus->reset_ctl); ret = reset_get_by_name(dev, "i2c", &i2c_bus->reset_ctl);
if (ret) { if (ret) {
error("reset_get_by_name() failed: %d\n", ret); pr_err("reset_get_by_name() failed: %d\n", ret);
return ret; return ret;
} }
ret = clk_get_by_name(dev, "div-clk", &i2c_bus->clk); ret = clk_get_by_name(dev, "div-clk", &i2c_bus->clk);
if (ret) { if (ret) {
error("clk_get_by_name() failed: %d\n", ret); pr_err("clk_get_by_name() failed: %d\n", ret);
return ret; return ret;
} }

View file

@ -44,7 +44,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg,
ret = tegra_ivc_write_get_next_frame(&priv->ivc, &ivc_frame); ret = tegra_ivc_write_get_next_frame(&priv->ivc, &ivc_frame);
if (ret) { if (ret) {
error("tegra_ivc_write_get_next_frame() failed: %d\n", ret); pr_err("tegra_ivc_write_get_next_frame() failed: %d\n", ret);
return ret; return ret;
} }
@ -55,7 +55,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg,
ret = tegra_ivc_write_advance(&priv->ivc); ret = tegra_ivc_write_advance(&priv->ivc);
if (ret) { if (ret) {
error("tegra_ivc_write_advance() failed: %d\n", ret); pr_err("tegra_ivc_write_advance() failed: %d\n", ret);
return ret; return ret;
} }
@ -63,7 +63,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg,
for (;;) { for (;;) {
ret = tegra_ivc_channel_notified(&priv->ivc); ret = tegra_ivc_channel_notified(&priv->ivc);
if (ret) { if (ret) {
error("tegra_ivc_channel_notified() failed: %d\n", ret); pr_err("tegra_ivc_channel_notified() failed: %d\n", ret);
return ret; return ret;
} }
@ -73,7 +73,7 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg,
/* Timeout 20ms; roughly 10x current max observed duration */ /* Timeout 20ms; roughly 10x current max observed duration */
if ((timer_get_us() - start_time) > 20 * 1000) { if ((timer_get_us() - start_time) > 20 * 1000) {
error("tegra_ivc_read_get_next_frame() timed out (%d)\n", pr_err("tegra_ivc_read_get_next_frame() timed out (%d)\n",
ret); ret);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
@ -86,12 +86,12 @@ static int tegra186_bpmp_call(struct udevice *dev, int mrq, void *tx_msg,
ret = tegra_ivc_read_advance(&priv->ivc); ret = tegra_ivc_read_advance(&priv->ivc);
if (ret) { if (ret) {
error("tegra_ivc_write_advance() failed: %d\n", ret); pr_err("tegra_ivc_write_advance() failed: %d\n", ret);
return ret; return ret;
} }
if (err) { if (err) {
error("BPMP responded with error %d\n", err); pr_err("BPMP responded with error %d\n", err);
/* err isn't a U-Boot error code, so don't that */ /* err isn't a U-Boot error code, so don't that */
return -EIO; return -EIO;
} }
@ -144,14 +144,14 @@ static ulong tegra186_bpmp_get_shmem(struct udevice *dev, int index)
ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev_of_offset(dev), ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev_of_offset(dev),
"shmem", NULL, 0, index, &args); "shmem", NULL, 0, index, &args);
if (ret < 0) { if (ret < 0) {
error("fdtdec_parse_phandle_with_args() failed: %d\n", ret); pr_err("fdtdec_parse_phandle_with_args() failed: %d\n", ret);
return ret; return ret;
} }
reg = fdtdec_get_addr_size_auto_noparent(gd->fdt_blob, args.node, reg = fdtdec_get_addr_size_auto_noparent(gd->fdt_blob, args.node,
"reg", 0, NULL, true); "reg", 0, NULL, true);
if (reg == FDT_ADDR_T_NONE) { if (reg == FDT_ADDR_T_NONE) {
error("fdtdec_get_addr_size_auto_noparent() failed\n"); pr_err("fdtdec_get_addr_size_auto_noparent() failed\n");
return -ENODEV; return -ENODEV;
} }
@ -166,7 +166,7 @@ static void tegra186_bpmp_ivc_notify(struct tegra_ivc *ivc)
ret = mbox_send(&priv->mbox, NULL); ret = mbox_send(&priv->mbox, NULL);
if (ret) if (ret)
error("mbox_send() failed: %d\n", ret); pr_err("mbox_send() failed: %d\n", ret);
} }
static int tegra186_bpmp_probe(struct udevice *dev) static int tegra186_bpmp_probe(struct udevice *dev)
@ -179,18 +179,18 @@ static int tegra186_bpmp_probe(struct udevice *dev)
ret = mbox_get_by_index(dev, 0, &priv->mbox); ret = mbox_get_by_index(dev, 0, &priv->mbox);
if (ret) { if (ret) {
error("mbox_get_by_index() failed: %d\n", ret); pr_err("mbox_get_by_index() failed: %d\n", ret);
return ret; return ret;
} }
tx_base = tegra186_bpmp_get_shmem(dev, 0); tx_base = tegra186_bpmp_get_shmem(dev, 0);
if (IS_ERR_VALUE(tx_base)) { if (IS_ERR_VALUE(tx_base)) {
error("tegra186_bpmp_get_shmem failed for tx_base\n"); pr_err("tegra186_bpmp_get_shmem failed for tx_base\n");
return tx_base; return tx_base;
} }
rx_base = tegra186_bpmp_get_shmem(dev, 1); rx_base = tegra186_bpmp_get_shmem(dev, 1);
if (IS_ERR_VALUE(rx_base)) { if (IS_ERR_VALUE(rx_base)) {
error("tegra186_bpmp_get_shmem failed for rx_base\n"); pr_err("tegra186_bpmp_get_shmem failed for rx_base\n");
return rx_base; return rx_base;
} }
debug("shmem: rx=%lx, tx=%lx\n", rx_base, tx_base); debug("shmem: rx=%lx, tx=%lx\n", rx_base, tx_base);
@ -198,7 +198,7 @@ static int tegra186_bpmp_probe(struct udevice *dev)
ret = tegra_ivc_init(&priv->ivc, rx_base, tx_base, BPMP_IVC_FRAME_COUNT, ret = tegra_ivc_init(&priv->ivc, rx_base, tx_base, BPMP_IVC_FRAME_COUNT,
BPMP_IVC_FRAME_SIZE, tegra186_bpmp_ivc_notify); BPMP_IVC_FRAME_SIZE, tegra186_bpmp_ivc_notify);
if (ret) { if (ret) {
error("tegra_ivc_init() failed: %d\n", ret); pr_err("tegra_ivc_init() failed: %d\n", ret);
return ret; return ret;
} }
@ -211,7 +211,7 @@ static int tegra186_bpmp_probe(struct udevice *dev)
/* Timeout 100ms */ /* Timeout 100ms */
if ((timer_get_us() - start_time) > 100 * 1000) { if ((timer_get_us() - start_time) > 100 * 1000) {
error("Initial IVC reset timed out (%d)\n", ret); pr_err("Initial IVC reset timed out (%d)\n", ret);
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
goto err_free_mbox; goto err_free_mbox;
} }

View file

@ -155,7 +155,7 @@ static int exynos_dwmci_get_config(const void *blob, int node,
priv = malloc(sizeof(struct dwmci_exynos_priv_data)); priv = malloc(sizeof(struct dwmci_exynos_priv_data));
if (!priv) { if (!priv) {
error("dwmci_exynos_priv_data malloc fail!\n"); pr_err("dwmci_exynos_priv_data malloc fail!\n");
return -ENOMEM; return -ENOMEM;
} }

View file

@ -44,7 +44,7 @@ int hi6220_dwmci_add_port(int index, u32 regbase, int bus_width)
host = calloc(1, sizeof(struct dwmci_host)); host = calloc(1, sizeof(struct dwmci_host));
if (!host) { if (!host) {
error("dwmci_host calloc failed!\n"); pr_err("dwmci_host calloc failed!\n");
return -ENOMEM; return -ENOMEM;
} }

View file

@ -43,7 +43,7 @@ static int sti_mmc_core_config(struct udevice *dev)
if (plat->instance) { if (plat->instance) {
ret = reset_deassert(&plat->reset); ret = reset_deassert(&plat->reset);
if (ret < 0) { if (ret < 0) {
error("MMC1 deassert failed: %d", ret); pr_err("MMC1 deassert failed: %d", ret);
return ret; return ret;
} }
} }

View file

@ -569,7 +569,7 @@ static int stm32_sdmmc2_probe(struct udevice *dev)
case 1: case 1:
break; break;
default: default:
error("invalid \"bus-width\" property, force to 1\n"); pr_err("invalid \"bus-width\" property, force to 1\n");
} }
upriv->mmc = &plat->mmc; upriv->mmc = &plat->mmc;

View file

@ -159,7 +159,7 @@ static int xenon_mmc_phy_init(struct sdhci_host *host)
} }
if (time <= 0) { if (time <= 0) {
error("Failed to enable MMC internal clock in time\n"); pr_err("Failed to enable MMC internal clock in time\n");
return -ETIMEDOUT; return -ETIMEDOUT;
} }
@ -187,7 +187,7 @@ static int xenon_mmc_phy_init(struct sdhci_host *host)
} }
if (time <= 0) { if (time <= 0) {
error("Failed to init MMC PHY in time\n"); pr_err("Failed to init MMC PHY in time\n");
return -ETIMEDOUT; return -ETIMEDOUT;
} }

View file

@ -583,21 +583,21 @@ void board_nand_init(void)
/* identify chip */ /* identify chip */
ret = nand_scan_ident(mtd, CONFIG_SYS_MAX_NAND_CHIPS, NULL); ret = nand_scan_ident(mtd, CONFIG_SYS_MAX_NAND_CHIPS, NULL);
if (ret) { if (ret) {
error("nand_scan_ident returned %i", ret); pr_err("nand_scan_ident returned %i", ret);
return; return;
} }
/* finish scanning the chip */ /* finish scanning the chip */
ret = nand_scan_tail(mtd); ret = nand_scan_tail(mtd);
if (ret) { if (ret) {
error("nand_scan_tail returned %i", ret); pr_err("nand_scan_tail returned %i", ret);
return; return;
} }
/* chip is good, register it */ /* chip is good, register it */
ret = nand_register(0, mtd); ret = nand_register(0, mtd);
if (ret) if (ret)
error("nand_register returned %i", ret); pr_err("nand_register returned %i", ret);
} }
#else /* defined(CONFIG_SPL_BUILD) */ #else /* defined(CONFIG_SPL_BUILD) */

View file

@ -1559,7 +1559,7 @@ static int pxa3xx_nand_probe_dt(struct pxa3xx_nand_info *info)
pdata->num_cs = fdtdec_get_int(blob, node, "num-cs", 1); pdata->num_cs = fdtdec_get_int(blob, node, "num-cs", 1);
if (pdata->num_cs != 1) { if (pdata->num_cs != 1) {
error("pxa3xx driver supports single CS only\n"); pr_err("pxa3xx driver supports single CS only\n");
break; break;
} }

View file

@ -610,7 +610,7 @@ int gmac_miiphy_read(struct mii_dev *bus, int phyaddr, int devad, int reg)
/* Busy wait timeout is 1ms */ /* Busy wait timeout is 1ms */
if (gmac_mii_busywait(1000)) { if (gmac_mii_busywait(1000)) {
error("%s: Prepare MII read: MII/MDIO busy\n", __func__); pr_err("%s: Prepare MII read: MII/MDIO busy\n", __func__);
return -1; return -1;
} }
@ -622,7 +622,7 @@ int gmac_miiphy_read(struct mii_dev *bus, int phyaddr, int devad, int reg)
writel(tmp, GMAC_MII_DATA_ADDR); writel(tmp, GMAC_MII_DATA_ADDR);
if (gmac_mii_busywait(1000)) { if (gmac_mii_busywait(1000)) {
error("%s: MII read failure: MII/MDIO busy\n", __func__); pr_err("%s: MII read failure: MII/MDIO busy\n", __func__);
return -1; return -1;
} }
@ -638,7 +638,7 @@ int gmac_miiphy_write(struct mii_dev *bus, int phyaddr, int devad, int reg,
/* Busy wait timeout is 1ms */ /* Busy wait timeout is 1ms */
if (gmac_mii_busywait(1000)) { if (gmac_mii_busywait(1000)) {
error("%s: Prepare MII write: MII/MDIO busy\n", __func__); pr_err("%s: Prepare MII write: MII/MDIO busy\n", __func__);
return -1; return -1;
} }
@ -651,7 +651,7 @@ int gmac_miiphy_write(struct mii_dev *bus, int phyaddr, int devad, int reg,
writel(tmp, GMAC_MII_DATA_ADDR); writel(tmp, GMAC_MII_DATA_ADDR);
if (gmac_mii_busywait(1000)) { if (gmac_mii_busywait(1000)) {
error("%s: MII write failure: MII/MDIO busy\n", __func__); pr_err("%s: MII write failure: MII/MDIO busy\n", __func__);
return -1; return -1;
} }
@ -742,7 +742,7 @@ int gmac_set_speed(int speed, int duplex)
} else if (speed == 10) { } else if (speed == 10) {
speed_cfg = 0; speed_cfg = 0;
} else { } else {
error("%s: Invalid GMAC speed(%d)!\n", __func__, speed); pr_err("%s: Invalid GMAC speed(%d)!\n", __func__, speed);
return -1; return -1;
} }
@ -820,7 +820,7 @@ int gmac_mac_init(struct eth_device *dev)
writel(0, GMAC0_INT_STATUS_ADDR); writel(0, GMAC0_INT_STATUS_ADDR);
if (dma_init(dma) < 0) { if (dma_init(dma) < 0) {
error("%s: GMAC dma_init failed\n", __func__); pr_err("%s: GMAC dma_init failed\n", __func__);
goto err_exit; goto err_exit;
} }
@ -855,7 +855,7 @@ int gmac_mac_init(struct eth_device *dev)
writel(tmp, GMAC_MII_CTRL_ADDR); writel(tmp, GMAC_MII_CTRL_ADDR);
if (gmac_mii_busywait(1000)) { if (gmac_mii_busywait(1000)) {
error("%s: Configure MDIO: MII/MDIO busy\n", __func__); pr_err("%s: Configure MDIO: MII/MDIO busy\n", __func__);
goto err_exit; goto err_exit;
} }

View file

@ -40,7 +40,7 @@ static int bcm_sf2_eth_init(struct eth_device *dev)
rc = eth->mac_init(dev); rc = eth->mac_init(dev);
if (rc) { if (rc) {
error("%s: Couldn't cofigure MAC!\n", __func__); pr_err("%s: Couldn't cofigure MAC!\n", __func__);
return rc; return rc;
} }
@ -90,7 +90,7 @@ static int bcm_sf2_eth_send(struct eth_device *dev, void *packet, int length)
debug("."); debug(".");
i++; i++;
if (i > 20) { if (i > 20) {
error("%s: Tx timeout: retried 20 times\n", __func__); pr_err("%s: Tx timeout: retried 20 times\n", __func__);
rc = -1; rc = -1;
break; break;
} }
@ -117,7 +117,7 @@ static int bcm_sf2_eth_receive(struct eth_device *dev)
debug("\nNO More Rx\n"); debug("\nNO More Rx\n");
break; break;
} else if ((rcvlen == 0) || (rcvlen > RX_BUF_SIZE)) { } else if ((rcvlen == 0) || (rcvlen > RX_BUF_SIZE)) {
error("%s: Wrong Ethernet packet size (%d B), skip!\n", pr_err("%s: Wrong Ethernet packet size (%d B), skip!\n",
__func__, rcvlen); __func__, rcvlen);
break; break;
} else { } else {
@ -166,9 +166,9 @@ static int bcm_sf2_eth_open(struct eth_device *dev, bd_t *bt)
*/ */
for (i = 0; i < eth->port_num; i++) { for (i = 0; i < eth->port_num; i++) {
if (phy_startup(eth->port[i])) { if (phy_startup(eth->port[i])) {
error("%s: PHY %d startup failed!\n", __func__, i); pr_err("%s: PHY %d startup failed!\n", __func__, i);
if (i == CONFIG_BCM_SF2_ETH_DEFAULT_PORT) { if (i == CONFIG_BCM_SF2_ETH_DEFAULT_PORT) {
error("%s: No default port %d!\n", __func__, i); pr_err("%s: No default port %d!\n", __func__, i);
return -1; return -1;
} }
} }
@ -205,13 +205,13 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num)
dev = (struct eth_device *)malloc(sizeof(struct eth_device)); dev = (struct eth_device *)malloc(sizeof(struct eth_device));
if (dev == NULL) { if (dev == NULL) {
error("%s: Not enough memory!\n", __func__); pr_err("%s: Not enough memory!\n", __func__);
return -1; return -1;
} }
eth = (struct eth_info *)malloc(sizeof(struct eth_info)); eth = (struct eth_info *)malloc(sizeof(struct eth_info));
if (eth == NULL) { if (eth == NULL) {
error("%s: Not enough memory!\n", __func__); pr_err("%s: Not enough memory!\n", __func__);
return -1; return -1;
} }
@ -234,7 +234,7 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num)
if (gmac_add(dev)) { if (gmac_add(dev)) {
free(eth); free(eth);
free(dev); free(dev);
error("%s: Adding GMAC failed!\n", __func__); pr_err("%s: Adding GMAC failed!\n", __func__);
return -1; return -1;
} }
#else #else
@ -263,7 +263,7 @@ int bcm_sf2_eth_register(bd_t *bis, u8 dev_num)
rc = bcm_sf2_eth_init(dev); rc = bcm_sf2_eth_init(dev);
if (rc != 0) { if (rc != 0) {
error("%s: configuration failed!\n", __func__); pr_err("%s: configuration failed!\n", __func__);
return -1; return -1;
} }

View file

@ -29,14 +29,14 @@ static int davinci_emac_3517_get_macid(struct udevice *dev, u16 offset,
syscon = fdtdec_lookup_phandle(fdt, node, "syscon"); syscon = fdtdec_lookup_phandle(fdt, node, "syscon");
if (syscon < 0) { if (syscon < 0) {
error("Syscon offset not found\n"); pr_err("Syscon offset not found\n");
return -ENOENT; return -ENOENT;
} }
addr = (u32)map_physmem(fdt_translate_address(fdt, syscon, &gmii), addr = (u32)map_physmem(fdt_translate_address(fdt, syscon, &gmii),
sizeof(u32), MAP_NOCACHE); sizeof(u32), MAP_NOCACHE);
if (addr == FDT_ADDR_T_NONE) { if (addr == FDT_ADDR_T_NONE) {
error("Not able to get syscon address to get mac efuse address\n"); pr_err("Not able to get syscon address to get mac efuse address\n");
return -ENOENT; return -ENOENT;
} }
@ -69,14 +69,14 @@ static int cpsw_am33xx_cm_get_macid(struct udevice *dev, u16 offset, int slave,
syscon = fdtdec_lookup_phandle(fdt, node, "syscon"); syscon = fdtdec_lookup_phandle(fdt, node, "syscon");
if (syscon < 0) { if (syscon < 0) {
error("Syscon offset not found\n"); pr_err("Syscon offset not found\n");
return -ENOENT; return -ENOENT;
} }
addr = (u32)map_physmem(fdt_translate_address(fdt, syscon, &gmii), addr = (u32)map_physmem(fdt_translate_address(fdt, syscon, &gmii),
sizeof(u32), MAP_NOCACHE); sizeof(u32), MAP_NOCACHE);
if (addr == FDT_ADDR_T_NONE) { if (addr == FDT_ADDR_T_NONE) {
error("Not able to get syscon address to get mac efuse address\n"); pr_err("Not able to get syscon address to get mac efuse address\n");
return -ENOENT; return -ENOENT;
} }

View file

@ -1368,7 +1368,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
mdio_base = cpsw_get_addr_by_node(fdt, subnode); mdio_base = cpsw_get_addr_by_node(fdt, subnode);
if (mdio_base == FDT_ADDR_T_NONE) { if (mdio_base == FDT_ADDR_T_NONE) {
error("Not able to get MDIO address space\n"); pr_err("Not able to get MDIO address space\n");
return -ENOENT; return -ENOENT;
} }
priv->data.mdio_base = mdio_base; priv->data.mdio_base = mdio_base;
@ -1407,7 +1407,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
subnode); subnode);
if (priv->data.gmii_sel == FDT_ADDR_T_NONE) { if (priv->data.gmii_sel == FDT_ADDR_T_NONE) {
error("Not able to get gmii_sel reg address\n"); pr_err("Not able to get gmii_sel reg address\n");
return -ENOENT; return -ENOENT;
} }
@ -1418,7 +1418,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
phy_sel_compat = fdt_getprop(fdt, subnode, "compatible", phy_sel_compat = fdt_getprop(fdt, subnode, "compatible",
NULL); NULL);
if (!phy_sel_compat) { if (!phy_sel_compat) {
error("Not able to get gmii_sel compatible\n"); pr_err("Not able to get gmii_sel compatible\n");
return -ENOENT; return -ENOENT;
} }
} }
@ -1434,7 +1434,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
ret = ti_cm_get_macid(dev, active_slave, pdata->enetaddr); ret = ti_cm_get_macid(dev, active_slave, pdata->enetaddr);
if (ret < 0) { if (ret < 0) {
error("cpsw read efuse mac failed\n"); pr_err("cpsw read efuse mac failed\n");
return ret; return ret;
} }

View file

@ -377,7 +377,7 @@ static int eqos_mdio_read(struct mii_dev *bus, int mdio_addr, int mdio_devad,
ret = eqos_mdio_wait_idle(eqos); ret = eqos_mdio_wait_idle(eqos);
if (ret) { if (ret) {
error("MDIO not idle at entry"); pr_err("MDIO not idle at entry");
return ret; return ret;
} }
@ -397,7 +397,7 @@ static int eqos_mdio_read(struct mii_dev *bus, int mdio_addr, int mdio_devad,
ret = eqos_mdio_wait_idle(eqos); ret = eqos_mdio_wait_idle(eqos);
if (ret) { if (ret) {
error("MDIO read didn't complete"); pr_err("MDIO read didn't complete");
return ret; return ret;
} }
@ -421,7 +421,7 @@ static int eqos_mdio_write(struct mii_dev *bus, int mdio_addr, int mdio_devad,
ret = eqos_mdio_wait_idle(eqos); ret = eqos_mdio_wait_idle(eqos);
if (ret) { if (ret) {
error("MDIO not idle at entry"); pr_err("MDIO not idle at entry");
return ret; return ret;
} }
@ -443,7 +443,7 @@ static int eqos_mdio_write(struct mii_dev *bus, int mdio_addr, int mdio_devad,
ret = eqos_mdio_wait_idle(eqos); ret = eqos_mdio_wait_idle(eqos);
if (ret) { if (ret) {
error("MDIO read didn't complete"); pr_err("MDIO read didn't complete");
return ret; return ret;
} }
@ -459,37 +459,37 @@ static int eqos_start_clks_tegra186(struct udevice *dev)
ret = clk_enable(&eqos->clk_slave_bus); ret = clk_enable(&eqos->clk_slave_bus);
if (ret < 0) { if (ret < 0) {
error("clk_enable(clk_slave_bus) failed: %d", ret); pr_err("clk_enable(clk_slave_bus) failed: %d", ret);
goto err; goto err;
} }
ret = clk_enable(&eqos->clk_master_bus); ret = clk_enable(&eqos->clk_master_bus);
if (ret < 0) { if (ret < 0) {
error("clk_enable(clk_master_bus) failed: %d", ret); pr_err("clk_enable(clk_master_bus) failed: %d", ret);
goto err_disable_clk_slave_bus; goto err_disable_clk_slave_bus;
} }
ret = clk_enable(&eqos->clk_rx); ret = clk_enable(&eqos->clk_rx);
if (ret < 0) { if (ret < 0) {
error("clk_enable(clk_rx) failed: %d", ret); pr_err("clk_enable(clk_rx) failed: %d", ret);
goto err_disable_clk_master_bus; goto err_disable_clk_master_bus;
} }
ret = clk_enable(&eqos->clk_ptp_ref); ret = clk_enable(&eqos->clk_ptp_ref);
if (ret < 0) { if (ret < 0) {
error("clk_enable(clk_ptp_ref) failed: %d", ret); pr_err("clk_enable(clk_ptp_ref) failed: %d", ret);
goto err_disable_clk_rx; goto err_disable_clk_rx;
} }
ret = clk_set_rate(&eqos->clk_ptp_ref, 125 * 1000 * 1000); ret = clk_set_rate(&eqos->clk_ptp_ref, 125 * 1000 * 1000);
if (ret < 0) { if (ret < 0) {
error("clk_set_rate(clk_ptp_ref) failed: %d", ret); pr_err("clk_set_rate(clk_ptp_ref) failed: %d", ret);
goto err_disable_clk_ptp_ref; goto err_disable_clk_ptp_ref;
} }
ret = clk_enable(&eqos->clk_tx); ret = clk_enable(&eqos->clk_tx);
if (ret < 0) { if (ret < 0) {
error("clk_enable(clk_tx) failed: %d", ret); pr_err("clk_enable(clk_tx) failed: %d", ret);
goto err_disable_clk_ptp_ref; goto err_disable_clk_ptp_ref;
} }
@ -533,7 +533,7 @@ static int eqos_start_resets_tegra186(struct udevice *dev)
ret = dm_gpio_set_value(&eqos->phy_reset_gpio, 1); ret = dm_gpio_set_value(&eqos->phy_reset_gpio, 1);
if (ret < 0) { if (ret < 0) {
error("dm_gpio_set_value(phy_reset, assert) failed: %d", ret); pr_err("dm_gpio_set_value(phy_reset, assert) failed: %d", ret);
return ret; return ret;
} }
@ -541,13 +541,13 @@ static int eqos_start_resets_tegra186(struct udevice *dev)
ret = dm_gpio_set_value(&eqos->phy_reset_gpio, 0); ret = dm_gpio_set_value(&eqos->phy_reset_gpio, 0);
if (ret < 0) { if (ret < 0) {
error("dm_gpio_set_value(phy_reset, deassert) failed: %d", ret); pr_err("dm_gpio_set_value(phy_reset, deassert) failed: %d", ret);
return ret; return ret;
} }
ret = reset_assert(&eqos->reset_ctl); ret = reset_assert(&eqos->reset_ctl);
if (ret < 0) { if (ret < 0) {
error("reset_assert() failed: %d", ret); pr_err("reset_assert() failed: %d", ret);
return ret; return ret;
} }
@ -555,7 +555,7 @@ static int eqos_start_resets_tegra186(struct udevice *dev)
ret = reset_deassert(&eqos->reset_ctl); ret = reset_deassert(&eqos->reset_ctl);
if (ret < 0) { if (ret < 0) {
error("reset_deassert() failed: %d", ret); pr_err("reset_deassert() failed: %d", ret);
return ret; return ret;
} }
@ -591,14 +591,14 @@ static int eqos_calibrate_pads_tegra186(struct udevice *dev)
ret = wait_for_bit(__func__, &eqos->tegra186_regs->auto_cal_status, ret = wait_for_bit(__func__, &eqos->tegra186_regs->auto_cal_status,
EQOS_AUTO_CAL_STATUS_ACTIVE, true, 10, false); EQOS_AUTO_CAL_STATUS_ACTIVE, true, 10, false);
if (ret) { if (ret) {
error("calibrate didn't start"); pr_err("calibrate didn't start");
goto failed; goto failed;
} }
ret = wait_for_bit(__func__, &eqos->tegra186_regs->auto_cal_status, ret = wait_for_bit(__func__, &eqos->tegra186_regs->auto_cal_status,
EQOS_AUTO_CAL_STATUS_ACTIVE, false, 10, false); EQOS_AUTO_CAL_STATUS_ACTIVE, false, 10, false);
if (ret) { if (ret) {
error("calibrate didn't finish"); pr_err("calibrate didn't finish");
goto failed; goto failed;
} }
@ -713,13 +713,13 @@ static int eqos_set_tx_clk_speed_tegra186(struct udevice *dev)
rate = 2.5 * 1000 * 1000; rate = 2.5 * 1000 * 1000;
break; break;
default: default:
error("invalid speed %d", eqos->phy->speed); pr_err("invalid speed %d", eqos->phy->speed);
return -EINVAL; return -EINVAL;
} }
ret = clk_set_rate(&eqos->clk_tx, rate); ret = clk_set_rate(&eqos->clk_tx, rate);
if (ret < 0) { if (ret < 0) {
error("clk_set_rate(tx_clk, %lu) failed: %d", rate, ret); pr_err("clk_set_rate(tx_clk, %lu) failed: %d", rate, ret);
return ret; return ret;
} }
@ -739,7 +739,7 @@ static int eqos_adjust_link(struct udevice *dev)
else else
ret = eqos_set_half_duplex(dev); ret = eqos_set_half_duplex(dev);
if (ret < 0) { if (ret < 0) {
error("eqos_set_*_duplex() failed: %d", ret); pr_err("eqos_set_*_duplex() failed: %d", ret);
return ret; return ret;
} }
@ -757,24 +757,24 @@ static int eqos_adjust_link(struct udevice *dev)
ret = eqos_set_mii_speed_10(dev); ret = eqos_set_mii_speed_10(dev);
break; break;
default: default:
error("invalid speed %d", eqos->phy->speed); pr_err("invalid speed %d", eqos->phy->speed);
return -EINVAL; return -EINVAL;
} }
if (ret < 0) { if (ret < 0) {
error("eqos_set_*mii_speed*() failed: %d", ret); pr_err("eqos_set_*mii_speed*() failed: %d", ret);
return ret; return ret;
} }
if (en_calibration) { if (en_calibration) {
ret = eqos_calibrate_pads_tegra186(dev); ret = eqos_calibrate_pads_tegra186(dev);
if (ret < 0) { if (ret < 0) {
error("eqos_calibrate_pads_tegra186() failed: %d", ret); pr_err("eqos_calibrate_pads_tegra186() failed: %d", ret);
return ret; return ret;
} }
} else { } else {
ret = eqos_disable_calibration_tegra186(dev); ret = eqos_disable_calibration_tegra186(dev);
if (ret < 0) { if (ret < 0) {
error("eqos_disable_calibration_tegra186() failed: %d", pr_err("eqos_disable_calibration_tegra186() failed: %d",
ret); ret);
return ret; return ret;
} }
@ -782,7 +782,7 @@ static int eqos_adjust_link(struct udevice *dev)
ret = eqos_set_tx_clk_speed_tegra186(dev); ret = eqos_set_tx_clk_speed_tegra186(dev);
if (ret < 0) { if (ret < 0) {
error("eqos_set_tx_clk_speed_tegra186() failed: %d", ret); pr_err("eqos_set_tx_clk_speed_tegra186() failed: %d", ret);
return ret; return ret;
} }
@ -848,13 +848,13 @@ static int eqos_start(struct udevice *dev)
ret = eqos_start_clks_tegra186(dev); ret = eqos_start_clks_tegra186(dev);
if (ret < 0) { if (ret < 0) {
error("eqos_start_clks_tegra186() failed: %d", ret); pr_err("eqos_start_clks_tegra186() failed: %d", ret);
goto err; goto err;
} }
ret = eqos_start_resets_tegra186(dev); ret = eqos_start_resets_tegra186(dev);
if (ret < 0) { if (ret < 0) {
error("eqos_start_resets_tegra186() failed: %d", ret); pr_err("eqos_start_resets_tegra186() failed: %d", ret);
goto err_stop_clks; goto err_stop_clks;
} }
@ -865,13 +865,13 @@ static int eqos_start(struct udevice *dev)
ret = wait_for_bit(__func__, &eqos->dma_regs->mode, ret = wait_for_bit(__func__, &eqos->dma_regs->mode,
EQOS_DMA_MODE_SWR, false, 10, false); EQOS_DMA_MODE_SWR, false, 10, false);
if (ret) { if (ret) {
error("EQOS_DMA_MODE_SWR stuck"); pr_err("EQOS_DMA_MODE_SWR stuck");
goto err_stop_resets; goto err_stop_resets;
} }
ret = eqos_calibrate_pads_tegra186(dev); ret = eqos_calibrate_pads_tegra186(dev);
if (ret < 0) { if (ret < 0) {
error("eqos_calibrate_pads_tegra186() failed: %d", ret); pr_err("eqos_calibrate_pads_tegra186() failed: %d", ret);
goto err_stop_resets; goto err_stop_resets;
} }
@ -881,28 +881,28 @@ static int eqos_start(struct udevice *dev)
eqos->phy = phy_connect(eqos->mii, 0, dev, 0); eqos->phy = phy_connect(eqos->mii, 0, dev, 0);
if (!eqos->phy) { if (!eqos->phy) {
error("phy_connect() failed"); pr_err("phy_connect() failed");
goto err_stop_resets; goto err_stop_resets;
} }
ret = phy_config(eqos->phy); ret = phy_config(eqos->phy);
if (ret < 0) { if (ret < 0) {
error("phy_config() failed: %d", ret); pr_err("phy_config() failed: %d", ret);
goto err_shutdown_phy; goto err_shutdown_phy;
} }
ret = phy_startup(eqos->phy); ret = phy_startup(eqos->phy);
if (ret < 0) { if (ret < 0) {
error("phy_startup() failed: %d", ret); pr_err("phy_startup() failed: %d", ret);
goto err_shutdown_phy; goto err_shutdown_phy;
} }
if (!eqos->phy->link) { if (!eqos->phy->link) {
error("No link"); pr_err("No link");
goto err_shutdown_phy; goto err_shutdown_phy;
} }
ret = eqos_adjust_link(dev); ret = eqos_adjust_link(dev);
if (ret < 0) { if (ret < 0) {
error("eqos_adjust_link() failed: %d", ret); pr_err("eqos_adjust_link() failed: %d", ret);
goto err_shutdown_phy; goto err_shutdown_phy;
} }
@ -1119,7 +1119,7 @@ err_stop_resets:
err_stop_clks: err_stop_clks:
eqos_stop_clks_tegra186(dev); eqos_stop_clks_tegra186(dev);
err: err:
error("FAILED: %d", ret); pr_err("FAILED: %d", ret);
return ret; return ret;
} }
@ -1361,7 +1361,7 @@ static int eqos_probe_resources_tegra186(struct udevice *dev)
ret = reset_get_by_name(dev, "eqos", &eqos->reset_ctl); ret = reset_get_by_name(dev, "eqos", &eqos->reset_ctl);
if (ret) { if (ret) {
error("reset_get_by_name(rst) failed: %d", ret); pr_err("reset_get_by_name(rst) failed: %d", ret);
return ret; return ret;
} }
@ -1369,38 +1369,38 @@ static int eqos_probe_resources_tegra186(struct udevice *dev)
&eqos->phy_reset_gpio, &eqos->phy_reset_gpio,
GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE); GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
if (ret) { if (ret) {
error("gpio_request_by_name(phy reset) failed: %d", ret); pr_err("gpio_request_by_name(phy reset) failed: %d", ret);
goto err_free_reset_eqos; goto err_free_reset_eqos;
} }
ret = clk_get_by_name(dev, "slave_bus", &eqos->clk_slave_bus); ret = clk_get_by_name(dev, "slave_bus", &eqos->clk_slave_bus);
if (ret) { if (ret) {
error("clk_get_by_name(slave_bus) failed: %d", ret); pr_err("clk_get_by_name(slave_bus) failed: %d", ret);
goto err_free_gpio_phy_reset; goto err_free_gpio_phy_reset;
} }
ret = clk_get_by_name(dev, "master_bus", &eqos->clk_master_bus); ret = clk_get_by_name(dev, "master_bus", &eqos->clk_master_bus);
if (ret) { if (ret) {
error("clk_get_by_name(master_bus) failed: %d", ret); pr_err("clk_get_by_name(master_bus) failed: %d", ret);
goto err_free_clk_slave_bus; goto err_free_clk_slave_bus;
} }
ret = clk_get_by_name(dev, "rx", &eqos->clk_rx); ret = clk_get_by_name(dev, "rx", &eqos->clk_rx);
if (ret) { if (ret) {
error("clk_get_by_name(rx) failed: %d", ret); pr_err("clk_get_by_name(rx) failed: %d", ret);
goto err_free_clk_master_bus; goto err_free_clk_master_bus;
} }
ret = clk_get_by_name(dev, "ptp_ref", &eqos->clk_ptp_ref); ret = clk_get_by_name(dev, "ptp_ref", &eqos->clk_ptp_ref);
if (ret) { if (ret) {
error("clk_get_by_name(ptp_ref) failed: %d", ret); pr_err("clk_get_by_name(ptp_ref) failed: %d", ret);
goto err_free_clk_rx; goto err_free_clk_rx;
return ret; return ret;
} }
ret = clk_get_by_name(dev, "tx", &eqos->clk_tx); ret = clk_get_by_name(dev, "tx", &eqos->clk_tx);
if (ret) { if (ret) {
error("clk_get_by_name(tx) failed: %d", ret); pr_err("clk_get_by_name(tx) failed: %d", ret);
goto err_free_clk_ptp_ref; goto err_free_clk_ptp_ref;
} }
@ -1454,7 +1454,7 @@ static int eqos_probe(struct udevice *dev)
eqos->regs = devfdt_get_addr(dev); eqos->regs = devfdt_get_addr(dev);
if (eqos->regs == FDT_ADDR_T_NONE) { if (eqos->regs == FDT_ADDR_T_NONE) {
error("devfdt_get_addr() failed"); pr_err("devfdt_get_addr() failed");
return -ENODEV; return -ENODEV;
} }
eqos->mac_regs = (void *)(eqos->regs + EQOS_MAC_REGS_BASE); eqos->mac_regs = (void *)(eqos->regs + EQOS_MAC_REGS_BASE);
@ -1464,19 +1464,19 @@ static int eqos_probe(struct udevice *dev)
ret = eqos_probe_resources_core(dev); ret = eqos_probe_resources_core(dev);
if (ret < 0) { if (ret < 0) {
error("eqos_probe_resources_core() failed: %d", ret); pr_err("eqos_probe_resources_core() failed: %d", ret);
return ret; return ret;
} }
ret = eqos_probe_resources_tegra186(dev); ret = eqos_probe_resources_tegra186(dev);
if (ret < 0) { if (ret < 0) {
error("eqos_probe_resources_tegra186() failed: %d", ret); pr_err("eqos_probe_resources_tegra186() failed: %d", ret);
goto err_remove_resources_core; goto err_remove_resources_core;
} }
eqos->mii = mdio_alloc(); eqos->mii = mdio_alloc();
if (!eqos->mii) { if (!eqos->mii) {
error("mdio_alloc() failed"); pr_err("mdio_alloc() failed");
goto err_remove_resources_tegra; goto err_remove_resources_tegra;
} }
eqos->mii->read = eqos_mdio_read; eqos->mii->read = eqos_mdio_read;
@ -1486,7 +1486,7 @@ static int eqos_probe(struct udevice *dev)
ret = mdio_register(eqos->mii); ret = mdio_register(eqos->mii);
if (ret < 0) { if (ret < 0) {
error("mdio_register() failed: %d", ret); pr_err("mdio_register() failed: %d", ret);
goto err_free_mdio; goto err_free_mdio;
} }

View file

@ -324,7 +324,7 @@ static int ep93xx_eth_rcv_packet(struct eth_device *dev)
debug("reporting %d bytes...\n", len); debug("reporting %d bytes...\n", len);
} else { } else {
/* Do we have an erroneous packet? */ /* Do we have an erroneous packet? */
error("packet rx error, status %08X %08X", pr_err("packet rx error, status %08X %08X",
priv->rx_sq.current->word1, priv->rx_sq.current->word1,
priv->rx_sq.current->word2); priv->rx_sq.current->word2);
dump_rx_descriptor_queue(dev); dump_rx_descriptor_queue(dev);
@ -401,7 +401,7 @@ static int ep93xx_eth_send_packet(struct eth_device *dev,
; /* noop */ ; /* noop */
if (!TX_STATUS_TXWE(priv->tx_sq.current)) { if (!TX_STATUS_TXWE(priv->tx_sq.current)) {
error("packet tx error, status %08X", pr_err("packet tx error, status %08X",
priv->tx_sq.current->word1); priv->tx_sq.current->word1);
dump_tx_descriptor_queue(dev); dump_tx_descriptor_queue(dev);
dump_tx_status_queue(dev); dump_tx_status_queue(dev);
@ -452,7 +452,7 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr)
priv = malloc(sizeof(*priv)); priv = malloc(sizeof(*priv));
if (!priv) { if (!priv) {
error("malloc() failed"); pr_err("malloc() failed");
goto eth_init_failed_0; goto eth_init_failed_0;
} }
memset(priv, 0, sizeof(*priv)); memset(priv, 0, sizeof(*priv));
@ -462,34 +462,34 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr)
priv->tx_dq.base = calloc(NUMTXDESC, priv->tx_dq.base = calloc(NUMTXDESC,
sizeof(struct tx_descriptor)); sizeof(struct tx_descriptor));
if (priv->tx_dq.base == NULL) { if (priv->tx_dq.base == NULL) {
error("calloc() failed"); pr_err("calloc() failed");
goto eth_init_failed_1; goto eth_init_failed_1;
} }
priv->tx_sq.base = calloc(NUMTXDESC, priv->tx_sq.base = calloc(NUMTXDESC,
sizeof(struct tx_status)); sizeof(struct tx_status));
if (priv->tx_sq.base == NULL) { if (priv->tx_sq.base == NULL) {
error("calloc() failed"); pr_err("calloc() failed");
goto eth_init_failed_2; goto eth_init_failed_2;
} }
priv->rx_dq.base = calloc(NUMRXDESC, priv->rx_dq.base = calloc(NUMRXDESC,
sizeof(struct rx_descriptor)); sizeof(struct rx_descriptor));
if (priv->rx_dq.base == NULL) { if (priv->rx_dq.base == NULL) {
error("calloc() failed"); pr_err("calloc() failed");
goto eth_init_failed_3; goto eth_init_failed_3;
} }
priv->rx_sq.base = calloc(NUMRXDESC, priv->rx_sq.base = calloc(NUMRXDESC,
sizeof(struct rx_status)); sizeof(struct rx_status));
if (priv->rx_sq.base == NULL) { if (priv->rx_sq.base == NULL) {
error("calloc() failed"); pr_err("calloc() failed");
goto eth_init_failed_4; goto eth_init_failed_4;
} }
dev = malloc(sizeof *dev); dev = malloc(sizeof *dev);
if (dev == NULL) { if (dev == NULL) {
error("malloc() failed"); pr_err("malloc() failed");
goto eth_init_failed_5; goto eth_init_failed_5;
} }
memset(dev, 0, sizeof *dev); memset(dev, 0, sizeof *dev);

View file

@ -757,7 +757,7 @@ static int ks2_eth_start(struct udevice *dev)
qm_init(); qm_init();
if (ksnav_init(priv->netcp_pktdma, &priv->net_rx_buffs)) { if (ksnav_init(priv->netcp_pktdma, &priv->net_rx_buffs)) {
error("ksnav_init failed\n"); pr_err("ksnav_init failed\n");
goto err_knav_init; goto err_knav_init;
} }
@ -773,7 +773,7 @@ static int ks2_eth_start(struct udevice *dev)
phy_startup(priv->phydev); phy_startup(priv->phydev);
if (priv->phydev->link == 0) { if (priv->phydev->link == 0) {
error("phy startup failed\n"); pr_err("phy startup failed\n");
goto err_phy_start; goto err_phy_start;
} }
} }
@ -923,7 +923,7 @@ static int ks2_eth_probe(struct udevice *dev)
*/ */
mdio_bus = mdio_alloc(); mdio_bus = mdio_alloc();
if (!mdio_bus) { if (!mdio_bus) {
error("MDIO alloc failed\n"); pr_err("MDIO alloc failed\n");
return -ENOMEM; return -ENOMEM;
} }
priv->mdio_bus = mdio_bus; priv->mdio_bus = mdio_bus;
@ -935,7 +935,7 @@ static int ks2_eth_probe(struct udevice *dev)
ret = mdio_register(mdio_bus); ret = mdio_register(mdio_bus);
if (ret) { if (ret) {
error("MDIO bus register failed\n"); pr_err("MDIO bus register failed\n");
return ret; return ret;
} }
} else { } else {
@ -1011,7 +1011,7 @@ static int ks2_eth_bind_slaves(struct udevice *dev, int gbe, int *gbe_0)
slave_name, offset_to_ofnode(slave), slave_name, offset_to_ofnode(slave),
&sl_dev); &sl_dev);
if (ret) { if (ret) {
error("ks2_net - not able to bind slave interfaces\n"); pr_err("ks2_net - not able to bind slave interfaces\n");
return ret; return ret;
} }
} }
@ -1031,7 +1031,7 @@ static int ks2_eth_bind_slaves(struct udevice *dev, int gbe, int *gbe_0)
ret = device_bind_driver_to_node(dev, "eth_ks2_sl", slave_name, ret = device_bind_driver_to_node(dev, "eth_ks2_sl", slave_name,
offset_to_ofnode(slave), &sl_dev); offset_to_ofnode(slave), &sl_dev);
if (ret) { if (ret) {
error("ks2_net - not able to bind slave interfaces\n"); pr_err("ks2_net - not able to bind slave interfaces\n");
return ret; return ret;
} }
} }
@ -1074,7 +1074,7 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave,
mdio = fdt_parent_offset(fdt, phy); mdio = fdt_parent_offset(fdt, phy);
if (mdio < 0) { if (mdio < 0) {
error("mdio dt not found\n"); pr_err("mdio dt not found\n");
return -ENODEV; return -ENODEV;
} }
priv->mdio_base = (void *)fdtdec_get_addr(fdt, mdio, "reg"); priv->mdio_base = (void *)fdtdec_get_addr(fdt, mdio, "reg");

View file

@ -369,7 +369,7 @@ static int tegra_pcie_port_parse_dt(ofnode node, struct tegra_pcie_port *port)
addr = ofnode_get_property(node, "assigned-addresses", &len); addr = ofnode_get_property(node, "assigned-addresses", &len);
if (!addr) { if (!addr) {
error("property \"assigned-addresses\" not found"); pr_err("property \"assigned-addresses\" not found");
return -FDT_ERR_NOTFOUND; return -FDT_ERR_NOTFOUND;
} }
@ -460,7 +460,7 @@ static int tegra_pcie_parse_port_info(ofnode node, uint *index, uint *lanes)
err = ofnode_read_u32_default(node, "nvidia,num-lanes", -1); err = ofnode_read_u32_default(node, "nvidia,num-lanes", -1);
if (err < 0) { if (err < 0) {
error("failed to parse \"nvidia,num-lanes\" property"); pr_err("failed to parse \"nvidia,num-lanes\" property");
return err; return err;
} }
@ -468,7 +468,7 @@ static int tegra_pcie_parse_port_info(ofnode node, uint *index, uint *lanes)
err = ofnode_read_pci_addr(node, 0, "reg", &addr); err = ofnode_read_pci_addr(node, 0, "reg", &addr);
if (err < 0) { if (err < 0) {
error("failed to parse \"reg\" property"); pr_err("failed to parse \"reg\" property");
return err; return err;
} }
@ -491,25 +491,25 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id,
err = dev_read_resource(dev, 0, &pcie->pads); err = dev_read_resource(dev, 0, &pcie->pads);
if (err < 0) { if (err < 0) {
error("resource \"pads\" not found"); pr_err("resource \"pads\" not found");
return err; return err;
} }
err = dev_read_resource(dev, 1, &pcie->afi); err = dev_read_resource(dev, 1, &pcie->afi);
if (err < 0) { if (err < 0) {
error("resource \"afi\" not found"); pr_err("resource \"afi\" not found");
return err; return err;
} }
err = dev_read_resource(dev, 2, &pcie->cs); err = dev_read_resource(dev, 2, &pcie->cs);
if (err < 0) { if (err < 0) {
error("resource \"cs\" not found"); pr_err("resource \"cs\" not found");
return err; return err;
} }
err = tegra_pcie_board_init(); err = tegra_pcie_board_init();
if (err < 0) { if (err < 0) {
error("tegra_pcie_board_init() failed: err=%d", err); pr_err("tegra_pcie_board_init() failed: err=%d", err);
return err; return err;
} }
@ -518,7 +518,7 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id,
if (pcie->phy) { if (pcie->phy) {
err = tegra_xusb_phy_prepare(pcie->phy); err = tegra_xusb_phy_prepare(pcie->phy);
if (err < 0) { if (err < 0) {
error("failed to prepare PHY: %d", err); pr_err("failed to prepare PHY: %d", err);
return err; return err;
} }
} }
@ -530,7 +530,7 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id,
err = tegra_pcie_parse_port_info(subnode, &index, &num_lanes); err = tegra_pcie_parse_port_info(subnode, &index, &num_lanes);
if (err < 0) { if (err < 0) {
error("failed to obtain root port info"); pr_err("failed to obtain root port info");
continue; continue;
} }
@ -560,7 +560,7 @@ static int tegra_pcie_parse_dt(struct udevice *dev, enum tegra_pci_id id,
err = tegra_pcie_get_xbar_config(dev_ofnode(dev), lanes, id, err = tegra_pcie_get_xbar_config(dev_ofnode(dev), lanes, id,
&pcie->xbar); &pcie->xbar);
if (err < 0) { if (err < 0) {
error("invalid lane configuration"); pr_err("invalid lane configuration");
return err; return err;
} }
@ -574,31 +574,31 @@ static int tegra_pcie_power_on(struct tegra_pcie *pcie)
ret = power_domain_on(&pcie->pwrdom); ret = power_domain_on(&pcie->pwrdom);
if (ret) { if (ret) {
error("power_domain_on() failed: %d\n", ret); pr_err("power_domain_on() failed: %d\n", ret);
return ret; return ret;
} }
ret = clk_enable(&pcie->clk_afi); ret = clk_enable(&pcie->clk_afi);
if (ret) { if (ret) {
error("clk_enable(afi) failed: %d\n", ret); pr_err("clk_enable(afi) failed: %d\n", ret);
return ret; return ret;
} }
ret = clk_enable(&pcie->clk_pex); ret = clk_enable(&pcie->clk_pex);
if (ret) { if (ret) {
error("clk_enable(pex) failed: %d\n", ret); pr_err("clk_enable(pex) failed: %d\n", ret);
return ret; return ret;
} }
ret = reset_deassert(&pcie->reset_afi); ret = reset_deassert(&pcie->reset_afi);
if (ret) { if (ret) {
error("reset_deassert(afi) failed: %d\n", ret); pr_err("reset_deassert(afi) failed: %d\n", ret);
return ret; return ret;
} }
ret = reset_deassert(&pcie->reset_pex); ret = reset_deassert(&pcie->reset_pex);
if (ret) { if (ret) {
error("reset_deassert(pex) failed: %d\n", ret); pr_err("reset_deassert(pex) failed: %d\n", ret);
return ret; return ret;
} }
@ -618,14 +618,14 @@ static int tegra_pcie_power_on(struct tegra_pcie *pcie)
err = tegra_powergate_power_off(TEGRA_POWERGATE_PCIE); err = tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
if (err < 0) { if (err < 0) {
error("failed to power off PCIe partition: %d", err); pr_err("failed to power off PCIe partition: %d", err);
return err; return err;
} }
err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE, err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE,
PERIPH_ID_PCIE); PERIPH_ID_PCIE);
if (err < 0) { if (err < 0) {
error("failed to power up PCIe partition: %d", err); pr_err("failed to power up PCIe partition: %d", err);
return err; return err;
} }
@ -645,7 +645,7 @@ static int tegra_pcie_power_on(struct tegra_pcie *pcie)
err = tegra_plle_enable(); err = tegra_plle_enable();
if (err < 0) { if (err < 0) {
error("failed to enable PLLE: %d\n", err); pr_err("failed to enable PLLE: %d\n", err);
return err; return err;
} }
@ -705,7 +705,7 @@ static int tegra_pcie_phy_enable(struct tegra_pcie *pcie)
/* wait for the PLL to lock */ /* wait for the PLL to lock */
err = tegra_pcie_pll_wait(pcie, 500); err = tegra_pcie_pll_wait(pcie, 500);
if (err < 0) { if (err < 0) {
error("PLL failed to lock: %d", err); pr_err("PLL failed to lock: %d", err);
return err; return err;
} }
@ -769,7 +769,7 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
err = tegra_pcie_phy_enable(pcie); err = tegra_pcie_phy_enable(pcie);
if (err < 0) { if (err < 0) {
error("failed to power on PHY: %d\n", err); pr_err("failed to power on PHY: %d\n", err);
return err; return err;
} }
#endif #endif
@ -778,7 +778,7 @@ static int tegra_pcie_enable_controller(struct tegra_pcie *pcie)
#ifdef CONFIG_TEGRA186 #ifdef CONFIG_TEGRA186
err = reset_deassert(&pcie->reset_pcie_x); err = reset_deassert(&pcie->reset_pcie_x);
if (err) { if (err) {
error("reset_deassert(pcie_x) failed: %d\n", err); pr_err("reset_deassert(pcie_x) failed: %d\n", err);
return err; return err;
} }
#else #else
@ -1143,25 +1143,25 @@ static int pci_tegra_probe(struct udevice *dev)
err = tegra_pcie_power_on(pcie); err = tegra_pcie_power_on(pcie);
if (err < 0) { if (err < 0) {
error("failed to power on"); pr_err("failed to power on");
return err; return err;
} }
err = tegra_pcie_enable_controller(pcie); err = tegra_pcie_enable_controller(pcie);
if (err < 0) { if (err < 0) {
error("failed to enable controller"); pr_err("failed to enable controller");
return err; return err;
} }
err = tegra_pcie_setup_translations(dev); err = tegra_pcie_setup_translations(dev);
if (err < 0) { if (err < 0) {
error("failed to decode ranges"); pr_err("failed to decode ranges");
return err; return err;
} }
err = tegra_pcie_enable(pcie); err = tegra_pcie_enable(pcie);
if (err < 0) { if (err < 0) {
error("failed to enable PCIe"); pr_err("failed to enable PCIe");
return err; return err;
} }

View file

@ -187,7 +187,7 @@ static int pcie_xilinx_ofdata_to_platdata(struct udevice *dev)
err = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg", err = fdt_get_resource(gd->fdt_blob, dev_of_offset(dev), "reg",
0, &reg_res); 0, &reg_res);
if (err < 0) { if (err < 0) {
error("\"reg\" resource not found\n"); pr_err("\"reg\" resource not found\n");
return err; return err;
} }

View file

@ -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", debug("Read from reg = %p - value = 0x%x\n",
hpipe_addr + HPIPE_LANE_STATUS1_REG, hpipe_addr + HPIPE_LANE_STATUS1_REG,
data); data);
error("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n"); pr_err("HPIPE_LANE_STATUS1_PCLK_EN_MASK is 0\n");
ret = 0; ret = 0;
} }
} }
@ -633,7 +633,7 @@ static int comphy_usb3_power_up(u32 lane, void __iomem *hpipe_base,
if (data != 0) { if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n", debug("Read from reg = %p - value = 0x%x\n",
hpipe_addr + HPIPE_LANE_STATUS1_REG, data); 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; 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"); gd->fdt_blob, sata_node, "marvell,armada-8k-ahci");
if (sata_node == 0) { if (sata_node == 0) {
error("SATA node not found in FDT\n"); pr_err("SATA node not found in FDT\n");
return 0; return 0;
} }
sata_base = (void __iomem *)fdtdec_get_addr_size_auto_noparent( sata_base = (void __iomem *)fdtdec_get_addr_size_auto_noparent(
gd->fdt_blob, sata_node, "reg", 0, NULL, true); gd->fdt_blob, sata_node, "reg", 0, NULL, true);
if (sata_base == NULL) { if (sata_base == NULL) {
error("SATA address not found in FDT\n"); pr_err("SATA address not found in FDT\n");
return 0; return 0;
} }
@ -976,7 +976,7 @@ static int comphy_sata_power_up(u32 lane, void __iomem *hpipe_base,
if (data != 0) { if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n", debug("Read from reg = %p - value = 0x%x\n",
hpipe_addr + HPIPE_LANE_STATUS1_REG, data); 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_TX_MASK),
(data & SD_EXTERNAL_STATUS0_PLL_RX_MASK)); (data & SD_EXTERNAL_STATUS0_PLL_RX_MASK));
ret = 0; ret = 0;
@ -1099,7 +1099,7 @@ static int comphy_sgmii_power_up(u32 lane, u32 sgmii_speed,
if (data != 0) { if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n", debug("Read from reg = %p - value = 0x%x\n",
sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); 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_RX_MASK),
(data & SD_EXTERNAL_STATUS0_PLL_TX_MASK)); (data & SD_EXTERNAL_STATUS0_PLL_TX_MASK));
ret = 0; 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); data = polling_with_timeout(addr, data, mask, 100);
if (data != 0) { if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); 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; 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); data = polling_with_timeout(addr, data, mask, 15000);
if (data != 0) { if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n", sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); 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_RX_MASK),
(data & SD_EXTERNAL_STATUS0_PLL_TX_MASK)); (data & SD_EXTERNAL_STATUS0_PLL_TX_MASK));
ret = 0; ret = 0;
@ -1418,7 +1418,7 @@ static int comphy_sfi_power_up(u32 lane, void __iomem *hpipe_base,
if (data != 0) { if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n", debug("Read from reg = %p - value = 0x%x\n",
sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); 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; ret = 0;
} }
@ -1577,7 +1577,7 @@ static int comphy_rxauii_power_up(u32 lane, void __iomem *hpipe_base,
if (data != 0) { if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n", debug("Read from reg = %p - value = 0x%x\n",
sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); 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_RX_MASK),
(data & SD_EXTERNAL_STATUS0_PLL_TX_MASK)); (data & SD_EXTERNAL_STATUS0_PLL_TX_MASK));
ret = 0; ret = 0;
@ -1596,7 +1596,7 @@ static int comphy_rxauii_power_up(u32 lane, void __iomem *hpipe_base,
if (data != 0) { if (data != 0) {
debug("Read from reg = %p - value = 0x%x\n", debug("Read from reg = %p - value = 0x%x\n",
sd_ip_addr + SD_EXTERNAL_STATUS0_REG, data); 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; ret = 0;
} }
@ -1742,7 +1742,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr,
mask = data; mask = data;
data = polling_with_timeout(addr, data, mask, 100); data = polling_with_timeout(addr, data, mask, 100);
if (data != 0) { 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); debug("Read from reg = %p - value = 0x%x\n", addr, data);
ret = 0; ret = 0;
} }
@ -1751,7 +1751,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr,
mask = data; mask = data;
data = polling_with_timeout(addr, data, mask, 100); data = polling_with_timeout(addr, data, mask, 100);
if (data != 0) { 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); debug("Read from reg = %p - value = 0x%x\n", addr, data);
ret = 0; ret = 0;
} }
@ -1761,7 +1761,7 @@ static int comphy_utmi_power_up(u32 utmi_index, void __iomem *utmi_base_addr,
mask = data; mask = data;
data = polling_with_timeout(addr, data, mask, 100); data = polling_with_timeout(addr, data, mask, 100);
if (data != 0) { 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); debug("Read from reg = %p - value = 0x%x\n", addr, data);
ret = 0; 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].usb_cfg_addr,
cp110_utmi_data[i].utmi_cfg_addr, cp110_utmi_data[i].utmi_cfg_addr,
cp110_utmi_data[i].utmi_phy_port)) { 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; continue;
} }
printf("UTMI PHY %d initialized to ", i); 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( (void __iomem *)fdtdec_get_addr_size_auto_noparent(
gd->fdt_blob, node, "reg", 0, NULL, true); gd->fdt_blob, node, "reg", 0, NULL, true);
if (cp110_utmi_data[i].utmi_base_addr == NULL) { 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++; i++;
continue; continue;
} }
@ -1874,7 +1874,7 @@ void comphy_dedicated_phys_init(void)
(void __iomem *)fdtdec_get_addr_size_auto_noparent( (void __iomem *)fdtdec_get_addr_size_auto_noparent(
gd->fdt_blob, node, "reg", 1, NULL, true); gd->fdt_blob, node, "reg", 1, NULL, true);
if (cp110_utmi_data[i].usb_cfg_addr == NULL) { 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++; i++;
continue; continue;
} }
@ -1884,7 +1884,7 @@ void comphy_dedicated_phys_init(void)
(void __iomem *)fdtdec_get_addr_size_auto_noparent( (void __iomem *)fdtdec_get_addr_size_auto_noparent(
gd->fdt_blob, node, "reg", 2, NULL, true); gd->fdt_blob, node, "reg", 2, NULL, true);
if (cp110_utmi_data[i].utmi_cfg_addr == NULL) { 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++; i++;
continue; continue;
} }
@ -1896,7 +1896,7 @@ void comphy_dedicated_phys_init(void)
cp110_utmi_data[i].utmi_phy_port = fdtdec_get_int( cp110_utmi_data[i].utmi_phy_port = fdtdec_get_int(
gd->fdt_blob, node, "utmi-port", UTMI_PHY_INVALID); gd->fdt_blob, node, "utmi-port", UTMI_PHY_INVALID);
if (cp110_utmi_data[i].utmi_phy_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++; i++;
continue; continue;
} }
@ -2049,7 +2049,7 @@ int comphy_cp110_init(struct chip_serdes_phy_config *ptr_chip_cfg,
* PHY_TYPE_UNCONNECTED state. * PHY_TYPE_UNCONNECTED state.
*/ */
ptr_comphy_map->type = PHY_TYPE_UNCONNECTED; 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); lane);
} }
} }

View file

@ -47,13 +47,13 @@ static int sti_usb_phy_deassert(struct sti_usb_phy *phy)
ret = reset_deassert(&phy->global_ctl); ret = reset_deassert(&phy->global_ctl);
if (ret < 0) { if (ret < 0) {
error("PHY global deassert failed: %d", ret); pr_err("PHY global deassert failed: %d", ret);
return ret; return ret;
} }
ret = reset_deassert(&phy->port_ctl); ret = reset_deassert(&phy->port_ctl);
if (ret < 0) if (ret < 0)
error("PHY port deassert failed: %d", ret); pr_err("PHY port deassert failed: %d", ret);
return ret; return ret;
} }
@ -85,13 +85,13 @@ static int sti_usb_phy_exit(struct phy *usb_phy)
ret = reset_assert(&phy->port_ctl); ret = reset_assert(&phy->port_ctl);
if (ret < 0) { if (ret < 0) {
error("PHY port assert failed: %d", ret); pr_err("PHY port assert failed: %d", ret);
return ret; return ret;
} }
ret = reset_assert(&phy->global_ctl); ret = reset_assert(&phy->global_ctl);
if (ret < 0) if (ret < 0)
error("PHY global assert failed: %d", ret); pr_err("PHY global assert failed: %d", ret);
return ret; return ret;
} }
@ -114,20 +114,20 @@ int sti_usb_phy_probe(struct udevice *dev)
&syscfg_phandle); &syscfg_phandle);
if (ret < 0) { if (ret < 0) {
error("Can't get syscfg phandle: %d\n", ret); pr_err("Can't get syscfg phandle: %d\n", ret);
return ret; return ret;
} }
ret = uclass_get_device_by_ofnode(UCLASS_SYSCON, syscfg_phandle.node, ret = uclass_get_device_by_ofnode(UCLASS_SYSCON, syscfg_phandle.node,
&syscon); &syscon);
if (ret) { if (ret) {
error("unable to find syscon device (%d)\n", ret); pr_err("unable to find syscon device (%d)\n", ret);
return ret; return ret;
} }
priv->regmap = syscon_get_regmap(syscon); priv->regmap = syscon_get_regmap(syscon);
if (!priv->regmap) { if (!priv->regmap) {
error("unable to find regmap\n"); pr_err("unable to find regmap\n");
return -ENODEV; return -ENODEV;
} }
@ -137,12 +137,12 @@ int sti_usb_phy_probe(struct udevice *dev)
ARRAY_SIZE(cells)); ARRAY_SIZE(cells));
if (count < 0) { if (count < 0) {
error("Bad PHY st,syscfg property %d\n", count); pr_err("Bad PHY st,syscfg property %d\n", count);
return -EINVAL; return -EINVAL;
} }
if (count > PHYPARAM_NB) { if (count > PHYPARAM_NB) {
error("Unsupported PHY param count %d\n", count); pr_err("Unsupported PHY param count %d\n", count);
return -EINVAL; return -EINVAL;
} }
@ -152,14 +152,14 @@ int sti_usb_phy_probe(struct udevice *dev)
/* get global reset control */ /* get global reset control */
ret = reset_get_by_name(dev, "global", &priv->global_ctl); ret = reset_get_by_name(dev, "global", &priv->global_ctl);
if (ret) { 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; return ret;
} }
/* get port reset control */ /* get port reset control */
ret = reset_get_by_name(dev, "port", &priv->port_ctl); ret = reset_get_by_name(dev, "port", &priv->port_ctl);
if (ret) { 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; return ret;
} }

View file

@ -261,7 +261,7 @@ static int pipe3_exit(struct phy *phy)
} while (--timeout); } while (--timeout);
if (!(val & PLL_TICOPWDN) || !(val & PLL_LDOPWDN)) { 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); __func__, val);
return -EBUSY; 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, err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
name, &syscon); name, &syscon);
if (err) { 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); name, err);
return NULL; return NULL;
} }
regmap = syscon_get_regmap(syscon); regmap = syscon_get_regmap(syscon);
if (IS_ERR(regmap)) { 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)); name, PTR_ERR(regmap));
return NULL; 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, cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), name,
&len); &len);
if (len < 2*sizeof(fdt32_t)) { 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; return NULL;
} }
@ -318,13 +318,13 @@ static int pipe3_phy_probe(struct udevice *dev)
addr = devfdt_get_addr_size_index(dev, 2, &sz); addr = devfdt_get_addr_size_index(dev, 2, &sz);
if (addr == FDT_ADDR_T_NONE) { if (addr == FDT_ADDR_T_NONE) {
error("missing pll ctrl address\n"); pr_err("missing pll ctrl address\n");
return -EINVAL; return -EINVAL;
} }
pipe3->pll_ctrl_base = map_physmem(addr, sz, MAP_NOCACHE); pipe3->pll_ctrl_base = map_physmem(addr, sz, MAP_NOCACHE);
if (!pipe3->pll_ctrl_base) { if (!pipe3->pll_ctrl_base) {
error("unable to remap pll ctrl\n"); pr_err("unable to remap pll ctrl\n");
return -EINVAL; return -EINVAL;
} }

View file

@ -578,7 +578,7 @@ int armada_37xx_pinctrl_probe(struct udevice *dev)
info->base = (void __iomem *)devfdt_get_addr(dev); info->base = (void __iomem *)devfdt_get_addr(dev);
if (!info->base) { if (!info->base) {
error("unable to find regmap\n"); pr_err("unable to find regmap\n");
return -ENODEV; return -ENODEV;
} }

View file

@ -142,7 +142,7 @@ void sti_pin_configure(struct udevice *dev, struct sti_pin_desc *pin_desc)
break; break;
default: default:
error("%s invalid direction value: 0x%x\n", pr_err("%s invalid direction value: 0x%x\n",
__func__, pin_desc->dir); __func__, pin_desc->dir);
BUG(); BUG();
break; break;
@ -237,14 +237,14 @@ static int sti_pinctrl_set_state(struct udevice *dev, struct udevice *config)
prop_name, "#gpio-cells", prop_name, "#gpio-cells",
0, 0, &args); 0, 0, &args);
if (ret < 0) { if (ret < 0) {
error("Can't get the gpio bank phandle: %d\n", ret); pr_err("Can't get the gpio bank phandle: %d\n", ret);
return ret; return ret;
} }
bank_name = fdt_getprop(blob, args.node, "st,bank-name", bank_name = fdt_getprop(blob, args.node, "st,bank-name",
&count); &count);
if (count < 0) { if (count < 0) {
error("Can't find bank-name property %d\n", count); pr_err("Can't find bank-name property %d\n", count);
return -EINVAL; return -EINVAL;
} }
@ -254,12 +254,12 @@ static int sti_pinctrl_set_state(struct udevice *dev, struct udevice *config)
prop_name, cells, prop_name, cells,
ARRAY_SIZE(cells)); ARRAY_SIZE(cells));
if (count < 0) { if (count < 0) {
error("Bad pin configuration array %d\n", count); pr_err("Bad pin configuration array %d\n", count);
return -EINVAL; return -EINVAL;
} }
if (count > MAX_STI_PINCONF_ENTRIES) { if (count > MAX_STI_PINCONF_ENTRIES) {
error("Unsupported pinconf array count %d\n", count); pr_err("Unsupported pinconf array count %d\n", count);
return -EINVAL; return -EINVAL;
} }
@ -284,13 +284,13 @@ static int sti_pinctrl_probe(struct udevice *dev)
err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
"st,syscfg", &syscon); "st,syscfg", &syscon);
if (err) { if (err) {
error("unable to find syscon device\n"); pr_err("unable to find syscon device\n");
return err; return err;
} }
plat->regmap = syscon_get_regmap(syscon); plat->regmap = syscon_get_regmap(syscon);
if (!plat->regmap) { if (!plat->regmap) {
error("unable to find regmap\n"); pr_err("unable to find regmap\n");
return -ENODEV; return -ENODEV;
} }

View file

@ -160,7 +160,7 @@ static int stm32_pinctrl_set_state_simple(struct udevice *dev,
config_node = fdt_node_offset_by_phandle(fdt, phandle); config_node = fdt_node_offset_by_phandle(fdt, phandle);
if (config_node < 0) { if (config_node < 0) {
error("prop pinctrl-0 index %d invalid phandle\n", i); pr_err("prop pinctrl-0 index %d invalid phandle\n", i);
return -EINVAL; return -EINVAL;
} }

View file

@ -46,14 +46,14 @@ static int as3722_read_id(struct udevice *dev, uint *idp, uint *revisionp)
ret = pmic_reg_read(dev, AS3722_ASIC_ID1); ret = pmic_reg_read(dev, AS3722_ASIC_ID1);
if (ret < 0) { if (ret < 0) {
error("failed to read ID1 register: %d", ret); pr_err("failed to read ID1 register: %d", ret);
return ret; return ret;
} }
*idp = ret; *idp = ret;
ret = pmic_reg_read(dev, AS3722_ASIC_ID2); ret = pmic_reg_read(dev, AS3722_ASIC_ID2);
if (ret < 0) { if (ret < 0) {
error("failed to read ID2 register: %d", ret); pr_err("failed to read ID2 register: %d", ret);
return ret; return ret;
} }
*revisionp = ret; *revisionp = ret;
@ -71,7 +71,7 @@ int as3722_sd_set_voltage(struct udevice *dev, unsigned int sd, u8 value)
ret = pmic_reg_write(dev, AS3722_SD_VOLTAGE(sd), value); ret = pmic_reg_write(dev, AS3722_SD_VOLTAGE(sd), value);
if (ret < 0) { if (ret < 0) {
error("failed to write SD%u voltage register: %d", sd, ret); pr_err("failed to write SD%u voltage register: %d", sd, ret);
return ret; return ret;
} }
@ -87,7 +87,7 @@ int as3722_ldo_set_voltage(struct udevice *dev, unsigned int ldo, u8 value)
ret = pmic_reg_write(dev, AS3722_LDO_VOLTAGE(ldo), value); ret = pmic_reg_write(dev, AS3722_LDO_VOLTAGE(ldo), value);
if (ret < 0) { if (ret < 0) {
error("failed to write LDO%u voltage register: %d", ldo, pr_err("failed to write LDO%u voltage register: %d", ldo,
ret); ret);
return ret; return ret;
} }
@ -102,12 +102,12 @@ static int as3722_probe(struct udevice *dev)
ret = as3722_read_id(dev, &id, &revision); ret = as3722_read_id(dev, &id, &revision);
if (ret < 0) { if (ret < 0) {
error("failed to read ID: %d", ret); pr_err("failed to read ID: %d", ret);
return ret; return ret;
} }
if (id != AS3722_DEVICE_ID) { if (id != AS3722_DEVICE_ID) {
error("unknown device"); pr_err("unknown device");
return -ENOENT; return -ENOENT;
} }

View file

@ -26,7 +26,7 @@ int as3722_gpio_configure(struct udevice *pmic, unsigned int gpio,
err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value); err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value);
if (err) { if (err) {
error("failed to configure GPIO#%u: %d", gpio, err); pr_err("failed to configure GPIO#%u: %d", gpio, err);
return err; return err;
} }
@ -46,7 +46,7 @@ static int as3722_gpio_set_value(struct udevice *dev, unsigned int gpio,
err = pmic_reg_read(pmic, AS3722_GPIO_SIGNAL_OUT); err = pmic_reg_read(pmic, AS3722_GPIO_SIGNAL_OUT);
if (err < 0) { if (err < 0) {
error("failed to read GPIO signal out register: %d", err); pr_err("failed to read GPIO signal out register: %d", err);
return err; return err;
} }
value = err; value = err;
@ -61,7 +61,7 @@ static int as3722_gpio_set_value(struct udevice *dev, unsigned int gpio,
err = pmic_reg_write(pmic, AS3722_GPIO_SIGNAL_OUT, value); err = pmic_reg_write(pmic, AS3722_GPIO_SIGNAL_OUT, value);
if (err) { if (err) {
error("failed to set GPIO#%u %s: %d", gpio, l, err); pr_err("failed to set GPIO#%u %s: %d", gpio, l, err);
return err; return err;
} }
@ -84,13 +84,13 @@ int as3722_gpio_direction_output(struct udevice *dev, unsigned int gpio,
err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value); err = pmic_reg_write(pmic, AS3722_GPIO_CONTROL(gpio), value);
if (err) { if (err) {
error("failed to configure GPIO#%u as output: %d", gpio, err); pr_err("failed to configure GPIO#%u as output: %d", gpio, err);
return err; return err;
} }
err = as3722_gpio_set_value(pmic, gpio, value); err = as3722_gpio_set_value(pmic, gpio, value);
if (err < 0) { if (err < 0) {
error("failed to set GPIO#%u high: %d", gpio, err); pr_err("failed to set GPIO#%u high: %d", gpio, err);
return err; return err;
} }

View file

@ -31,7 +31,7 @@ static int sandbox_i2c_pmic_read_data(struct udevice *emul, uchar chip,
struct sandbox_i2c_pmic_plat_data *plat = dev_get_platdata(emul); struct sandbox_i2c_pmic_plat_data *plat = dev_get_platdata(emul);
if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) { if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) {
error("Request exceeds PMIC register range! Max register: %#x", pr_err("Request exceeds PMIC register range! Max register: %#x",
SANDBOX_PMIC_REG_COUNT); SANDBOX_PMIC_REG_COUNT);
return -EFAULT; return -EFAULT;
} }
@ -68,7 +68,7 @@ static int sandbox_i2c_pmic_write_data(struct udevice *emul, uchar chip,
len--; len--;
if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) { if (plat->rw_reg + len > SANDBOX_PMIC_REG_COUNT) {
error("Request exceeds PMIC register range! Max register: %#x", pr_err("Request exceeds PMIC register range! Max register: %#x",
SANDBOX_PMIC_REG_COUNT); SANDBOX_PMIC_REG_COUNT);
} }
@ -111,7 +111,7 @@ static int sandbox_i2c_pmic_ofdata_to_platdata(struct udevice *emul)
SANDBOX_PMIC_REG_COUNT); SANDBOX_PMIC_REG_COUNT);
if (!reg_defaults) { if (!reg_defaults) {
error("Property \"reg-defaults\" not found for device: %s!", pr_err("Property \"reg-defaults\" not found for device: %s!",
emul->name); emul->name);
return -EINVAL; return -EINVAL;
} }

View file

@ -27,7 +27,7 @@ static int lp873x_write(struct udevice *dev, uint reg, const uint8_t *buff,
int len) int len)
{ {
if (dm_i2c_write(dev, reg, buff, len)) { if (dm_i2c_write(dev, reg, buff, len)) {
error("write error to device: %p register: %#x!", dev, reg); pr_err("write error to device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }
@ -37,7 +37,7 @@ static int lp873x_write(struct udevice *dev, uint reg, const uint8_t *buff,
static int lp873x_read(struct udevice *dev, uint reg, uint8_t *buff, int len) static int lp873x_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
{ {
if (dm_i2c_read(dev, reg, buff, len)) { if (dm_i2c_read(dev, reg, buff, len)) {
error("read error from device: %p register: %#x!", dev, reg); pr_err("read error from device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }

View file

@ -29,7 +29,7 @@ static int lp87565_write(struct udevice *dev, uint reg, const uint8_t *buff,
ret = dm_i2c_write(dev, reg, buff, len); ret = dm_i2c_write(dev, reg, buff, len);
if (ret) if (ret)
error("write error to device: %p register: %#x!", dev, reg); pr_err("write error to device: %p register: %#x!", dev, reg);
return ret; return ret;
} }
@ -40,7 +40,7 @@ static int lp87565_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
ret = dm_i2c_read(dev, reg, buff, len); ret = dm_i2c_read(dev, reg, buff, len);
if (ret) if (ret)
error("read error from device: %p register: %#x!", dev, reg); pr_err("read error from device: %p register: %#x!", dev, reg);
return ret; return ret;
} }

View file

@ -31,7 +31,7 @@ static int max77686_write(struct udevice *dev, uint reg, const uint8_t *buff,
int len) int len)
{ {
if (dm_i2c_write(dev, reg, buff, len)) { if (dm_i2c_write(dev, reg, buff, len)) {
error("write error to device: %p register: %#x!", dev, reg); pr_err("write error to device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }
@ -41,7 +41,7 @@ static int max77686_write(struct udevice *dev, uint reg, const uint8_t *buff,
static int max77686_read(struct udevice *dev, uint reg, uint8_t *buff, int len) static int max77686_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
{ {
if (dm_i2c_read(dev, reg, buff, len)) { if (dm_i2c_read(dev, reg, buff, len)) {
error("read error from device: %p register: %#x!", dev, reg); pr_err("read error from device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }

View file

@ -26,7 +26,7 @@ static int max8997_write(struct udevice *dev, uint reg, const uint8_t *buff,
ret = dm_i2c_write(dev, reg, buff, len); ret = dm_i2c_write(dev, reg, buff, len);
if (ret) if (ret)
error("write error to device: %p register: %#x!", dev, reg); pr_err("write error to device: %p register: %#x!", dev, reg);
return ret; return ret;
} }
@ -37,7 +37,7 @@ static int max8997_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
ret = dm_i2c_read(dev, reg, buff, len); ret = dm_i2c_read(dev, reg, buff, len);
if (ret) if (ret)
error("read error from device: %p register: %#x!", dev, reg); pr_err("read error from device: %p register: %#x!", dev, reg);
return ret; return ret;
} }

View file

@ -26,7 +26,7 @@ static int max8998_write(struct udevice *dev, uint reg, const uint8_t *buff,
ret = dm_i2c_write(dev, reg, buff, len); ret = dm_i2c_write(dev, reg, buff, len);
if (ret) if (ret)
error("write error to device: %p register: %#x!", dev, reg); pr_err("write error to device: %p register: %#x!", dev, reg);
return ret; return ret;
} }
@ -37,7 +37,7 @@ static int max8998_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
ret = dm_i2c_read(dev, reg, buff, len); ret = dm_i2c_read(dev, reg, buff, len);
if (ret) if (ret)
error("read error from device: %p register: %#x!", dev, reg); pr_err("read error from device: %p register: %#x!", dev, reg);
return ret; return ret;
} }

View file

@ -27,7 +27,7 @@ static int palmas_write(struct udevice *dev, uint reg, const uint8_t *buff,
int len) int len)
{ {
if (dm_i2c_write(dev, reg, buff, len)) { if (dm_i2c_write(dev, reg, buff, len)) {
error("write error to device: %p register: %#x!", dev, reg); pr_err("write error to device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }
@ -37,7 +37,7 @@ static int palmas_write(struct udevice *dev, uint reg, const uint8_t *buff,
static int palmas_read(struct udevice *dev, uint reg, uint8_t *buff, int len) static int palmas_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
{ {
if (dm_i2c_read(dev, reg, buff, len)) { if (dm_i2c_read(dev, reg, buff, len)) {
error("read error from device: %p register: %#x!", dev, reg); pr_err("read error from device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }

View file

@ -33,7 +33,7 @@ static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff,
int len) int len)
{ {
if (dm_i2c_write(dev, reg, buff, len)) { if (dm_i2c_write(dev, reg, buff, len)) {
error("write error to device: %p register: %#x!", dev, reg); pr_err("write error to device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }
@ -43,7 +43,7 @@ static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff,
static int pfuze100_read(struct udevice *dev, uint reg, uint8_t *buff, int len) static int pfuze100_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
{ {
if (dm_i2c_read(dev, reg, buff, len)) { if (dm_i2c_read(dev, reg, buff, len)) {
error("read error from device: %p register: %#x!", dev, reg); pr_err("read error from device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }

View file

@ -27,7 +27,7 @@ static int s2mps11_write(struct udevice *dev, uint reg, const uint8_t *buff,
ret = dm_i2c_write(dev, reg, buff, len); ret = dm_i2c_write(dev, reg, buff, len);
if (ret) if (ret)
error("write error to device: %p register: %#x!", dev, reg); pr_err("write error to device: %p register: %#x!", dev, reg);
return ret; return ret;
} }
@ -38,7 +38,7 @@ static int s2mps11_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
ret = dm_i2c_read(dev, reg, buff, len); ret = dm_i2c_read(dev, reg, buff, len);
if (ret) if (ret)
error("read error from device: %p register: %#x!", dev, reg); pr_err("read error from device: %p register: %#x!", dev, reg);
return ret; return ret;
} }

View file

@ -30,7 +30,7 @@ static int s5m8767_write(struct udevice *dev, uint reg, const uint8_t *buff,
int len) int len)
{ {
if (dm_i2c_write(dev, reg, buff, len)) { if (dm_i2c_write(dev, reg, buff, len)) {
error("write error to device: %p register: %#x!", dev, reg); pr_err("write error to device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }
@ -40,7 +40,7 @@ static int s5m8767_write(struct udevice *dev, uint reg, const uint8_t *buff,
static int s5m8767_read(struct udevice *dev, uint reg, uint8_t *buff, int len) static int s5m8767_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
{ {
if (dm_i2c_read(dev, reg, buff, len)) { if (dm_i2c_read(dev, reg, buff, len)) {
error("read error from device: %p register: %#x!", dev, reg); pr_err("read error from device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }

View file

@ -31,7 +31,7 @@ static int sandbox_pmic_write(struct udevice *dev, uint reg,
const uint8_t *buff, int len) const uint8_t *buff, int len)
{ {
if (dm_i2c_write(dev, reg, buff, len)) { if (dm_i2c_write(dev, reg, buff, len)) {
error("write error to device: %p register: %#x!", dev, reg); pr_err("write error to device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }
@ -42,7 +42,7 @@ static int sandbox_pmic_read(struct udevice *dev, uint reg,
uint8_t *buff, int len) uint8_t *buff, int len)
{ {
if (dm_i2c_read(dev, reg, buff, len)) { if (dm_i2c_read(dev, reg, buff, len)) {
error("read error from device: %p register: %#x!", dev, reg); pr_err("read error from device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }
@ -52,7 +52,7 @@ static int sandbox_pmic_read(struct udevice *dev, uint reg,
static int sandbox_pmic_bind(struct udevice *dev) static int sandbox_pmic_bind(struct udevice *dev)
{ {
if (!pmic_bind_children(dev, dev_ofnode(dev), pmic_children_info)) if (!pmic_bind_children(dev, dev_ofnode(dev), pmic_children_info))
error("%s:%d PMIC: %s - no child found!", __func__, __LINE__, pr_err("%s:%d PMIC: %s - no child found!", __func__, __LINE__,
dev->name); dev->name);
/* Always return success for this device - allows for PMIC I/O */ /* Always return success for this device - allows for PMIC I/O */

View file

@ -29,7 +29,7 @@ static int tps65090_write(struct udevice *dev, uint reg, const uint8_t *buff,
int len) int len)
{ {
if (dm_i2c_write(dev, reg, buff, len)) { if (dm_i2c_write(dev, reg, buff, len)) {
error("write error to device: %p register: %#x!", dev, reg); pr_err("write error to device: %p register: %#x!", dev, reg);
return -EIO; return -EIO;
} }
@ -42,7 +42,7 @@ static int tps65090_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
ret = dm_i2c_read(dev, reg, buff, len); ret = dm_i2c_read(dev, reg, buff, len);
if (ret) { if (ret) {
error("read error %d from device: %p register: %#x!", ret, dev, pr_err("read error %d from device: %p register: %#x!", ret, dev,
reg); reg);
return -EIO; return -EIO;
} }

View file

@ -117,7 +117,7 @@ static int fixed_regulator_set_enable(struct udevice *dev, bool enable)
ret = dm_gpio_set_value(&dev_pdata->gpio, enable); ret = dm_gpio_set_value(&dev_pdata->gpio, enable);
if (ret) { if (ret) {
error("Can't set regulator : %s gpio to: %d\n", dev->name, pr_err("Can't set regulator : %s gpio to: %d\n", dev->name,
enable); enable);
return ret; return ret;
} }

View file

@ -109,7 +109,7 @@ static int gpio_regulator_set_value(struct udevice *dev, int uV)
ret = dm_gpio_set_value(&dev_pdata->gpio, enable); ret = dm_gpio_set_value(&dev_pdata->gpio, enable);
if (ret) { if (ret) {
error("Can't set regulator : %s gpio to: %d\n", dev->name, pr_err("Can't set regulator : %s gpio to: %d\n", dev->name,
enable); enable);
return ret; return ret;
} }

View file

@ -98,7 +98,7 @@ static int max77686_buck_volt2hex(int buck, int uV)
if (hex >= 0 && hex <= hex_max) if (hex >= 0 && hex <= hex_max)
return hex; return hex;
error("Value: %d uV is wrong for BUCK%d", uV, buck); pr_err("Value: %d uV is wrong for BUCK%d", uV, buck);
return -EINVAL; return -EINVAL;
} }
@ -134,7 +134,7 @@ static int max77686_buck_hex2volt(int buck, int hex)
return uV; return uV;
bad_hex: bad_hex:
error("Value: %#x is wrong for BUCK%d", hex, buck); pr_err("Value: %#x is wrong for BUCK%d", hex, buck);
return -EINVAL; return -EINVAL;
} }
@ -160,7 +160,7 @@ static int max77686_ldo_volt2hex(int ldo, int uV)
if (hex >= 0 && hex <= MAX77686_LDO_VOLT_MAX_HEX) if (hex >= 0 && hex <= MAX77686_LDO_VOLT_MAX_HEX)
return hex; return hex;
error("Value: %d uV is wrong for LDO%d", uV, ldo); pr_err("Value: %d uV is wrong for LDO%d", uV, ldo);
return -EINVAL; return -EINVAL;
} }
@ -189,7 +189,7 @@ static int max77686_ldo_hex2volt(int ldo, int hex)
return uV; return uV;
bad_hex: bad_hex:
error("Value: %#x is wrong for ldo%d", hex, ldo); pr_err("Value: %#x is wrong for ldo%d", hex, ldo);
return -EINVAL; return -EINVAL;
} }
@ -328,7 +328,7 @@ static int max77686_ldo_val(struct udevice *dev, int op, int *uV)
ldo = dev->driver_data; ldo = dev->driver_data;
if (ldo < 1 || ldo > MAX77686_LDO_NUM) { if (ldo < 1 || ldo > MAX77686_LDO_NUM) {
error("Wrong ldo number: %d", ldo); pr_err("Wrong ldo number: %d", ldo);
return -EINVAL; return -EINVAL;
} }
@ -366,7 +366,7 @@ static int max77686_buck_val(struct udevice *dev, int op, int *uV)
buck = dev->driver_data; buck = dev->driver_data;
if (buck < 1 || buck > MAX77686_BUCK_NUM) { if (buck < 1 || buck > MAX77686_BUCK_NUM) {
error("Wrong buck number: %d", buck); pr_err("Wrong buck number: %d", buck);
return -EINVAL; return -EINVAL;
} }
@ -423,7 +423,7 @@ static int max77686_ldo_mode(struct udevice *dev, int op, int *opmode)
ldo = dev->driver_data; ldo = dev->driver_data;
if (ldo < 1 || ldo > MAX77686_LDO_NUM) { if (ldo < 1 || ldo > MAX77686_LDO_NUM) {
error("Wrong ldo number: %d", ldo); pr_err("Wrong ldo number: %d", ldo);
return -EINVAL; return -EINVAL;
} }
@ -493,7 +493,7 @@ static int max77686_ldo_mode(struct udevice *dev, int op, int *opmode)
} }
if (mode == 0xff) { if (mode == 0xff) {
error("Wrong mode: %d for ldo%d", *opmode, ldo); pr_err("Wrong mode: %d for ldo%d", *opmode, ldo);
return -EINVAL; return -EINVAL;
} }
@ -545,7 +545,7 @@ static int max77686_buck_mode(struct udevice *dev, int op, int *opmode)
buck = dev->driver_data; buck = dev->driver_data;
if (buck < 1 || buck > MAX77686_BUCK_NUM) { if (buck < 1 || buck > MAX77686_BUCK_NUM) {
error("Wrong buck number: %d", buck); pr_err("Wrong buck number: %d", buck);
return -EINVAL; return -EINVAL;
} }
@ -614,7 +614,7 @@ static int max77686_buck_mode(struct udevice *dev, int op, int *opmode)
} }
if (mode == 0xff) { if (mode == 0xff) {
error("Wrong mode: %d for buck: %d\n", *opmode, buck); pr_err("Wrong mode: %d for buck: %d\n", *opmode, buck);
return -EINVAL; return -EINVAL;
} }

View file

@ -70,14 +70,14 @@ static int pbias_ofdata_to_platdata(struct udevice *dev)
err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev, err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
"syscon", &syscon); "syscon", &syscon);
if (err) { if (err) {
error("%s: unable to find syscon device (%d)\n", __func__, pr_err("%s: unable to find syscon device (%d)\n", __func__,
err); err);
return err; return err;
} }
regmap = syscon_get_regmap(syscon); regmap = syscon_get_regmap(syscon);
if (IS_ERR(regmap)) { if (IS_ERR(regmap)) {
error("%s: unable to find regmap (%ld)\n", __func__, pr_err("%s: unable to find regmap (%ld)\n", __func__,
PTR_ERR(regmap)); PTR_ERR(regmap));
return PTR_ERR(regmap); return PTR_ERR(regmap);
} }
@ -85,7 +85,7 @@ static int pbias_ofdata_to_platdata(struct udevice *dev)
err = dev_read_resource(dev, 0, &res); err = dev_read_resource(dev, 0, &res);
if (err) { if (err) {
error("%s: unable to find offset (%d)\n", __func__, err); pr_err("%s: unable to find offset (%d)\n", __func__, err);
return err; return err;
} }
priv->offset = res.start; priv->offset = res.start;

View file

@ -87,7 +87,7 @@ int out_get_value(struct udevice *dev, int output_count, int reg_type,
int ret; int ret;
if (dev->driver_data > output_count) { if (dev->driver_data > output_count) {
error("Unknown regulator number: %lu for PMIC %s!", pr_err("Unknown regulator number: %lu for PMIC %s!",
dev->driver_data, dev->name); dev->driver_data, dev->name);
return -EINVAL; return -EINVAL;
} }
@ -95,7 +95,7 @@ int out_get_value(struct udevice *dev, int output_count, int reg_type,
reg = (dev->driver_data - 1) * OUT_REG_COUNT + reg_type; reg = (dev->driver_data - 1) * OUT_REG_COUNT + reg_type;
ret = pmic_read(dev->parent, reg, &reg_val, 1); ret = pmic_read(dev->parent, reg, &reg_val, 1);
if (ret) { if (ret) {
error("PMIC read failed: %d\n", ret); pr_err("PMIC read failed: %d\n", ret);
return ret; return ret;
} }
@ -115,14 +115,14 @@ static int out_set_value(struct udevice *dev, int output_count, int reg_type,
int max_value; int max_value;
if (dev->driver_data > output_count) { if (dev->driver_data > output_count) {
error("Unknown regulator number: %lu for PMIC %s!", pr_err("Unknown regulator number: %lu for PMIC %s!",
dev->driver_data, dev->name); dev->driver_data, dev->name);
return -EINVAL; return -EINVAL;
} }
max_value = range[dev->driver_data - 1].max; max_value = range[dev->driver_data - 1].max;
if (value > max_value) { if (value > max_value) {
error("Wrong value for %s: %lu. Max is: %d.", pr_err("Wrong value for %s: %lu. Max is: %d.",
dev->name, dev->driver_data, max_value); dev->name, dev->driver_data, max_value);
return -EINVAL; return -EINVAL;
} }
@ -134,7 +134,7 @@ static int out_set_value(struct udevice *dev, int output_count, int reg_type,
reg = (dev->driver_data - 1) * OUT_REG_COUNT + reg_type; reg = (dev->driver_data - 1) * OUT_REG_COUNT + reg_type;
ret = pmic_write(dev->parent, reg, &reg_val, 1); ret = pmic_write(dev->parent, reg, &reg_val, 1);
if (ret) { if (ret) {
error("PMIC write failed: %d\n", ret); pr_err("PMIC write failed: %d\n", ret);
return ret; return ret;
} }
@ -154,7 +154,7 @@ static int out_get_mode(struct udevice *dev)
reg = (dev->driver_data - 1) * OUT_REG_COUNT + OUT_REG_OM; reg = (dev->driver_data - 1) * OUT_REG_COUNT + OUT_REG_OM;
ret = pmic_read(dev->parent, reg, &reg_val, 1); ret = pmic_read(dev->parent, reg, &reg_val, 1);
if (ret) { if (ret) {
error("PMIC read failed: %d\n", ret); pr_err("PMIC read failed: %d\n", ret);
return ret; return ret;
} }
@ -163,7 +163,7 @@ static int out_get_mode(struct udevice *dev)
return uc_pdata->mode[i].id; return uc_pdata->mode[i].id;
} }
error("Unknown operation mode for %s!", dev->name); pr_err("Unknown operation mode for %s!", dev->name);
return -EINVAL; return -EINVAL;
} }
@ -188,14 +188,14 @@ static int out_set_mode(struct udevice *dev, int mode)
} }
if (reg_val == -1) { if (reg_val == -1) {
error("Unknown operation mode for %s!", dev->name); pr_err("Unknown operation mode for %s!", dev->name);
return -EINVAL; return -EINVAL;
} }
reg = (dev->driver_data - 1) * OUT_REG_COUNT + OUT_REG_OM; reg = (dev->driver_data - 1) * OUT_REG_COUNT + OUT_REG_OM;
ret = pmic_write(dev->parent, reg, (uint8_t *)&reg_val, 1); ret = pmic_write(dev->parent, reg, (uint8_t *)&reg_val, 1);
if (ret) { if (ret) {
error("PMIC write failed: %d\n", ret); pr_err("PMIC write failed: %d\n", ret);
return ret; return ret;
} }

View file

@ -230,7 +230,7 @@ static int memory_init(struct rk3368_ddr_pctl *pctl,
tmp = get_timer(0); tmp = get_timer(0);
do { do {
if (get_timer(tmp) > timeout_ms) { if (get_timer(tmp) > timeout_ms) {
error("%s: POWER_UP_START did not complete in %ld ms\n", pr_err("%s: POWER_UP_START did not complete in %ld ms\n",
__func__, timeout_ms); __func__, timeout_ms);
return -ETIME; return -ETIME;
} }
@ -422,7 +422,7 @@ static int dfi_cfg(struct rk3368_ddr_pctl *pctl)
tmp = get_timer(0); tmp = get_timer(0);
do { do {
if (get_timer(tmp) > timeout_ms) { if (get_timer(tmp) > timeout_ms) {
error("%s: DFI init did not complete within %ld ms\n", pr_err("%s: DFI init did not complete within %ld ms\n",
__func__, timeout_ms); __func__, timeout_ms);
return -ETIME; return -ETIME;
} }
@ -457,7 +457,7 @@ static int pctl_calc_timings(struct rk3368_sdram_params *params,
u32 tfaw_as_ps; u32 tfaw_as_ps;
if (params->ddr_speed_bin != DDR3_1600K) { if (params->ddr_speed_bin != DDR3_1600K) {
error("%s: unimplemented DDR3 speed bin %d\n", pr_err("%s: unimplemented DDR3 speed bin %d\n",
__func__, params->ddr_speed_bin); __func__, params->ddr_speed_bin);
return -1; return -1;
} }
@ -585,7 +585,7 @@ static int ddrphy_data_training(struct rk3368_ddr_pctl *pctl,
tmp = get_timer(0); tmp = get_timer(0);
do { do {
if (get_timer(tmp) > timeout_ms) { if (get_timer(tmp) > timeout_ms) {
error("%s: did not complete within %ld ms\n", pr_err("%s: did not complete within %ld ms\n",
__func__, timeout_ms); __func__, timeout_ms);
return -ETIME; return -ETIME;
} }
@ -625,7 +625,7 @@ static int sdram_col_row_detect(struct udevice *dev)
} }
if (col == 8) { if (col == 8) {
error("%s: col detect error\n", __func__); pr_err("%s: col detect error\n", __func__);
return -EINVAL; return -EINVAL;
} }
@ -644,7 +644,7 @@ static int sdram_col_row_detect(struct udevice *dev)
} }
if (row == 11) { if (row == 11) {
error("%s: row detect error\n", __func__); pr_err("%s: row detect error\n", __func__);
return -EINVAL; return -EINVAL;
} }
@ -764,7 +764,7 @@ static int msch_niu_config(struct rk3368_msch *msch,
} }
} }
error("%s: ddrconf (NIU config) not found\n", __func__); pr_err("%s: ddrconf (NIU config) not found\n", __func__);
return -EINVAL; return -EINVAL;
} }

View file

@ -551,7 +551,7 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel,
tmp = get_timer(0); tmp = get_timer(0);
do { do {
if (get_timer(tmp) > timeout_ms) { if (get_timer(tmp) > timeout_ms) {
error("DRAM (%s): phy failed to lock within %ld ms\n", pr_err("DRAM (%s): phy failed to lock within %ld ms\n",
__func__, timeout_ms); __func__, timeout_ms);
return -ETIME; return -ETIME;
} }

View file

@ -262,7 +262,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev)
bank_name = (char *)ofnode_get_name(bank_node); bank_name = (char *)ofnode_get_name(bank_node);
strsep(&bank_name, "@"); strsep(&bank_name, "@");
if (!bank_name) { if (!bank_name) {
error("missing sdram bank index"); pr_err("missing sdram bank index");
return -EINVAL; return -EINVAL;
} }
@ -271,7 +271,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev)
(long unsigned int *)&bank_params->target_bank); (long unsigned int *)&bank_params->target_bank);
if (bank_params->target_bank >= MAX_SDRAM_BANK) { if (bank_params->target_bank >= MAX_SDRAM_BANK) {
error("Found bank %d , but only bank 0 and 1 are supported", pr_err("Found bank %d , but only bank 0 and 1 are supported",
bank_params->target_bank); bank_params->target_bank);
return -EINVAL; return -EINVAL;
} }
@ -285,7 +285,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev)
sizeof(struct stm32_sdram_control)); sizeof(struct stm32_sdram_control));
if (!params->bank_params[bank].sdram_control) { if (!params->bank_params[bank].sdram_control) {
error("st,sdram-control not found for %s", pr_err("st,sdram-control not found for %s",
ofnode_get_name(bank_node)); ofnode_get_name(bank_node));
return -EINVAL; return -EINVAL;
} }
@ -298,7 +298,7 @@ static int stm32_fmc_ofdata_to_platdata(struct udevice *dev)
sizeof(struct stm32_sdram_timing)); sizeof(struct stm32_sdram_timing));
if (!params->bank_params[bank].sdram_timing) { if (!params->bank_params[bank].sdram_timing) {
error("st,sdram-timing not found for %s", pr_err("st,sdram-timing not found for %s",
ofnode_get_name(bank_node)); ofnode_get_name(bank_node));
return -EINVAL; return -EINVAL;
} }

Some files were not shown because too many files have changed in this diff Show more