From patchwork Tue Oct 10 14:39:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aishwarya Pant X-Patchwork-Id: 9996323 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4E4AC603B5 for ; Tue, 10 Oct 2017 14:39:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 351CC25EA6 for ; Tue, 10 Oct 2017 14:39:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28A8527F94; Tue, 10 Oct 2017 14:39:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A28A25EA6 for ; Tue, 10 Oct 2017 14:39:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751433AbdJJOjY (ORCPT ); Tue, 10 Oct 2017 10:39:24 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:37246 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbdJJOjY (ORCPT ); Tue, 10 Oct 2017 10:39:24 -0400 Received: by mail-pf0-f194.google.com with SMTP id z80so17603685pff.4; Tue, 10 Oct 2017 07:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=Skq5vVn3LUNlhZlLh+QX12ec/BwxKmHIiVVvUkaN4Ao=; b=bPnUsAvmyrddnWr1qccLrLlCpwqel/Rk4FpwcaTZ5aVfCex1UJEtxwJ5de9zStK3Dc kRLOc5rPd7XbrGFx9Ws2mEFt8kunF9ggpWEfwpbbenuOzOqx9Xd5S6azYAKHn63/O+Rg PwpJUOUQqBH+lRvU3qsv7oAySWClnX40Mqofl3IvIYYmXumKkk3AtMDPxBdN3ankuGAT jJIeto1F+Z8ewHXMSQPrQ36xIUrmRXf7sihditIoiOUfUGNLvzohbQvqN4Pkg/l1TwgJ oJaIT6RxrHhkP6jYGn1aMwns8/X9lOJLvqAAGnUeBki+zznC09MdE6aNe4VC3o0s5wq2 t4Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=Skq5vVn3LUNlhZlLh+QX12ec/BwxKmHIiVVvUkaN4Ao=; b=VXiqjc595bOVD+C7/mc2KtiE7CjQodoEixdTWMuQQSoxneBvslWqPUwe22hnIGRQr3 YkJ2oPgqQ/OnhYHcjPvHGFAfPb06MXnpPxivUb6HsreYHO+Q3zRN709U+uECJk7SAZzn lczgFQSvLcBu5KTSAwRPIoJpoD7k7rVui5Hlt2cpewgroJHEGux2j7u2xFuYyNn6h8rx vhpuwF+sCNUOdnIOPlbuB34HrwWtiIuuiodPxZ+E63bk9rdLyRTiCfN7DOabcBjAF9Ij cztnIn6ZWuPT3LyGbFDRBevFX76rP/cr5WDeFHRJo1ZU0dvE+xf29Hs6o0kXblYRKLlp jTyw== X-Gm-Message-State: AMCzsaV+V5Zrnn33e2hgFqPWxwiVpGm2Cb8i+iE7wz0jtrQC6M3lZiH8 7nkyQDrQwmGjzxtOBhBd8gk= X-Google-Smtp-Source: AOwi7QCFScCnDOy2Coyjux8FZViwwQ3YBcyc4eog9U9UY5eudHuqIM30oPM0yk3KrgYwtno1jsSvzA== X-Received: by 10.98.34.85 with SMTP id i82mr13523250pfi.111.1507646363373; Tue, 10 Oct 2017 07:39:23 -0700 (PDT) Received: from aishwarya ([122.167.38.67]) by smtp.gmail.com with ESMTPSA id z8sm22712604pfl.135.2017.10.10.07.39.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2017 07:39:22 -0700 (PDT) Date: Tue, 10 Oct 2017 20:09:18 +0530 From: Aishwarya Pant To: Sebastian Reichel , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] power: supply: replace pr_* with dev_* Message-ID: <20171010143918.5wl2h7gvyopuinv5@aishwarya> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use kernel preferred dev_* family of functions in place of pr_*, wherever a device object is present. Done with the help of coccinelle. Signed-off-by: Aishwarya Pant --- Changes in v2: - Remove device name from log message as it is already present in the dev_* functions The following cocci script was used to make the patch: @r exists@ identifier f, s, x; position p; @@ f(..., struct s *x,...) { <+... when != x == NULL \(pr_err@p\|pr_debug@p\|pr_info@p\|pr_warn@p\)(...); ...+> } @struc@ identifier dev, r.s; @@ struct s { ... struct device *dev; ... }; @@ identifier r.x, struc.dev; position r.p; @@ ( - pr_err@p + dev_err | - pr_warn@p + dev_warn | - pr_info@p + dev_info | - pr_debug@p + dev_dbg ) ( + x->dev, ...) @rr exists@ local idexpression struct device *dev; @@ <+... dev ...+> ( - pr_err + dev_err | - pr_info + dev_info | - pr_warn + dev_warn | - pr_debug + dev_dbg ) ( + dev, ...) --- drivers/power/supply/power_supply_core.c | 2 +- drivers/power/supply/twl4030_charger.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 02c6340ae36f..82f998ab5a52 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -669,7 +669,7 @@ EXPORT_SYMBOL_GPL(power_supply_powers); static void power_supply_dev_release(struct device *dev) { struct power_supply *psy = container_of(dev, struct power_supply, dev); - pr_debug("device: '%s': %s\n", dev_name(dev), __func__); + dev_dbg(dev, "%s\n", __func__); kfree(psy); } diff --git a/drivers/power/supply/twl4030_charger.c b/drivers/power/supply/twl4030_charger.c index a5915f498eea..bbcaee56db9d 100644 --- a/drivers/power/supply/twl4030_charger.c +++ b/drivers/power/supply/twl4030_charger.c @@ -743,7 +743,7 @@ static int twl4030bci_state(struct twl4030_bci *bci) ret = twl4030_bci_read(TWL4030_BCIMSTATEC, &state); if (ret) { - pr_err("twl4030_bci: error reading BCIMSTATEC\n"); + dev_err(bci->dev, "error reading BCIMSTATEC\n"); return ret; }