Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp413513imu; Thu, 8 Nov 2018 10:00:22 -0800 (PST) X-Received: by 2002:a62:8a91:: with SMTP id o17-v6mr5477017pfk.210.1541699781405; Thu, 08 Nov 2018 09:56:21 -0800 (PST) X-Google-Smtp-Source: AJdET5fkjZSXuRZDIvmAe1+/MWI9+jKXc9YMNyHpG7Jt4JNylgEPpjaOU9g7kqTuUDR2knNGn+v6 X-Received: by 2002:a62:8a91:: with SMTP id o17-v6mr5476956pfk.210.1541699780538; Thu, 08 Nov 2018 09:56:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541699780; cv=none; d=google.com; s=arc-20160816; b=WvrvXeu3E13yjfEDppGQaMeeEHiKblxS+EoWjiwF+vbUQ6r+xRHdBH2KyXyLrQjOgp D4s3m8JQmAZykIOdGxuu/isd3546ViOS8tWNEux59s+5xIAmDVhyGJwW/0R8ao2fCZUB TQyMq5Xvenr7VUJJFoBi4B/uIEYCYQZ3RNCiSgiee3SgBmUjLal+ZaCfCy1ohtfG7BiO fj5RWFCRbzCltJwhAnTr8UVziW97PG9mpGv2prPwlh7AW9kM4Eqfx0LrQeloPkAlj1Tg +iYsn3rN7Lrr3XHVmF35LnMebgIjUB8gq4VBvyNEaN3/FUuID8X/kteNJdgB+SgRk8Gc nz5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=TJiMMq7bL5fJCN8n4HE+c3ya49Wj+kIau6m7tsFU5U4=; b=LjN9QY9mBy0e7YIZVJ5X04nydVlmpA59BJswsPXALEo2bc1AxpBoIwVdh0ewva1qYG 3ZWCG+VbBSsCgzJeW+zWNyhduN8NGFOycfGG67pOYV5s0d19RJXZGipZnNNRdhGIEkY8 24PFB8dFhegyIf5euhc3brhktzdvyGR6doN1tUmAGa6i4JnnSnJENQ4ZcVesQPU+Br5k mDt//CJM7wgtrb3iWSN+RhfIT4pmWBVzdolJltKcNuv6QWSkFPhNVUpwLJ068K6Q+tt3 uxjlBktePy+Oy7f4gNZJZ0oKOJ8Sj0DqtqkrSx154M3m5piH+KyV5aL3v6sJu008w6XJ 9Z0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g70-v6si5390780pfd.86.2018.11.08.09.56.05; Thu, 08 Nov 2018 09:56:20 -0800 (PST) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727197AbeKID2R (ORCPT + 99 others); Thu, 8 Nov 2018 22:28:17 -0500 Received: from mx0a-00010702.pphosted.com ([148.163.156.75]:57958 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726585AbeKID2Q (ORCPT ); Thu, 8 Nov 2018 22:28:16 -0500 Received: from pps.filterd (m0098781.ppops.net [127.0.0.1]) by mx0a-00010702.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wA8HfcoQ002629; Thu, 8 Nov 2018 11:51:13 -0600 Received: from ni.com (skprod2.natinst.com [130.164.80.23]) by mx0a-00010702.pphosted.com with ESMTP id 2nktgnx914-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Nov 2018 11:51:13 -0600 Received: from us-aus-exhub1.ni.corp.natinst.com (us-aus-exhub1.ni.corp.natinst.com [130.164.68.41]) by us-aus-skprod2.natinst.com (8.16.0.22/8.16.0.22) with ESMTPS id wA8HpCTM001889 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 8 Nov 2018 11:51:12 -0600 Received: from us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) by us-aus-exhub1.ni.corp.natinst.com (130.164.68.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 8 Nov 2018 11:51:12 -0600 Received: from senary.amer.corp.natinst.com (130.164.49.7) by us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 8 Nov 2018 11:51:12 -0600 From: Kyle Roeschley To: Andrew Lunn , Florian Fainelli CC: "David S . Miller" , , , Kyle Roeschley Subject: [PATCH] net: phy: leds: Don't make our own link speed names Date: Thu, 8 Nov 2018 11:51:06 -0600 Message-ID: <20181108175106.25684-1-kyle.roeschley@ni.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-08_08:,, signatures=0 X-Proofpoint-Spam-Reason: safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The phy core provides a handy phy_speed_to_str() helper, so use that instead of doing our own formatting of the different known link speeds. Signed-off-by: Kyle Roeschley --- drivers/net/phy/phy_led_triggers.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/net/phy/phy_led_triggers.c b/drivers/net/phy/phy_led_triggers.c index 491efc1bf5c4..2827eb413c9c 100644 --- a/drivers/net/phy/phy_led_triggers.c +++ b/drivers/net/phy/phy_led_triggers.c @@ -77,20 +77,9 @@ static int phy_led_trigger_register(struct phy_device *phy, struct phy_led_trigger *plt, unsigned int speed) { - char name_suffix[PHY_LED_TRIGGER_SPEED_SUFFIX_SIZE]; - plt->speed = speed; - - if (speed < SPEED_1000) - snprintf(name_suffix, sizeof(name_suffix), "%dMbps", speed); - else if (speed == SPEED_2500) - snprintf(name_suffix, sizeof(name_suffix), "2.5Gbps"); - else - snprintf(name_suffix, sizeof(name_suffix), "%dGbps", - DIV_ROUND_CLOSEST(speed, 1000)); - phy_led_trigger_format_name(phy, plt->name, sizeof(plt->name), - name_suffix); + phy_speed_to_str(speed)); plt->trigger.name = plt->name; return led_trigger_register(&plt->trigger); -- 2.19.1