From patchwork Fri Jun 5 18:42:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 49593 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D02B62462C for ; Fri, 5 Jun 2015 18:43:36 +0000 (UTC) Received: by laboh3 with SMTP id oh3sf21824694lab.0 for ; Fri, 05 Jun 2015 11:43: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=HOmvwc88KyC61RbwXU/eKVXJ8Q9o6RcbVrqlTXfb6vY=; b=ikhYNZolVHNE2FwcKU6c1byz95QnxSl+ylv17/jAQW1daeMh4OKiXEGd+/eMEc944R N/Ar0YKawWaToW+t2u+WOQWZr/DYEYszWVAA7mCNKuFz3gdYFFW8Q0PsFh4+PYwaeTic uOL7aNDmewVMi/OngpQUm4JVOU9KG8xc9dfBlOvoxnTw8z2PPGOddNAtK5sgNETIYkuV CYvjXPUmh9ETpwRv2PUOFU6zlXmPo/FEyedjeDtEfUFFLFtQAb5waKniDINqmLKX9Epr TszUzldxaErzIwUrN5NSMYejHH2Wf1NCRb8ApTtrMY0w6CRgGpngDmemRP59HKlEwBxM zhpg== X-Gm-Message-State: ALoCoQk0I8w6ldT1iklqBepHnpgMGVHSxEFMaVJLW744fh9qF7U3WCsKt1C6hoUz8WLipvNLN8TV X-Received: by 10.180.36.172 with SMTP id r12mr24525572wij.6.1433529815179; Fri, 05 Jun 2015 11:43:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.169 with SMTP id l9ls413490lah.52.gmail; Fri, 05 Jun 2015 11:43:34 -0700 (PDT) X-Received: by 10.152.29.34 with SMTP id g2mr4636956lah.73.1433529814773; Fri, 05 Jun 2015 11:43:34 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id k9si5472250lah.119.2015.06.05.11.43.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 11:43:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labpy14 with SMTP id py14so60400304lab.0 for ; Fri, 05 Jun 2015 11:43:34 -0700 (PDT) X-Received: by 10.152.27.1 with SMTP id p1mr4556147lag.112.1433529814661; Fri, 05 Jun 2015 11:43:34 -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 hn6csp70911lbb; Fri, 5 Jun 2015 11:43:33 -0700 (PDT) X-Received: by 10.70.118.5 with SMTP id ki5mr8180348pdb.6.1433529812496; Fri, 05 Jun 2015 11:43:32 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bm1si11870432pbd.212.2015.06.05.11.43.31; Fri, 05 Jun 2015 11:43:32 -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 S932762AbbFESnR (ORCPT + 28 others); Fri, 5 Jun 2015 14:43:17 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:34044 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932518AbbFESnH (ORCPT ); Fri, 5 Jun 2015 14:43:07 -0400 Received: by wibut5 with SMTP id ut5so29628666wib.1 for ; Fri, 05 Jun 2015 11:43:06 -0700 (PDT) X-Received: by 10.194.87.1 with SMTP id t1mr9067121wjz.24.1433529786020; Fri, 05 Jun 2015 11:43:06 -0700 (PDT) Received: from localhost.localdomain ([213.205.253.199]) by mx.google.com with ESMTPSA id be3sm4473541wib.21.2015.06.05.11.43.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jun 2015 11:43:05 -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 4/8] regulator: pwm-regulator: Diffientiate between dev (device) and rdev (regulator_dev) Date: Fri, 5 Jun 2015 19:42:47 +0100 Message-Id: <1433529771-24496-5-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.215.54 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: , Signed-off-by: Lee Jones --- drivers/regulator/pwm-regulator.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c index 36f9684..ae32086 100644 --- a/drivers/regulator/pwm-regulator.c +++ b/drivers/regulator/pwm-regulator.c @@ -31,17 +31,17 @@ struct pwm_voltages { unsigned int dutycycle; }; -static int pwm_regulator_get_voltage_sel(struct regulator_dev *dev) +static int pwm_regulator_get_voltage_sel(struct regulator_dev *rdev) { - struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev); + struct pwm_regulator_data *drvdata = rdev_get_drvdata(rdev); return drvdata->state; } -static int pwm_regulator_set_voltage_sel(struct regulator_dev *dev, +static int pwm_regulator_set_voltage_sel(struct regulator_dev *rdev, unsigned selector) { - struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev); + struct pwm_regulator_data *drvdata = rdev_get_drvdata(rdev); unsigned int pwm_reg_period; int dutycycle; int ret; @@ -53,7 +53,7 @@ static int pwm_regulator_set_voltage_sel(struct regulator_dev *dev, ret = pwm_config(drvdata->pwm, dutycycle, pwm_reg_period); if (ret) { - dev_err(&dev->dev, "Failed to configure PWM\n"); + dev_err(&rdev->dev, "Failed to configure PWM\n"); return ret; } @@ -61,19 +61,19 @@ static int pwm_regulator_set_voltage_sel(struct regulator_dev *dev, ret = pwm_enable(drvdata->pwm); if (ret) { - dev_err(&dev->dev, "Failed to enable PWM\n"); + dev_err(&rdev->dev, "Failed to enable PWM\n"); return ret; } return 0; } -static int pwm_regulator_list_voltage(struct regulator_dev *dev, +static int pwm_regulator_list_voltage(struct regulator_dev *rdev, unsigned selector) { - struct pwm_regulator_data *drvdata = rdev_get_drvdata(dev); + struct pwm_regulator_data *drvdata = rdev_get_drvdata(rdev); - if (selector >= dev->desc->n_voltages) + if (selector >= rdev->desc->n_voltages) return -EINVAL; return drvdata->duty_cycle_table[selector].uV;