Re: [U-Boot] [PATCH] mmc: use pr_* log functions
On 01/28/2018 07:11 PM, Masahiro Yamada wrote: > Use pr_* log functions from Linux. They can be enabled/disabled > via CONFIG_LOGLEVEL. > > Signed-off-by: Masahiro Yamada Applied to u-boot-mmc. Thanks! Best Regards, Jaehoon Chung > --- > > drivers/mmc/mmc.c | 68 > +++ > 1 file changed, 34 insertions(+), 34 deletions(-) > > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c > index 255310a..3a2e3b3 100644 > --- a/drivers/mmc/mmc.c > +++ b/drivers/mmc/mmc.c > @@ -213,8 +213,8 @@ static int mmc_select_mode(struct mmc *mmc, enum bus_mode > mode) > mmc->selected_mode = mode; > mmc->tran_speed = mmc_mode2freq(mmc, mode); > mmc->ddr_mode = mmc_is_mode_ddr(mode); > - debug("selecting mode %s (freq : %d MHz)\n", mmc_mode_name(mode), > - mmc->tran_speed / 100); > + pr_debug("selecting mode %s (freq : %d MHz)\n", mmc_mode_name(mode), > + mmc->tran_speed / 100); > return 0; > } > > @@ -457,7 +457,7 @@ ulong mmc_bread(struct blk_desc *block_dev, lbaint_t > start, lbaint_t blkcnt, > } > > if (mmc_set_blocklen(mmc, mmc->read_bl_len)) { > - debug("%s: Failed to set blocklen\n", __func__); > + pr_debug("%s: Failed to set blocklen\n", __func__); > return 0; > } > > @@ -465,7 +465,7 @@ ulong mmc_bread(struct blk_desc *block_dev, lbaint_t > start, lbaint_t blkcnt, > cur = (blocks_todo > mmc->cfg->b_max) ? > mmc->cfg->b_max : blocks_todo; > if (mmc_read_blocks(mmc, dst, start, cur) != cur) { > - debug("%s: Failed to read blocks\n", __func__); > + pr_debug("%s: Failed to read blocks\n", __func__); > return 0; > } > blocks_todo -= cur; > @@ -900,11 +900,11 @@ static int mmc_boot_part_access_chk(struct mmc *mmc, > unsigned int part_num) > forbidden = MMC_CAP(MMC_HS_200); > > if (MMC_CAP(mmc->selected_mode) & forbidden) { > - debug("selected mode (%s) is forbidden for part %d\n", > - mmc_mode_name(mmc->selected_mode), part_num); > + pr_debug("selected mode (%s) is forbidden for part %d\n", > + mmc_mode_name(mmc->selected_mode), part_num); > change = true; > } else if (mmc->selected_mode != mmc->best_mode) { > - debug("selected mode is not optimal\n"); > + pr_debug("selected mode is not optimal\n"); > change = true; > } > > @@ -1427,7 +1427,7 @@ retry_ssr: > mmc->ssr.erase_offset = eo * 1000; > } > } else { > - debug("Invalid Allocation Unit Size.\n"); > + pr_debug("Invalid Allocation Unit Size.\n"); > } > > return 0; > @@ -1532,18 +1532,18 @@ void mmc_dump_capabilities(const char *text, uint > caps) > { > enum bus_mode mode; > > - printf("%s: widths [", text); > + pr_debug("%s: widths [", text); > if (caps & MMC_MODE_8BIT) > - printf("8, "); > + pr_debug("8, "); > if (caps & MMC_MODE_4BIT) > - printf("4, "); > + pr_debug("4, "); > if (caps & MMC_MODE_1BIT) > - printf("1, "); > - printf("\b\b] modes ["); > + pr_debug("1, "); > + pr_debug("\b\b] modes ["); > for (mode = MMC_LEGACY; mode < MMC_MODES_END; mode++) > if (MMC_CAP(mode) & caps) > - printf("%s, ", mmc_mode_name(mode)); > - printf("\b\b]\n"); > + pr_debug("%s, ", mmc_mode_name(mode)); > + pr_debug("\b\b]\n"); > } > #endif > > @@ -1577,7 +1577,7 @@ static int mmc_set_signal_voltage(struct mmc *mmc, uint > signal_voltage) > mmc->signal_voltage = signal_voltage; > err = mmc_set_ios(mmc); > if (err) > - debug("unable to set voltage (err %d)\n", err); > + pr_debug("unable to set voltage (err %d)\n", err); > > return err; > } > @@ -1660,10 +1660,10 @@ static int sd_select_mode_and_width(struct mmc *mmc, > uint card_caps) > > for (w = widths; w < widths + ARRAY_SIZE(widths); w++) { > if (*w & caps & mwt->widths) { > - debug("trying mode %s width %d (at %d MHz)\n", > - mmc_mode_name(mwt->mode), > - bus_width(*w), > - mmc_mode2freq(mmc, mwt->mode) / 100); > + pr_debug("trying mode %s width %d (at %d > MHz)\n", > + mmc_mode_name(mwt->mode), > + bus_width(*w), > + mmc_mode2freq(mmc, mwt->mode) / > 100); > > /* configure the bus width (card + host) */ >
Re: [U-Boot] [PATCH] mmc: use pr_* log functions
On 01/28/2018 07:11 PM, Masahiro Yamada wrote: > Use pr_* log functions from Linux. They can be enabled/disabled > via CONFIG_LOGLEVEL. > > Signed-off-by: Masahiro Yamada Reviewed-by: Jaehoon Chung Best Regards, Jaehoon Chung > --- > > drivers/mmc/mmc.c | 68 > +++ > 1 file changed, 34 insertions(+), 34 deletions(-) > > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c > index 255310a..3a2e3b3 100644 > --- a/drivers/mmc/mmc.c > +++ b/drivers/mmc/mmc.c > @@ -213,8 +213,8 @@ static int mmc_select_mode(struct mmc *mmc, enum bus_mode > mode) > mmc->selected_mode = mode; > mmc->tran_speed = mmc_mode2freq(mmc, mode); > mmc->ddr_mode = mmc_is_mode_ddr(mode); > - debug("selecting mode %s (freq : %d MHz)\n", mmc_mode_name(mode), > - mmc->tran_speed / 100); > + pr_debug("selecting mode %s (freq : %d MHz)\n", mmc_mode_name(m ___ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
Re: [U-Boot] [PATCH] mmc: use pr_* log functions
On Sun, 28 Jan 2018 19:11:42 +0900 Masahiro Yamada wrote: > Use pr_* log functions from Linux. They can be enabled/disabled > via CONFIG_LOGLEVEL. > > Signed-off-by: Masahiro Yamada > --- > > drivers/mmc/mmc.c | 68 > +++ 1 file > changed, 34 insertions(+), 34 deletions(-) > > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c > index 255310a..3a2e3b3 100644 > --- a/drivers/mmc/mmc.c > +++ b/drivers/mmc/mmc.c > @@ -213,8 +213,8 @@ static int mmc_select_mode(struct mmc *mmc, enum > bus_mode mode) mmc->selected_mode = mode; > mmc->tran_speed = mmc_mode2freq(mmc, mode); > mmc->ddr_mode = mmc_is_mode_ddr(mode); > - debug("selecting mode %s (freq : %d MHz)\n", > mmc_mode_name(mode), > - mmc->tran_speed / 100); > + pr_debug("selecting mode %s (freq : %d MHz)\n", > mmc_mode_name(mode), > + mmc->tran_speed / 100); > return 0; > } > > @@ -457,7 +457,7 @@ ulong mmc_bread(struct blk_desc *block_dev, > lbaint_t start, lbaint_t blkcnt, } > > if (mmc_set_blocklen(mmc, mmc->read_bl_len)) { > - debug("%s: Failed to set blocklen\n", __func__); > + pr_debug("%s: Failed to set blocklen\n", __func__); > return 0; > } > > @@ -465,7 +465,7 @@ ulong mmc_bread(struct blk_desc *block_dev, > lbaint_t start, lbaint_t blkcnt, cur = (blocks_todo > > mmc->cfg->b_max) ? mmc->cfg->b_max : blocks_todo; > if (mmc_read_blocks(mmc, dst, start, cur) != cur) { > - debug("%s: Failed to read blocks\n", > __func__); > + pr_debug("%s: Failed to read blocks\n", > __func__); return 0; > } > blocks_todo -= cur; > @@ -900,11 +900,11 @@ static int mmc_boot_part_access_chk(struct mmc > *mmc, unsigned int part_num) forbidden = MMC_CAP(MMC_HS_200); > > if (MMC_CAP(mmc->selected_mode) & forbidden) { > - debug("selected mode (%s) is forbidden for part > %d\n", > - mmc_mode_name(mmc->selected_mode), part_num); > + pr_debug("selected mode (%s) is forbidden for part > %d\n", > + mmc_mode_name(mmc->selected_mode), > part_num); change = true; > } else if (mmc->selected_mode != mmc->best_mode) { > - debug("selected mode is not optimal\n"); > + pr_debug("selected mode is not optimal\n"); > change = true; > } > > @@ -1427,7 +1427,7 @@ retry_ssr: > mmc->ssr.erase_offset = eo * 1000; > } > } else { > - debug("Invalid Allocation Unit Size.\n"); > + pr_debug("Invalid Allocation Unit Size.\n"); > } > > return 0; > @@ -1532,18 +1532,18 @@ void mmc_dump_capabilities(const char *text, > uint caps) { > enum bus_mode mode; > > - printf("%s: widths [", text); > + pr_debug("%s: widths [", text); > if (caps & MMC_MODE_8BIT) > - printf("8, "); > + pr_debug("8, "); > if (caps & MMC_MODE_4BIT) > - printf("4, "); > + pr_debug("4, "); > if (caps & MMC_MODE_1BIT) > - printf("1, "); > - printf("\b\b] modes ["); > + pr_debug("1, "); > + pr_debug("\b\b] modes ["); > for (mode = MMC_LEGACY; mode < MMC_MODES_END; mode++) > if (MMC_CAP(mode) & caps) > - printf("%s, ", mmc_mode_name(mode)); > - printf("\b\b]\n"); > + pr_debug("%s, ", mmc_mode_name(mode)); > + pr_debug("\b\b]\n"); > } > #endif > > @@ -1577,7 +1577,7 @@ static int mmc_set_signal_voltage(struct mmc > *mmc, uint signal_voltage) mmc->signal_voltage = signal_voltage; > err = mmc_set_ios(mmc); > if (err) > - debug("unable to set voltage (err %d)\n", err); > + pr_debug("unable to set voltage (err %d)\n", err); > > return err; > } > @@ -1660,10 +1660,10 @@ static int sd_select_mode_and_width(struct > mmc *mmc, uint card_caps) > for (w = widths; w < widths + ARRAY_SIZE(widths); > w++) { if (*w & caps & mwt->widths) { > - debug("trying mode %s width %d (at > %d MHz)\n", > - mmc_mode_name(mwt->mode), > - bus_width(*w), > - mmc_mode2freq(mmc, > mwt->mode) / 100); > + pr_debug("trying mode %s width %d > (at %d MHz)\n", > + mmc_mode_name(mwt->mode), > + bus_width(*w), > + mmc_mode2freq(mmc, > mwt->mode) / 100); > /* configure the bus width (card + > host) */ err = sd_select_bus_width(mmc, bus_width(*w)); > @@ -1686,7 +1686,7 @@ static int sd_select_mode_and_width(struct mmc > *mmc, uint card_caps) err = mmc_execute_tuning(mmc, >