From patchwork Fri Jun 5 18:42:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 49598 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 901682462C for ; Fri, 5 Jun 2015 18:44:38 +0000 (UTC) Received: by wibut5 with SMTP id ut5sf7145257wib.0 for ; Fri, 05 Jun 2015 11:44:37 -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=EvunpLGkvgX3G/IFNFy2OduZ6g39XXTO/zj4hIAAa+k=; b=M4E1oyA3IecUUqWRp/aA0ZMHYsSyEe7VsfQ8E3E+A0oePxK7ApFzZffWEwd5VYcDsh kcg65xfRWCPp1jOseQWDHYhE9VOkRCNTf+o+F6ITli075QM+yfpru8IKiGu3PEr7RF8B p42l6m9Z1Tcun1226N4ICNKRyYUOW8HwJ2N7rkv0Mtol0klat2E/furEMTSBqp/udkoT 30FihF1iEF2kpV3jjclD9zYceqgNBLAH6yjiJucvnPLCMdKzzpczuvuh9nEFRq4VlrRc 93Srlo8mWNeJlItoWhDt5+pH2GXqhzG9Tl7NqTgwLv+yquEuHi7+3UCDXvTB0CJ95C5z 1nPw== X-Gm-Message-State: ALoCoQlw+FDFQnSJphJer+HqAZGej2iRnIUjhl4fFcU+2bdQrwwZ6Brqe7SPcI59GP6mFJM/TGtg X-Received: by 10.152.42.208 with SMTP id q16mr4313328lal.9.1433529877783; Fri, 05 Jun 2015 11:44:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.7 with SMTP id v7ls382440laa.75.gmail; Fri, 05 Jun 2015 11:44:37 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr4522329lac.41.1433529877535; Fri, 05 Jun 2015 11:44:37 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id z6si5501445lae.16.2015.06.05.11.44.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 11:44:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbtu8 with SMTP id tu8so35205756lbb.2 for ; Fri, 05 Jun 2015 11:44:37 -0700 (PDT) X-Received: by 10.152.29.34 with SMTP id g2mr4640650lah.73.1433529877390; Fri, 05 Jun 2015 11:44:37 -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 hn6csp71509lbb; Fri, 5 Jun 2015 11:44:36 -0700 (PDT) X-Received: by 10.70.91.232 with SMTP id ch8mr8203830pdb.58.1433529875439; Fri, 05 Jun 2015 11:44:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fl4si11941581pab.108.2015.06.05.11.44.34; Fri, 05 Jun 2015 11:44:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 S932919AbbFESo3 (ORCPT + 28 others); Fri, 5 Jun 2015 14:44:29 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:38095 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752329AbbFESnK (ORCPT ); Fri, 5 Jun 2015 14:43:10 -0400 Received: by wibdq8 with SMTP id dq8so27762885wib.1 for ; Fri, 05 Jun 2015 11:43:09 -0700 (PDT) X-Received: by 10.180.80.229 with SMTP id u5mr7161476wix.92.1433529783337; Fri, 05 Jun 2015 11:43:03 -0700 (PDT) Received: from localhost.localdomain ([213.205.253.199]) by mx.google.com with ESMTPSA id be3sm4473541wib.21.2015.06.05.11.43.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jun 2015 11:43:02 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, broonie@kernel.org, lgirdwood@gmail.com, Lee Jones Subject: [PATCH 3/8] regulator: pwm-regulator: Remove superfluous is_enabled check Date: Fri, 5 Jun 2015 19:42:46 +0100 Message-Id: <1433529771-24496-4-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1433529771-24496-1-git-send-email-lee.jones@linaro.org> References: <1433529771-24496-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@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.217.171 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: , The core framework already takes care of this. Signed-off-by: Lee Jones --- drivers/regulator/pwm-regulator.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c index 4a071b6..36f9684 100644 --- a/drivers/regulator/pwm-regulator.c +++ b/drivers/regulator/pwm-regulator.c @@ -23,7 +23,6 @@ struct pwm_regulator_data { struct pwm_voltages *duty_cycle_table; struct pwm_device *pwm; - bool enabled; int state; }; @@ -60,13 +59,10 @@ static int pwm_regulator_set_voltage_sel(struct regulator_dev *dev, drvdata->state = selector; - if (!drvdata->enabled) { - ret = pwm_enable(drvdata->pwm); - if (ret) { - dev_err(&dev->dev, "Failed to enable PWM\n"); - return ret; - } - drvdata->enabled = true; + ret = pwm_enable(drvdata->pwm); + if (ret) { + dev_err(&dev->dev, "Failed to enable PWM\n"); + return ret; } return 0;