From patchwork Fri Sep 25 15:54:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Dannenberg X-Patchwork-Id: 7266021 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2F471BEEC1 for ; Fri, 25 Sep 2015 15:55:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 57D1020B80 for ; Fri, 25 Sep 2015 15:55:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 567EA20B7D for ; Fri, 25 Sep 2015 15:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932513AbbIYPzd (ORCPT ); Fri, 25 Sep 2015 11:55:33 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:52679 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932392AbbIYPzc (ORCPT ); Fri, 25 Sep 2015 11:55:32 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8PFslkp004953; Fri, 25 Sep 2015 10:54:47 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8PFslMg006706; Fri, 25 Sep 2015 10:54:47 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Fri, 25 Sep 2015 10:54:47 -0500 Received: from beast.tx.rr.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8PFsRVK013641; Fri, 25 Sep 2015 10:54:44 -0500 From: Andreas Dannenberg To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Laurentiu Palcu , Krzysztof Kozlowski CC: Ramakrishna Pallala , , , , Andreas Dannenberg Subject: [PATCH v7 05/15] power: bq24257: Simplify bq24257_power_supply_init() Date: Fri, 25 Sep 2015 10:54:10 -0500 Message-ID: <1443196460-26156-6-git-send-email-dannenberg@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443196460-26156-1-git-send-email-dannenberg@ti.com> References: <1443196460-26156-1-git-send-email-dannenberg@ti.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Eliminate a few lines of code by using the PTR_ERR_OR_ZERO() macro. Signed-off-by: Andreas Dannenberg Reviewed-by: Krzysztof Kozlowski --- drivers/power/bq24257_charger.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/power/bq24257_charger.c b/drivers/power/bq24257_charger.c index 6757b41..060f754 100644 --- a/drivers/power/bq24257_charger.c +++ b/drivers/power/bq24257_charger.c @@ -594,10 +594,7 @@ static int bq24257_power_supply_init(struct bq24257_device *bq) &bq24257_power_supply_desc, &psy_cfg); - if (IS_ERR(bq->charger)) - return PTR_ERR(bq->charger); - - return 0; + return PTR_ERR_OR_ZERO(bq->charger); } static int bq24257_pg_gpio_probe(struct bq24257_device *bq)