From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6A10C433FF for ; Wed, 14 Aug 2019 02:29:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A9222084F for ; Wed, 14 Aug 2019 02:29:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565749767; bh=I74Ui692YO0DE09USxz3sR1W35oyw5Fyr/fjLiYNM+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xrH/QTF2tDRlPLaruRlyOMzHDq4+hjYSSnAFJpUwweZByWBsaOqRBXh+pn36nWsg+ ZdD/qMSRUX4/QPnlXfHnLHfJImATtxauW+J4/hmMP4VZH8VMVAZ98km1qVYHuTJscC 8Jkdw3zUdn6Lepk7/5k4Rcr27xXBTY+cfZt+LwD0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729564AbfHNC30 (ORCPT ); Tue, 13 Aug 2019 22:29:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:52578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729861AbfHNCXc (ORCPT ); Tue, 13 Aug 2019 22:23:32 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1234B20679; Wed, 14 Aug 2019 02:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565749411; bh=I74Ui692YO0DE09USxz3sR1W35oyw5Fyr/fjLiYNM+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jQRVvGqU1FTNb9D9IRHq8fNHQsQQO3wE8wbNd/b52Z3sm5aWZ3T+3FWV4CFn0mF0X xgw9FER85UXnYN8Hyl6mN4l35ISr6I479WKoicgaIXcOwUJzDWDutFWljOdLWhbMdZ h9Mz7oRJ3UrpuKyjhiVR6Erok/EP2XKWqIc0Rwpk= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Rasmus Villemoes , Willem de Bruijn , Marc Kleine-Budde , Sasha Levin , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.9 06/33] can: dev: call netif_carrier_off() in register_candev() Date: Tue, 13 Aug 2019 22:22:56 -0400 Message-Id: <20190814022323.17111-6-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190814022323.17111-1-sashal@kernel.org> References: <20190814022323.17111-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Rasmus Villemoes [ Upstream commit c63845609c4700488e5eacd6ab4d06d5d420e5ef ] CONFIG_CAN_LEDS is deprecated. When trying to use the generic netdev trigger as suggested, there's a small inconsistency with the link property: The LED is on initially, stays on when the device is brought up, and then turns off (as expected) when the device is brought down. Make sure the LED always reflects the state of the CAN device. Signed-off-by: Rasmus Villemoes Acked-by: Willem de Bruijn Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 214a48703a4e4..ffc5467a1ec2b 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c @@ -1095,6 +1095,8 @@ static struct rtnl_link_ops can_link_ops __read_mostly = { int register_candev(struct net_device *dev) { dev->rtnl_link_ops = &can_link_ops; + netif_carrier_off(dev); + return register_netdev(dev); } EXPORT_SYMBOL_GPL(register_candev); -- 2.20.1