[PATCH 27/33] memory: stm32-fmc2: migrate trace to dev and log macro
Patrice CHOTARD
patrice.chotard at st.com
Wed Oct 21 14:34:39 CEST 2020
Hi Patrick
On 10/14/20 11:16 AM, Patrick Delaunay wrote:
> Change pr_* to dev_ or log_ macro and define LOG_CATEGORY.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
> ---
>
> drivers/memory/stm32-fmc2-ebi.c | 30 ++++++++++++++++--------------
> 1 file changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/memory/stm32-fmc2-ebi.c b/drivers/memory/stm32-fmc2-ebi.c
> index d887a1e09d..e3cf75f6e3 100644
> --- a/drivers/memory/stm32-fmc2-ebi.c
> +++ b/drivers/memory/stm32-fmc2-ebi.c
> @@ -3,10 +3,13 @@
> * Copyright (C) STMicroelectronics 2020
> */
>
> +#define LOG_CATEGORY UCLASS_NOP
> +
> #include <common.h>
> #include <clk.h>
> #include <dm.h>
> #include <reset.h>
> +#include <dm/device_compat.h>
> #include <linux/bitfield.h>
> #include <linux/err.h>
> #include <linux/iopoll.h>
> @@ -860,7 +863,7 @@ static int stm32_fmc2_ebi_parse_prop(struct stm32_fmc2_ebi *ebi,
> u32 setup = 0;
>
> if (!prop->set) {
> - pr_err("property %s is not well defined\n", prop->name);
> + log_err("property %s is not well defined\n", prop->name);
> return -EINVAL;
> }
>
> @@ -873,8 +876,8 @@ static int stm32_fmc2_ebi_parse_prop(struct stm32_fmc2_ebi *ebi,
>
> bprop = ofnode_read_bool(node, prop->name);
> if (prop->mprop && !bprop) {
> - pr_err("mandatory property %s not defined in the device tree\n",
> - prop->name);
> + log_err("mandatory property %s not defined in the device tree\n",
> + prop->name);
> return -EINVAL;
> }
>
> @@ -886,8 +889,8 @@ static int stm32_fmc2_ebi_parse_prop(struct stm32_fmc2_ebi *ebi,
>
> ret = ofnode_read_u32(node, prop->name, &val);
> if (prop->mprop && ret) {
> - pr_err("mandatory property %s not defined in the device tree\n",
> - prop->name);
> + log_err("mandatory property %s not defined in the device tree\n",
> + prop->name);
> return ret;
> }
>
> @@ -949,8 +952,8 @@ static int stm32_fmc2_ebi_setup_cs(struct stm32_fmc2_ebi *ebi,
>
> ret = stm32_fmc2_ebi_parse_prop(ebi, node, p, cs);
> if (ret) {
> - pr_err("property %s could not be set: %d\n",
> - p->name, ret);
> + log_err("property %s could not be set: %d\n",
> + p->name, ret);
> return ret;
> }
> }
> @@ -971,25 +974,24 @@ static int stm32_fmc2_ebi_parse_dt(struct udevice *dev,
> dev_for_each_subnode(child, dev) {
> ret = ofnode_read_u32(child, "reg", &bank);
> if (ret) {
> - pr_err("could not retrieve reg property: %d\n", ret);
> + dev_err(dev, "could not retrieve reg property: %d\n", ret);
> return ret;
> }
>
> if (bank >= FMC2_MAX_BANKS) {
> - pr_err("invalid reg value: %d\n", bank);
> + dev_err(dev, "invalid reg value: %d\n", bank);
> return -EINVAL;
> }
>
> if (ebi->bank_assigned & BIT(bank)) {
> - pr_err("bank already assigned: %d\n", bank);
> + dev_err(dev, "bank already assigned: %d\n", bank);
> return -EINVAL;
> }
>
> if (bank < FMC2_MAX_EBI_CE) {
> ret = stm32_fmc2_ebi_setup_cs(ebi, child, bank);
> if (ret) {
> - pr_err("setup chip select %d failed: %d\n",
> - bank, ret);
> + dev_err(dev, "setup chip select %d failed: %d\n", bank, ret);
> return ret;
> }
> }
> @@ -999,12 +1001,12 @@ static int stm32_fmc2_ebi_parse_dt(struct udevice *dev,
> }
>
> if (!child_found) {
> - pr_warn("no subnodes found, disable the driver.\n");
> + dev_warn(dev, "no subnodes found, disable the driver.\n");
> return -ENODEV;
> }
>
> if (stm32_fmc2_ebi_nwait_used_by_ctrls(ebi)) {
> - pr_err("NWAIT signal connected to EBI and NAND controllers\n");
> + dev_err(dev, "NWAIT signal connected to EBI and NAND controllers\n");
> return -EINVAL;
> }
>
Reviewed-by: Patrice Chotard <patrice.chotard at st.com>
Thanks
More information about the U-Boot
mailing list