From patchwork Thu Feb 21 13:17:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 10824103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A93671399 for ; Thu, 21 Feb 2019 13:17:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98A312E664 for ; Thu, 21 Feb 2019 13:17:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CF31303FB; Thu, 21 Feb 2019 13:17:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 438362E664 for ; Thu, 21 Feb 2019 13:17:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728006AbfBUNRy (ORCPT ); Thu, 21 Feb 2019 08:17:54 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43685 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726113AbfBUNRy (ORCPT ); Thu, 21 Feb 2019 08:17:54 -0500 Received: by mail-pl1-f195.google.com with SMTP id m10so4511287plt.10 for ; Thu, 21 Feb 2019 05:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z4WPpNvqATEqflSPwYUzMl3muuVuJNYbX37LQ5kTos0=; b=cYND5pZ1RjYAKsI8X/nSYC3vb41LMgF5K5SHWRAh2eHO9dQaxpif98SFORXP16GJ3f oreBrm0HGi2/rRsBGpwlrfWa6MWPH8lWwOS87FDkmKb04KeZpSvsjC8g3HLt3Ev59dRw CNFUhmAsyemXhnjW+o85wItMkF3ewjnRhdxHg35DRIMjexdafyhytyw3SYkn5NuvYaon 2p45Lcd4HyLbQFmdpvHLJCnA7+nNM5y5Sep2yrZzk4BntP4qifwi99WEydkAygJPqzxE B6RF1Ff1f7nfZ18R11k+khnGdJrU1P+EhVFF4KzIU1nMUQ5Bh6JBJT9Wiu+5uPewUf8j p+bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Z4WPpNvqATEqflSPwYUzMl3muuVuJNYbX37LQ5kTos0=; b=qrEsiAV7zKOfsOKqPy6cXXuK/7+vdLKrD9TLFKBssRcNT3IwI405tCZpP+JLUt+STD 0we/YQsei1f084IaRqdNuw3jc/wmREAXK6GPFJ2FxyidHqZIDSuSSQvIzKAceUe8SMzC zOQLvVkMGP5gvlBLE1WlrhFncx1b4FjC/2RJi/artXaRXH9Vcwqjh0zf8pAIosngFlek W96LqM4EQjtZM1bhdjAyusvdhM/u6tkiE+B5qEMQcj0Xhgbc0TV9D1y8thTSWND+hf1m 43CdmSVlfycfydvatXI7AyoIEARpHkg4u4g5yeRwuXkhaNEG6R5l7ZFTipK//teyEBUK Gq1w== X-Gm-Message-State: AHQUAuYtNcVt5q2qsoMDEg+YtEE/BlIe1nzbggSh3TzNq5KsbBdg/5/P JIhrnRR2q4jySJeHYwtmPMQvCA== X-Google-Smtp-Source: AHgI3IZgMgxx2VnsBPn3yEVzdeb9/YCv0OhSrmuAl2Q3gfov6iMisnXsXI4QFahe7Rka4xcVrXtNCg== X-Received: by 2002:a17:902:1101:: with SMTP id d1mr9323067pla.19.1550755073905; Thu, 21 Feb 2019 05:17:53 -0800 (PST) Received: from localhost.localdomain (220-133-186-239.HINET-IP.hinet.net. [220.133.186.239]) by smtp.gmail.com with ESMTPSA id e21sm79046676pfh.45.2019.02.21.05.17.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 05:17:53 -0800 (PST) From: Axel Lin To: Mark Brown Cc: Sangbeom Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , linux-samsung-soc@vger.kernel.org, Liam Girdwood , linux-kernel@vger.kernel.org, Axel Lin Subject: [PATCH 2/2] regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation Date: Thu, 21 Feb 2019 21:17:22 +0800 Message-Id: <20190221131722.12278-2-axel.lin@ingics.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190221131722.12278-1-axel.lin@ingics.com> References: <20190221131722.12278-1-axel.lin@ingics.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Axel Lin Reviewed-by: Krzysztof Kozlowski --- drivers/regulator/s5m8767.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 5b0e1fe6723f..bb9d1a083299 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -339,13 +339,9 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev, unsigned int new_sel) { struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); - const struct sec_voltage_desc *desc; - int reg_id = rdev_get_id(rdev); - - desc = reg_voltage_map[reg_id]; if ((old_sel < new_sel) && s5m8767->ramp_delay) - return DIV_ROUND_UP(desc->step * (new_sel - old_sel), + return DIV_ROUND_UP(rdev->desc->uV_step * (new_sel - old_sel), s5m8767->ramp_delay * 1000); return 0; }