Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751781AbdGYSQi (ORCPT ); Tue, 25 Jul 2017 14:16:38 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:27337 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751483AbdGYSQg (ORCPT ); Tue, 25 Jul 2017 14:16:36 -0400 Subject: Re: [PATCH v2 2/4] can: fixed-transceiver: Add documentation for CAN fixed transceiver bindings To: Oliver Hartkopp , , , , , , , , , , , References: <20170724230521.1436-1-fcooper@ti.com> <20170724230521.1436-3-fcooper@ti.com> <29df7e04-01c6-a09b-491e-1354dab98cd0@hartkopp.net> From: Franklin S Cooper Jr Message-ID: <04e3986b-bbeb-50ad-30e0-fb74bb534aa6@ti.com> Date: Tue, 25 Jul 2017 13:14:26 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <29df7e04-01c6-a09b-491e-1354dab98cd0@hartkopp.net> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [128.247.58.225] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1283 Lines: 36 On 07/25/2017 11:32 AM, Oliver Hartkopp wrote: > >> + max-data-speed: a positive non 0 value that determines the max >> data rate >> + that can be used in CAN-FD mode. A value of -1 implies >> + CAN-FD is not supported by the transceiver. >> + >> +Examples: > > (..) > >> + fixed-transceiver { >> + max-data-speed = <(-1)>; > > Looks ugly IMHO. > > Why didn't you stay on '0' for 'not supported'?? Unless a driver specifically calls of_can_transceiver_fixed priv->max_trans_data_speed will be by default 0. Therefore, all drivers that support CAN-FD will claim that the transceiver indicates that it isn't supported. So one option was to update every single driver to set this property by default which I started to do but it end up becoming a massive patch and it was risky in case I missed a driver which would of resulted in major regressions. Its also problematic for new drivers that miss this property or the many out of tree CAN drivers. The other option was to create another variable to track to see if of_can_transceiver_fixed was called but I didn't think that was the better solution. So using signed values in DT is a bit ugly due to syntax but was valid and I made sure I documented it so its clear. > > Regards, > Oliver >