From patchwork Tue Nov 10 23:10:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 56355 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1047980lbb; Tue, 10 Nov 2015 15:10:37 -0800 (PST) X-Received: by 10.68.219.98 with SMTP id pn2mr9395486pbc.141.1447197037514; Tue, 10 Nov 2015 15:10:37 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tq1si7997273pac.125.2015.11.10.15.10.37 for ; Tue, 10 Nov 2015 15:10:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752046AbbKJXKg (ORCPT ); Tue, 10 Nov 2015 18:10:36 -0500 Received: from mail-ob0-f170.google.com ([209.85.214.170]:32967 "EHLO mail-ob0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752054AbbKJXKa (ORCPT ); Tue, 10 Nov 2015 18:10:30 -0500 Received: by obbww6 with SMTP id ww6so9827827obb.0 for ; Tue, 10 Nov 2015 15:10:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id; bh=nEocnRMvfenRJqFZgK9t97ORZwFs4Vv2khJg6cjVmZE=; b=NkMrcRC9pJT+WzfYMx8F4QDNZwFaVVN9+KCwp9/mKWDzPq3Oe/Ys7zIHfpPqEwXs7K GWrfroyy/17ZA2xj5JdRZXKYw0hX5xP0Vx1nVS+D9ON0Wppgje16e36un2izQXdZcUxc cyKkmUf5mr9QEQEro9YWM/OljjT8MTH3dRnc42bI+iVNEFmUR92mLvaCad99V5RR2xd6 q7W8kB9EsEMhKcjjBVuQu8dUDo+obHeKYPw/I2+uwJ8FoLYQW34Dm4XXPwxydRH7k2TU F6lSco1kSZy4zwCjtev9O+8mYSycvpwqkdwMvPi/ofy5I49TC5hiZhUKyy+MqNRHzxRL Vktw== X-Received: by 10.182.134.170 with SMTP id pl10mr3228045obb.42.1447197029365; Tue, 10 Nov 2015 15:10:29 -0800 (PST) Received: from rob-hp-laptop.herring.priv (72-48-98-129.dyn.grandenetworks.net. [72.48.98.129]) by smtp.googlemail.com with ESMTPSA id ry9sm660695oec.17.2015.11.10.15.10.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Nov 2015 15:10:28 -0800 (PST) From: Rob Herring Cc: Shuah Khan , Richard Purdie , Jacek Anaszewski , linux-leds@vger.kernel.org Subject: [PATCH] leds: ledtrig-transient: fix duration to be msec instead of jiffies Date: Tue, 10 Nov 2015 17:10:17 -0600 Message-Id: <1447197017-4783-1-git-send-email-robh@kernel.org> X-Mailer: git-send-email 2.5.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org The transient trigger duration is documented to be in msec units, but is actually in jiffies units. Other time based triggers are in msec units as well. Fix the timer setup to convert from msec. This could break an existing userspace that worked around this problem, but exposing jiffies to userspace is just wrong and would break anyway if HZ is changed. Signed-off-by: Rob Herring Cc: Shuah Khan Cc: Richard Purdie Cc: Jacek Anaszewski Cc: linux-leds@vger.kernel.org --- drivers/leds/trigger/ledtrig-transient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-leds" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/leds/trigger/ledtrig-transient.c b/drivers/leds/trigger/ledtrig-transient.c index 3c34de4..60034bf 100644 --- a/drivers/leds/trigger/ledtrig-transient.c +++ b/drivers/leds/trigger/ledtrig-transient.c @@ -85,7 +85,7 @@ static ssize_t transient_activate_store(struct device *dev, transient_data->restore_state = (transient_data->state == LED_FULL) ? LED_OFF : LED_FULL; mod_timer(&transient_data->timer, - jiffies + transient_data->duration); + jiffies + msecs_to_jiffies(transient_data->duration)); } /* state == 0 && transient_data->activate == 0