Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752652AbaBVWTK (ORCPT ); Sat, 22 Feb 2014 17:19:10 -0500 Received: from mta.cujae.edu.cu ([200.55.139.24]:60054 "EHLO mtaext1.cujae.edu.cu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751774AbaBVWTI (ORCPT ); Sat, 22 Feb 2014 17:19:08 -0500 X-Greylist: delayed 407 seconds by postgrey-1.27 at vger.kernel.org; Sat, 22 Feb 2014 17:19:07 EST X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Processed: udio.cujae.edu.cu, Sat, 22 Feb 2014 17:11:10 -0500 (not processed: message from trusted or authenticated source) X-Authenticated-Sender: acabrera@udio.cujae.edu.cu X-MDRemoteIP: 10.71.0.59 X-Return-Path: acabrera@udio.cujae.edu.cu X-Envelope-From: acabrera@udio.cujae.edu.cu Message-ID: <53094A15.1080708@udio.cujae.edu.cu> Date: Sat, 22 Feb 2014 17:08:37 -0800 From: Alejandro Cabrera User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Wim Van Sebroeck CC: Guenter Roeck , Michal Simek , linux-kernel@vger.kernel.org, monstr@monstr.eu, linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 07/11] watchdog: xilinx: Use of_property_read_u32 References: <7cbb10853a343c9d488346596f604909ab0668b9.1392212059.git.michal.simek@xilinx.com> <20140212171509.GB20012@roeck-us.net> <20140222184604.GB21504@spo001.leaseweb.com> In-Reply-To: <20140222184604.GB21504@spo001.leaseweb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/2/2014 10:46 AM, Wim Van Sebroeck wrote: > Hi All, > >> Hi Michal, >> >> On Wed, Feb 12, 2014 at 02:41:21PM +0100, Michal Simek wrote: >>> Use of_property_read_u32 functions to clean probe function. >>> >>> Signed-off-by: Michal Simek >>> Reviewed-by: Guenter Roeck >>> --- >>> >>> Changes in v3: >>> - Remove one if checking and use variable directly >>> >> Looks good. >> >> Another comment/remark. >> >>> - pfreq = (u32 *)of_get_property(pdev->dev.of_node, >>> - "clock-frequency", NULL); >>> - >>> - if (pfreq == NULL) { >>> + rc = of_property_read_u32(pdev->dev.of_node, "clock-frequency",&pfreq); >>> + if (rc) { >>> dev_warn(&pdev->dev, >>> "The watchdog clock frequency cannot be obtained\n"); >>> no_timeout = true; >>> } >>> >>> - tmptr = (u32 *)of_get_property(pdev->dev.of_node, >>> - "xlnx,wdt-interval", NULL); >>> - if (tmptr == NULL) { >>> + rc = of_property_read_u32(pdev->dev.of_node, "xlnx,wdt-interval", >>> + &xdev->wdt_interval); >>> + if (rc) { >>> dev_warn(&pdev->dev, >>> "Parameter \"xlnx,wdt-interval\" not found\n"); >>> no_timeout = true; >>> - } else { >>> - xdev->wdt_interval = *tmptr; >>> } >>> >>> - tmptr = (u32 *)of_get_property(pdev->dev.of_node, >>> - "xlnx,wdt-enable-once", NULL); >>> - if (tmptr == NULL) { >>> + rc = of_property_read_u32(pdev->dev.of_node, "xlnx,wdt-enable-once", >>> + &enable_once); >>> + if (rc) >>> dev_warn(&pdev->dev, >>> "Parameter \"xlnx,wdt-enable-once\" not found\n"); >>> - watchdog_set_nowayout(xilinx_wdt_wdd, true); >>> - } >> All the above properties are optional. Is a warning really >> warranted in this case ? I usually associate a warning with >> something that is wrong, which is not the case here. >> >> I would encourage you to drop those warnings, but that should be >> a separate patch. > I agree with Guenter: these are not really warnings. Seperate patch is thus welcome. Hi I support Michal intention, I think it is a warning because device tree blob must have the "xlnx,wdt-enable-once" property specified in order to allow the system to be sure of the real value of this property. In addition to, this warning can be helpful to detect a wrong device tree specification. Best regards Alejandro 50 Aniversario de la Cujae. Inaugurada por Fidel el 2 de diciembre de 1964 http://cujae.edu.cu -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/