From patchwork Mon Apr 24 10:01:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 9695955 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2F3E6601E9 for ; Mon, 24 Apr 2017 10:01:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FCD122B1F for ; Mon, 24 Apr 2017 10:01:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1444C2679B; Mon, 24 Apr 2017 10:01:45 +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=-6.9 required=2.0 tests=BAYES_00,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 5D6F022B1F for ; Mon, 24 Apr 2017 10:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1168310AbdDXKBl (ORCPT ); Mon, 24 Apr 2017 06:01:41 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:55168 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1166911AbdDXKBf (ORCPT ); Mon, 24 Apr 2017 06:01:35 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OOW019S1RUK9GB0@mailout3.samsung.com>; Mon, 24 Apr 2017 19:01:32 +0900 (KST) Received: from epsmges1p1.samsung.com (unknown [182.195.42.53]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20170424100132epcas1p491f078127330f2edfc887c04fdeecc70~4TSO-Eg_90970909709epcas1p4R; Mon, 24 Apr 2017 10:01:32 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id 78.4C.11252.CFCCDF85; Mon, 24 Apr 2017 19:01:32 +0900 (KST) Received: from epsmgms2p1 (unknown [182.195.42.79]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20170424100132epcas1p47ad6d41345962cc43d8f34d5920951bd~4TSOxmk8H0970909709epcas1p4P; Mon, 24 Apr 2017 10:01:32 +0000 (GMT) X-AuditID: b6c32a35-f79806d000002bf4-e0-58fdccfc3267 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1 (Symantec Messaging Gateway) with SMTP id 50.2D.24926.CFCCDF85; Mon, 24 Apr 2017 19:01:32 +0900 (KST) Received: from AMDC3058.DIGITAL.local ([106.120.53.102]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OOW00J6ZRU89QC0@mmp2.samsung.com>; Mon, 24 Apr 2017 19:01:32 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Thierry Reding , Jean Delvare , Guenter Roeck , Kamil Debski Cc: Tomasz Figa , linux-pwm@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH v2 1/3] pwm: pwm-samsung: remove redundant checks from pwm_samsung_config() Date: Mon, 24 Apr 2017 12:01:07 +0200 Message-id: <1493028069-32003-2-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1493028069-32003-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHIsWRmVeSWpSXmKPExsWy7bCmru6fM38jDF41iFlsnLGe1e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91WKTTETddCSSEvMTfV VilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJbhkrnuxlL1jBXtF34D1bA2MvWxcjJ4eEgInE 6r/NTBC2mMSFe+uB4lwcQgLzGSWa38xjgnB+MUpsvbcZrIpNwEpiYvsqRpCEiMB0RokZM7ez gjjMAvsYJVZ3TWHuYuTgEBaIlbi7WQmkgUVAVeJVWycjiM0r4CHR0LyPBWKdnMTJY5NZQWxO AU+J7R+/M4PYQkA1/xavZZvAyLuAkWEVI1dqQXFuem6xUYHhJkZggG87rOW/g/HH2ehDjAIc jEo8vB2KfyOEWBPLiitzDzFKcDArifB2rwAK8aYkVlalFuXHF5XmpBYfYjQFOmUis5Rocj4w +vJK4g1NLI1MDMzMDI0MjM2UxHknBH6JEBJITyxJzU5NLUgtgulj4uCUamB0CmHtXHJns0rQ 8oTt2/6uC7q3d/9Cn7m7FOb4VNwvWW+oF7W9pCh1ZYWzq92EOt3QIs7YdJ70RUqPW9hlGuOt q1gLwo/Pn3fZ4s2laRPMlxwvi7+qZbj3pk9I8zT352Wz/5hxTZ2oeOInj1FG3STT5axNTXtm OuQ4dq7O9rPkM84syDm6bKESS3FGoqEWc1FxIgCK23lqhgIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170424100132epcas1p47ad6d41345962cc43d8f34d5920951bd X-Msg-Generator: CA X-Sender-IP: 182.195.42.79 X-Local-Sender: =?UTF-8?B?QmFydGxvbWllaiBab2xuaWVya2lld2ljehtTUlBPTC1LZXJu?= =?UTF-8?B?ZWwgKFRQKRvsgrzshLHsoITsnpAbU2VuaW9yIFNvZnR3YXJlIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?QmFydGxvbWllaiBab2xuaWVya2lld2ljehtTUlBPTC1LZXJu?= =?UTF-8?B?ZWwgKFRQKRtTYW1zdW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBF?= =?UTF-8?B?bmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 101P X-HopCount: 7 X-CMS-RootMailID: 20170424100132epcas1p47ad6d41345962cc43d8f34d5920951bd X-RootMTR: 20170424100132epcas1p47ad6d41345962cc43d8f34d5920951bd References: <1493028069-32003-1-git-send-email-b.zolnierkie@samsung.com> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the requested period_ns and duty_ns values are identical to the last programmed ones pwm_samsung_config() returns early and skips the hardware configuration. The same checks are now done by the PWM core so the driver specific ones can be removed. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/pwm/pwm-samsung.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c index f113cda..9ea7638 100644 --- a/drivers/pwm/pwm-samsung.c +++ b/drivers/pwm/pwm-samsung.c @@ -312,9 +312,6 @@ static int pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm, if (period_ns > NSEC_PER_SEC) return -ERANGE; - if (period_ns == chan->period_ns && duty_ns == chan->duty_ns) - return 0; - tcnt = readl(our_chip->base + REG_TCNTB(pwm->hwpwm)); oldtcmp = readl(our_chip->base + REG_TCMPB(pwm->hwpwm));