From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3C41C433F5 for ; Sun, 21 Nov 2021 19:16:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8231F83433; Sun, 21 Nov 2021 20:16:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AbPO9ldN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 43F628347C; Sun, 21 Nov 2021 20:16:09 +0100 (CET) Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 93E59833C2 for ; Sun, 21 Nov 2021 20:16:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qt1-x829.google.com with SMTP id f20so14589318qtb.4 for ; Sun, 21 Nov 2021 11:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=p5PJ8449ez4mQZDXRvtsQAx2zBL/ji0eJaVTfRsyiFc=; b=AbPO9ldNdwchRiVkAdWhMl0QZhsEP9BQW/eH+e+Kz1iBJln66TqM4bqUewZo3HRAh/ DKNnbbCmvVsU7N/DPZWuCZJiO+RRDtZwhuXtLVcNAhNUBLX/xB+PLPdTcr2XtB08v5h0 HsMnfg70QLD6m1FZQIoOCWa9dUa9fm4RiuGcf5vS+PQDh92kyOBwFIUN2vVbi7g37kkn nwkP5iZ+27UyXOZGdtXkhYc2Z39jM2aMZwu62ZWBuzFJJrWQsu0ESg3AQA+/VCgXCPQf A0SJJ/f2GO/VYFFpEGfDa58zYLkUaze/W5OzqQki3osxNuv/4NpmRkx2sZaWJYU5zMZL /TEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=p5PJ8449ez4mQZDXRvtsQAx2zBL/ji0eJaVTfRsyiFc=; b=31zk0fvQe1nWkiF1IfZaWLdGTy89prUimeR98OsPH1iUywTAyi+tghrywbziutmyBr q4mosCPrnWcSrk7boJiEdS3bRtMN11vSgIazTMR2lMsQysDp9XzxHlUQqAqOp5bM0BBj uS9DPELu8hrBs2L4j5Lq6nfej+4HHTJ3grzQtzRwJff9X57J7e0Bk6XlAl9mkvYoqIaD R8Ky1rxismrUMQizBgCI43bHRteC9Lbe5MmgKmmliQtIv9YS1LR/9TeKjEwWswlhGK+r JdieZ1vqtmC/sRLisTUOM3P3WHmj4riXke0+7G1h+Ed578eIi7hvwGFnZqmC8HYTNCeL XZxw== X-Gm-Message-State: AOAM533+Sswg6Tjk1irjKxtEE9FOu6SREIE8P44KTtDAZLuV5aK1gofR Xgry68sa5P0sNtjyJd6XBFYUrv8gv6s= X-Google-Smtp-Source: ABdhPJwFSu80vfUOQCHh9BaFUs5D8Q4O+9ivzIMK+ik7IWGw22ahgdViIJFRTIJWG+d1Gu2WtLS0UA== X-Received: by 2002:a05:622a:2d1:: with SMTP id a17mr24608752qtx.130.1637522163478; Sun, 21 Nov 2021 11:16:03 -0800 (PST) Received: from [192.168.1.201] (pool-108-18-207-184.washdc.fios.verizon.net. [108.18.207.184]) by smtp.googlemail.com with ESMTPSA id 9sm3239838qkm.5.2021.11.21.11.16.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 Nov 2021 11:16:03 -0800 (PST) Subject: Re: [PATCH 2/2] clk: define LOG_CATEGORY for generic and ccf clocks To: Patrick Delaunay , u-boot@lists.denx.de Cc: Lukasz Majewski , U-Boot STM32 References: <20211119151203.1.I011e780560149e15eea06471822a1fedfac58766@changeid> <20211119151203.2.Ieb1b1a0cf6385c2ce53b33a6d925c0abc3aebfa0@changeid> From: Sean Anderson Message-ID: Date: Sun, 21 Nov 2021 14:16:02 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20211119151203.2.Ieb1b1a0cf6385c2ce53b33a6d925c0abc3aebfa0@changeid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On 11/19/21 9:12 AM, Patrick Delaunay wrote: > Define LOG_CATEGORY to allow filtering with log command > for generic clock and CCF clocks. > > This patch also change existing printf, debug and pr_ macro > to log_ or dev_ macro. > > Signed-off-by: Patrick Delaunay > --- > > drivers/clk/clk-composite.c | 3 +++ > drivers/clk/clk-divider.c | 6 +++++- > drivers/clk/clk-fixed-factor.c | 4 ++++ > drivers/clk/clk-gate.c | 6 +++++- > drivers/clk/clk-mux.c | 8 ++++++-- > drivers/clk/clk.c | 18 ++++++++++-------- > drivers/clk/clk_fixed_factor.c | 3 +++ > drivers/clk/clk_fixed_rate.c | 3 +++ > 8 files changed, 39 insertions(+), 12 deletions(-) > > diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c > index 12288e10b3..6eb2b8133a 100644 > --- a/drivers/clk/clk-composite.c > +++ b/drivers/clk/clk-composite.c > @@ -4,9 +4,12 @@ > * Copyright 2019 NXP > */ > > +#define LOG_CATEGORY UCLASS_CLK > + > #include > #include > #include > +#include > #include > #include > #include > diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c > index 9df50a5e72..7e8e62feee 100644 > --- a/drivers/clk/clk-divider.c > +++ b/drivers/clk/clk-divider.c > @@ -9,14 +9,18 @@ > * > */ > > +#define LOG_CATEGORY UCLASS_CLK > + > #include > #include > #include > #include > +#include > #include > #include > #include > #include > +#include > #include > #include > #include > @@ -190,7 +194,7 @@ static struct clk *_register_divider(struct device *dev, const char *name, > > if (clk_divider_flags & CLK_DIVIDER_HIWORD_MASK) { > if (width + shift > 16) { > - pr_warn("divider value exceeds LOWORD field\n"); > + dev_warn(dev, "divider value exceeds LOWORD field\n"); > return ERR_PTR(-EINVAL); > } > } > diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c > index 9fcf30fd2e..2a446788e1 100644 > --- a/drivers/clk/clk-fixed-factor.c > +++ b/drivers/clk/clk-fixed-factor.c > @@ -5,10 +5,14 @@ > * > * Copyright (C) 2011 Sascha Hauer, Pengutronix > */ > + > +#define LOG_CATEGORY UCLASS_CLK > + > #include > #include > #include > #include > +#include > #include > #include > #include > diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c > index 708499d95a..aa40daf3d7 100644 > --- a/drivers/clk/clk-gate.c > +++ b/drivers/clk/clk-gate.c > @@ -7,12 +7,16 @@ > * Gated clock implementation > */ > > +#define LOG_CATEGORY UCLASS_CLK > + > #include > #include > +#include > #include > #include > #include > #include > +#include > #include > #include > #include > @@ -124,7 +128,7 @@ struct clk *clk_register_gate(struct device *dev, const char *name, > > if (clk_gate_flags & CLK_GATE_HIWORD_MASK) { > if (bit_idx > 15) { > - pr_err("gate bit exceeds LOWORD field\n"); > + dev_err(dev, "gate bit exceeds LOWORD field\n"); > return ERR_PTR(-EINVAL); > } > } > diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c > index fd746f2de3..b49946fbcd 100644 > --- a/drivers/clk/clk-mux.c > +++ b/drivers/clk/clk-mux.c > @@ -21,12 +21,16 @@ > * clock. > */ > > +#define LOG_CATEGORY UCLASS_CLK > + > #include > #include > #include > +#include > #include > #include > #include > +#include > #include > #include > #include > @@ -124,7 +128,7 @@ static int clk_mux_set_parent(struct clk *clk, struct clk *parent) > > index = clk_fetch_parent_index(clk, parent); > if (index < 0) { > - printf("Could not fetch index\n"); > + log_err("Could not fetch index\n"); > return index; > } > > @@ -170,7 +174,7 @@ struct clk *clk_hw_register_mux_table(struct device *dev, const char *name, > if (clk_mux_flags & CLK_MUX_HIWORD_MASK) { > width = fls(mask) - ffs(mask) + 1; > if (width + shift > 16) { > - pr_err("mux value exceeds LOWORD field\n"); > + dev_err(dev, "mux value exceeds LOWORD field\n"); > return ERR_PTR(-EINVAL); > } > } > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > index d1a9787071..eff0fa134f 100644 > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -4,6 +4,8 @@ > * Lukasz Majewski, DENX Software Engineering, lukma@denx.de > */ > > +#define LOG_CATEGORY UCLASS_CLK > + > #include > #include > #include > @@ -22,24 +24,24 @@ int clk_register(struct clk *clk, const char *drv_name, > > ret = uclass_get_device_by_name(UCLASS_CLK, parent_name, &parent); > if (ret) { > - printf("%s: failed to get %s device (parent of %s)\n", > - __func__, parent_name, name); > + log_err("%s: failed to get %s device (parent of %s)\n", > + __func__, parent_name, name); > } else { > - debug("%s: name: %s parent: %s [0x%p]\n", __func__, name, > - parent->name, parent); > + log_debug("%s: name: %s parent: %s [0x%p]\n", __func__, name, > + parent->name, parent); > } > > drv = lists_driver_lookup_name(drv_name); > if (!drv) { > - printf("%s: %s is not a valid driver name\n", > - __func__, drv_name); > + log_err("%s: %s is not a valid driver name\n", > + __func__, drv_name); > return -ENOENT; > } > > ret = device_bind(parent, drv, name, NULL, ofnode_null(), &clk->dev); > if (ret) { > - printf("%s: CLK: %s driver bind error [%d]!\n", __func__, name, > - ret); > + log_err("%s: CLK: %s driver bind error [%d]!\n", __func__, name, > + ret); > return ret; > } > > diff --git a/drivers/clk/clk_fixed_factor.c b/drivers/clk/clk_fixed_factor.c > index 41b0d9c060..6c1139e5c5 100644 > --- a/drivers/clk/clk_fixed_factor.c > +++ b/drivers/clk/clk_fixed_factor.c > @@ -5,10 +5,13 @@ > * Author: Anup Patel > */ > > +#define LOG_CATEGORY UCLASS_CLK > + > #include > #include > #include > #include > +#include > #include > > struct clk_fixed_factor { > diff --git a/drivers/clk/clk_fixed_rate.c b/drivers/clk/clk_fixed_rate.c > index c5a2a42c92..b5e78c7055 100644 > --- a/drivers/clk/clk_fixed_rate.c > +++ b/drivers/clk/clk_fixed_rate.c > @@ -3,9 +3,12 @@ > * Copyright (C) 2016 Masahiro Yamada > */ > > +#define LOG_CATEGORY UCLASS_CLK > + > #include > #include > #include > +#include > #include > #include > > Reviewed-by: Sean Anderson