From patchwork Mon Sep 28 22:33:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Dannenberg X-Patchwork-Id: 7281351 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5687D9F39B for ; Mon, 28 Sep 2015 22:35:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F94620734 for ; Mon, 28 Sep 2015 22:35:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67A6D2074E for ; Mon, 28 Sep 2015 22:35:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754132AbbI1WfE (ORCPT ); Mon, 28 Sep 2015 18:35:04 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:55611 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753755AbbI1WfB (ORCPT ); Mon, 28 Sep 2015 18:35:01 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8SMYLwY029508; Mon, 28 Sep 2015 17:34:21 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8SMYL6A021310; Mon, 28 Sep 2015 17:34:21 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Mon, 28 Sep 2015 17:34:22 -0500 Received: from beast.tx.rr.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8SMY56D026609; Mon, 28 Sep 2015 17:34:19 -0500 From: Andreas Dannenberg To: Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Laurentiu Palcu , Krzysztof Kozlowski CC: Ramakrishna Pallala , , , , Andreas Dannenberg Subject: [PATCH v8 04/14] power: bq24257: Simplify bq24257_power_supply_init() Date: Mon, 28 Sep 2015 17:33:52 -0500 Message-ID: <1443479642-23712-5-git-send-email-dannenberg@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1443479642-23712-1-git-send-email-dannenberg@ti.com> References: <1443479642-23712-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, T_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)