From patchwork Mon Oct 9 21:09:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aishwarya Pant X-Patchwork-Id: 9994339 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 27C3860216 for ; Mon, 9 Oct 2017 21:10:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17DC92003F for ; Mon, 9 Oct 2017 21:10:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CA9126CFF; Mon, 9 Oct 2017 21:10:03 +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 2E69728841 for ; Mon, 9 Oct 2017 21:10:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754485AbdJIVKA (ORCPT ); Mon, 9 Oct 2017 17:10:00 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:37795 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754108AbdJIVJ7 (ORCPT ); Mon, 9 Oct 2017 17:09:59 -0400 Received: by mail-pf0-f196.google.com with SMTP id z80so11928734pff.4; Mon, 09 Oct 2017 14:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=4qf50dFbI0cMIefO3PHD5jWS6Qbaq3YKlcYMPHbd3Ok=; b=scO6S4omUUVEAdFrcCXrILbsfdbiEP9MBMpDgnyRPG98IHhoOR1jiHsAnu+md9Sm2y yXQiCtmowwg9PG/ZXv1QRsFWTribndTswBBKfLo9PKE355aYkjl0U1VB8v12oDj10X+8 3/vSlNVzP0cPml0MS3sMirwK6JuNhrxTNDTwaRWZQ99IJ7WmW4ISrjzdu+d1XnoWblYd IhYAjJFIzmHNzmrmfi1pFtAXgj1S77nhVKu2t6WP7i9RR3t2w6/kFvKMS5WumQKexDAc qh17PRu5aTfDIpIncEPnfF1jbireyDGVXRyzfdRQvV0C6JgJSUhVR/4hlcea6gGg9uKL ofFQ== 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:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=4qf50dFbI0cMIefO3PHD5jWS6Qbaq3YKlcYMPHbd3Ok=; b=izGYEAMbrrEQhoI/4pmJrSbDGNQ7xt63Xv+V7k0kWRo1IL4YfGpnXeLoTr1/J5njZF NBqjcUhX9zOuYR0cpGfX1EEb0ECvTb1bLATPXD82VWR6TaYFtmJu6SMksC2U+GixQbzm a3GIHaUCMTdCtCPzqw25KYnDwxHQ68XORTVqA4UO8eIBhps5zfMp1tm8cXkYckZUpyli OE2C6SHyvTrp0+TYnsN9ehmvKM2NFjfUilonkizyUt5/vQ8eRnFE7Df0MU7+aUDx+Oho +lzCVVixWOdwLfkn70p84JzMhM3cpRfulPZ71CjWb35uX5GWYlqi/Hrp6P7c05B7Ag0y +zDA== X-Gm-Message-State: AMCzsaXwoIDeiQ0YJFa2mxRA8npB5H9aJ1wEiJS1dW0Er9jozXiM1k11 4Nsa8r7CZmrNjpoNzLHWoCY= X-Google-Smtp-Source: AOwi7QBg4B3Hnp52rG04q6OhlWnCBwdirBLxTQK+V3Piw9asR+iCt0Ngs8yyUFndBJMtL2OFGu/dfQ== X-Received: by 10.99.177.9 with SMTP id r9mr7527482pgf.194.1507583398521; Mon, 09 Oct 2017 14:09:58 -0700 (PDT) Received: from aishwarya ([122.179.25.150]) by smtp.gmail.com with ESMTPSA id 204sm16311371pgf.59.2017.10.09.14.09.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2017 14:09:58 -0700 (PDT) Date: Tue, 10 Oct 2017 02:39:54 +0530 From: Aishwarya Pant To: Sebastian Reichel , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: outreachy-kernel@googlegroups.com Subject: [PATCH] power: supply: replace pr_* with dev_* Message-ID: <20171009210954.5fdeimcmt35jbcoa@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 --- 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..4b57fa9779ae 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, "device: '%s': %s\n", dev_name(dev), __func__); kfree(psy); } diff --git a/drivers/power/supply/twl4030_charger.c b/drivers/power/supply/twl4030_charger.c index a5915f498eea..7ed2bc3039c4 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, "twl4030_bci: error reading BCIMSTATEC\n"); return ret; }