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 X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AB80C433E0 for ; Wed, 12 Aug 2020 16:10:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47C992076B for ; Wed, 12 Aug 2020 16:10:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726574AbgHLQKf (ORCPT ); Wed, 12 Aug 2020 12:10:35 -0400 Received: from smtprelay0182.hostedemail.com ([216.40.44.182]:51502 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726459AbgHLQKf (ORCPT ); Wed, 12 Aug 2020 12:10:35 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id C8DC01800119A; Wed, 12 Aug 2020 16:10:32 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: net16_4b0fdbe26fec X-Filterd-Recvd-Size: 2072 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA; Wed, 12 Aug 2020 16:10:31 +0000 (UTC) Message-ID: <6a424468eb61e2eb9b014817819dd4da61f2ada1.camel@perches.com> Subject: Re: [PATCH 35/44] staging: regulator: hi6421v600-regulator: add a driver-specific debug macro From: Joe Perches To: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Date: Wed, 12 Aug 2020 09:10:29 -0700 In-Reply-To: <7cb10b3910e9fa3e52d36e4e416030175cc761ab.1597247164.git.mchehab+huawei@kernel.org> References: <7cb10b3910e9fa3e52d36e4e416030175cc761ab.1597247164.git.mchehab+huawei@kernel.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-08-12 at 17:56 +0200, Mauro Carvalho Chehab wrote: > Using dev_dbg() is not too nice, as, instead of printing the > name of the regulator, it prints "regulator.", making > harder to associate what is happening with each ldo line. > > So, add a debug-specific macro, which will print the rdev's > name, just like the regulator core. Seems sensible, but trivially: > diff --git a/drivers/staging/hikey9xx/hi6421v600-regulator.c b/drivers/staging/hikey9xx/hi6421v600-regulator.c [] > @@ -209,10 +212,10 @@ static unsigned int hi6421_spmi_regulator_get_optimum_mode(struct regulator_dev > struct hi6421v600_regulator *sreg = rdev_get_drvdata(rdev); > > if (load_uA || ((unsigned int)load_uA > sreg->eco_uA)) { > - dev_dbg(&rdev->dev, "%s: normal mode", __func__); > + rdev_dbg(rdev, "normal mode"); > return REGULATOR_MODE_NORMAL; > } else { > - dev_dbg(&rdev->dev, "%s: idle mode", __func__); > + rdev_dbg(rdev, "idle mode"); missing terminating newlines 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 X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FDF5C433E0 for ; Wed, 12 Aug 2020 16:10:44 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CCF662076B for ; Wed, 12 Aug 2020 16:10:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCF662076B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4A3C320446; Wed, 12 Aug 2020 16:10:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JaHJBdhlymWa; Wed, 12 Aug 2020 16:10:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id D863720453; Wed, 12 Aug 2020 16:10:40 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id B95161BF4DD for ; Wed, 12 Aug 2020 16:10:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B609086A79 for ; Wed, 12 Aug 2020 16:10:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cQSBuE39zkaJ for ; Wed, 12 Aug 2020 16:10:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtprelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by fraxinus.osuosl.org (Postfix) with ESMTPS id E5F3286A73 for ; Wed, 12 Aug 2020 16:10:37 +0000 (UTC) Received: from smtprelay.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by smtpgrave06.hostedemail.com (Postfix) with ESMTP id 67F8580058F4 for ; Wed, 12 Aug 2020 16:10:35 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id C8DC01800119A; Wed, 12 Aug 2020 16:10:32 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: net16_4b0fdbe26fec X-Filterd-Recvd-Size: 2072 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA; Wed, 12 Aug 2020 16:10:31 +0000 (UTC) Message-ID: <6a424468eb61e2eb9b014817819dd4da61f2ada1.camel@perches.com> Subject: Re: [PATCH 35/44] staging: regulator: hi6421v600-regulator: add a driver-specific debug macro From: Joe Perches To: Mauro Carvalho Chehab Date: Wed, 12 Aug 2020 09:10:29 -0700 In-Reply-To: <7cb10b3910e9fa3e52d36e4e416030175cc761ab.1597247164.git.mchehab+huawei@kernel.org> References: <7cb10b3910e9fa3e52d36e4e416030175cc761ab.1597247164.git.mchehab+huawei@kernel.org> User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mauro.chehab@huawei.com, Greg Kroah-Hartman , devel@driverdev.osuosl.org, linuxarm@huawei.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Wed, 2020-08-12 at 17:56 +0200, Mauro Carvalho Chehab wrote: > Using dev_dbg() is not too nice, as, instead of printing the > name of the regulator, it prints "regulator.", making > harder to associate what is happening with each ldo line. > > So, add a debug-specific macro, which will print the rdev's > name, just like the regulator core. Seems sensible, but trivially: > diff --git a/drivers/staging/hikey9xx/hi6421v600-regulator.c b/drivers/staging/hikey9xx/hi6421v600-regulator.c [] > @@ -209,10 +212,10 @@ static unsigned int hi6421_spmi_regulator_get_optimum_mode(struct regulator_dev > struct hi6421v600_regulator *sreg = rdev_get_drvdata(rdev); > > if (load_uA || ((unsigned int)load_uA > sreg->eco_uA)) { > - dev_dbg(&rdev->dev, "%s: normal mode", __func__); > + rdev_dbg(rdev, "normal mode"); > return REGULATOR_MODE_NORMAL; > } else { > - dev_dbg(&rdev->dev, "%s: idle mode", __func__); > + rdev_dbg(rdev, "idle mode"); missing terminating newlines _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel