From patchwork Mon Nov 6 12:34:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Eckert X-Patchwork-Id: 741713 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E68F3C4167B for ; Mon, 6 Nov 2023 12:34:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbjKFMee (ORCPT ); Mon, 6 Nov 2023 07:34:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231421AbjKFMed (ORCPT ); Mon, 6 Nov 2023 07:34:33 -0500 Received: from mxout70.expurgate.net (mxout70.expurgate.net [194.37.255.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2598B7 for ; Mon, 6 Nov 2023 04:34:29 -0800 (PST) Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.92) (envelope-from ) id 1qzyoG-00DGWX-4J for linux-serial@vger.kernel.org; Mon, 06 Nov 2023 13:34:28 +0100 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qzyoF-00CA0I-OO for linux-serial@vger.kernel.org; Mon, 06 Nov 2023 13:34:27 +0100 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 7B5E3240053 for ; Mon, 6 Nov 2023 13:34:27 +0100 (CET) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 3BB64240052; Mon, 6 Nov 2023 13:34:27 +0100 (CET) Received: from localhost.localdomain (unknown [10.2.3.40]) by mail.dev.tdt.de (Postfix) with ESMTPSA id 05AE1227EE; Mon, 6 Nov 2023 13:34:27 +0100 (CET) From: Florian Eckert To: Eckert.Florian@googlemail.com, gregkh@linuxfoundation.org, jirislaby@kernel.org, pavel@ucw.cz, lee@kernel.org, kabel@kernel.org, u.kleine-koenig@pengutronix.de, m.brock@vanmierlo.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-leds@vger.kernel.org Subject: [Patch v7 3/6] leds: ledtrig-tty: change logging if get icount failed Date: Mon, 6 Nov 2023 13:34:12 +0100 Message-ID: <20231106123415.3365732-4-fe@dev.tdt.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231106123415.3365732-1-fe@dev.tdt.de> References: <20231106123415.3365732-1-fe@dev.tdt.de> MIME-Version: 1.0 X-purgate: clean X-purgate-type: clean X-purgate-ID: 151534::1699274068-D1E98639-6052BF18/0/0 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org Change the log level from info to warn, because there is something wrong. That is more a warn message than an info message. While we are at it, the device prefix is also changed, as this is the led device and not the tty device that generates this message. Signed-off-by: Florian Eckert --- drivers/leds/trigger/ledtrig-tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-tty.c b/drivers/leds/trigger/ledtrig-tty.c index 3e69a7bde928..86595add72cd 100644 --- a/drivers/leds/trigger/ledtrig-tty.c +++ b/drivers/leds/trigger/ledtrig-tty.c @@ -83,6 +83,7 @@ static void ledtrig_tty_work(struct work_struct *work) struct ledtrig_tty_data *trigger_data = container_of(work, struct ledtrig_tty_data, dwork.work); struct serial_icounter_struct icount; + struct led_classdev *led_cdev = trigger_data->led_cdev; int ret; mutex_lock(&trigger_data->mutex); @@ -117,7 +118,7 @@ static void ledtrig_tty_work(struct work_struct *work) ret = tty_get_icount(trigger_data->tty, &icount); if (ret) { - dev_info(trigger_data->tty->dev, "Failed to get icount, stopped polling\n"); + dev_warn(led_cdev->dev, "Failed to get icount, stop polling\n"); mutex_unlock(&trigger_data->mutex); return; } @@ -126,8 +127,7 @@ static void ledtrig_tty_work(struct work_struct *work) icount.tx != trigger_data->tx) { unsigned long interval = LEDTRIG_TTY_INTERVAL; - led_blink_set_oneshot(trigger_data->led_cdev, &interval, - &interval, 0); + led_blink_set_oneshot(led_cdev, &interval, &interval, 0); trigger_data->rx = icount.rx; trigger_data->tx = icount.tx;