From patchwork Mon Jun 29 15:31:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 50421 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A2245228D9 for ; Mon, 29 Jun 2015 15:36:35 +0000 (UTC) Received: by wiwz6 with SMTP id z6sf2565380wiw.0 for ; Mon, 29 Jun 2015 08:36:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=FMav3VCRKe8e4qL3xqzTgO2LZszAu0pwE8aA2H3ArQI=; b=iWVhTnN6M9GoncEJfQKRkbyr01HF9kSj4Qtcb9MAA3A04v/czndV7ku21zL497lpC8 RTAmuCykrnkP4YtbxpBYiNomprTdBi2B89AM7jgcMi+zK8Uk2yB1zYXdFAivf9Lg3GNu tcs7apc0wBnCb+Jw1JoyuKkSQqPfUEu5L45ZD4U/wA8S/6Q1OSmgfHzn75HibYAxK39S UgWINO6XMbFyhhsO/pgWMm5XS0JJ/oerlySE8Heb/tMbmlBKHMakuAh5itlHei6rQlDl v46xFi0OSFaq5wcC+pWAGMup3CU7XpeWxgiXPea54bHsWey5q7S4wqxTU4JMjpS+D94I ATOw== X-Gm-Message-State: ALoCoQkfeeDPj4bL6Lt7y/xmuYyjd+JvwPn83GaWSrUYPADYxa11STVMy2plzFvF/CUCtWM01Vkv X-Received: by 10.112.142.67 with SMTP id ru3mr11158834lbb.1.1435592194757; Mon, 29 Jun 2015 08:36:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.168 with SMTP id kz8ls644753lac.105.gmail; Mon, 29 Jun 2015 08:36:34 -0700 (PDT) X-Received: by 10.152.23.4 with SMTP id i4mr14705905laf.51.1435592194408; Mon, 29 Jun 2015 08:36:34 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id w14si23067384laz.61.2015.06.29.08.36.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2015 08:36:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lagx9 with SMTP id x9so130355993lag.1 for ; Mon, 29 Jun 2015 08:36:33 -0700 (PDT) X-Received: by 10.112.220.7 with SMTP id ps7mr14651035lbc.72.1435592193469; Mon, 29 Jun 2015 08:36:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1789169lbb; Mon, 29 Jun 2015 08:36:32 -0700 (PDT) X-Received: by 10.66.194.201 with SMTP id hy9mr33600829pac.140.1435592191623; Mon, 29 Jun 2015 08:36:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az13si65021633pdb.212.2015.06.29.08.36.30; Mon, 29 Jun 2015 08:36:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753429AbbF2Pg1 (ORCPT + 8 others); Mon, 29 Jun 2015 11:36:27 -0400 Received: from mail-pd0-f171.google.com ([209.85.192.171]:36245 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753290AbbF2PgQ (ORCPT ); Mon, 29 Jun 2015 11:36:16 -0400 Received: by pdcu2 with SMTP id u2so118737837pdc.3 for ; Mon, 29 Jun 2015 08:36:16 -0700 (PDT) X-Received: by 10.68.224.35 with SMTP id qz3mr32969120pbc.165.1435592176084; Mon, 29 Jun 2015 08:36:16 -0700 (PDT) Received: from localhost.localdomain ([202.62.77.106]) by mx.google.com with ESMTPSA id fq2sm2772621pdb.35.2015.06.29.08.36.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Jun 2015 08:36:15 -0700 (PDT) From: Vaibhav Hiremath To: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org, robh+dt@kernel.org, sameo@linux.intel.com, lee.jones@linaro.org, linux-kernel@vger.kernel.org, yizhang@marvell.com, Vaibhav Hiremath Subject: [PATCH-V5 2/4] mfd: 88pm800: Remove unnecessary protection around pdata Date: Mon, 29 Jun 2015 21:01:15 +0530 Message-Id: <1435591877-18214-3-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1435591877-18214-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1435591877-18214-1-git-send-email-vaibhav.hiremath@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vaibhav.hiremath@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , With addition of proper checks in place in pm800_probe function, which makes sure that pdata would never become NULL. So remove all unnecessary protection around pdata in whole driver code. Signed-off-by: Vaibhav Hiremath Acked-by: Lee Jones --- drivers/mfd/88pm800.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c index 40fd014..d495737 100644 --- a/drivers/mfd/88pm800.c +++ b/drivers/mfd/88pm800.c @@ -302,7 +302,7 @@ static int device_gpadc_init(struct pm80x_chip *chip, mask = (PM800_GPADC_GP_BIAS_EN0 | PM800_GPADC_GP_BIAS_EN1 | PM800_GPADC_GP_BIAS_EN2 | PM800_GPADC_GP_BIAS_EN3); - if (pdata && (pdata->batt_det == 0)) + if (pdata->batt_det == 0) data = (PM800_GPADC_GP_BIAS_EN0 | PM800_GPADC_GP_BIAS_EN1 | PM800_GPADC_GP_BIAS_EN2 | PM800_GPADC_GP_BIAS_EN3); else @@ -342,11 +342,9 @@ static int device_rtc_init(struct pm80x_chip *chip, { int ret; - if (pdata) { - rtc_devs[0].platform_data = pdata->rtc; - rtc_devs[0].pdata_size = - pdata->rtc ? sizeof(struct pm80x_rtc_pdata) : 0; - } + rtc_devs[0].platform_data = pdata->rtc; + rtc_devs[0].pdata_size = pdata->rtc ? sizeof(struct pm80x_rtc_pdata) : 0; + ret = mfd_add_devices(chip->dev, 0, &rtc_devs[0], ARRAY_SIZE(rtc_devs), NULL, 0, NULL); if (ret) { @@ -503,7 +501,7 @@ static int device_800_init(struct pm80x_chip *chip, goto out; } if (val & PM800_ALARM_WAKEUP) { - if (pdata && pdata->rtc) + if (pdata->rtc) pdata->rtc->rtc_wakeup = 1; } @@ -602,7 +600,7 @@ static int pm800_probe(struct i2c_client *client, goto err_device_init; } - if (pdata && pdata->plat_config) + if (pdata->plat_config) pdata->plat_config(chip, pdata); return 0;