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=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no 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 99DFDC2BB86 for ; Sun, 12 Apr 2020 11:48:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69E5220732 for ; Sun, 12 Apr 2020 11:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586692087; bh=Cq2x5fenTwfIajDDtRYq+QYOfzEBDEJNTS6/wFH0wnA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=2ENP6qlAWj7Q6nSB0LD40zVk5zwx7av4nDhWQW+zt4itmzRLkzEBxkLuwY3RjtSl6 SMWD0bJznZUQ8l89Gf9t9uBnpI5GXtJtsJ/U7ZyfWxwKM2k+3mcg9qb0CD/8nYqOde mJ8a5VKKjR/EkjHoTJ2vREGfQU1BTzk1WzOXAQeM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726689AbgDLLsG (ORCPT ); Sun, 12 Apr 2020 07:48:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:60474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbgDLLsG (ORCPT ); Sun, 12 Apr 2020 07:48:06 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3806A20708; Sun, 12 Apr 2020 11:48:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586692086; bh=Cq2x5fenTwfIajDDtRYq+QYOfzEBDEJNTS6/wFH0wnA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KVBq1lBxrAB/gZLRyJXUWeDqee/ghOkTfyDneKfrEmlpaklywyjIH+axiQNG6ekmo ctyLi2ve9WG82jsaWSQAAxZ+eDojz1vbWbFgvcZZWA2nAeTpn86p03k1yrLiKbjrJn zhC0xlxCrVz3/XefEAVqql9vK2JrD94lMWI/r+lI= Date: Sun, 12 Apr 2020 12:48:01 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: "Sa, Nuno" , linux-iio , devicetree , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Rob Herring , Mark Rutland , "Ardelean, Alexandru" , "Hennerich, Michael" Subject: Re: [PATCH v4 5/6] iio: imu: Add support for adis16475 Message-ID: <20200412124801.2a80b067@archlinux> In-Reply-To: References: <20200406150846.878-1-nuno.sa@analog.com> <20200406150846.878-6-nuno.sa@analog.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org > ... > > > > > + if (scaled_out_freq < 1900 || scaled_out_freq > 2100) { > > > > + dev_err(dev, > > > > + "Invalid value:%u for adi,scaled-output-hz", > > > > + scaled_out_freq); > > > > > > When there is no property or property has a value 0 this message can't > > > tell the difference. > > > Perhaps you have to check return code from device_property_read_u32() > > > call. > > > > > > > Well, I think we don't really need to. If the sync mode is scaled, then this property is mandatory > > (and this is stated in the bindings). So, I don't really care if the property is not there or if it's just > > a wrong value. We should fail either way and I'm not sure an extra if with some other message will > > give us that extra value... > > Up to maintainer (I have no strong opinion about this) Nice to give a hint to the user about the two different cases so I'd check the return value as Andy first suggested.