Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1595693yba; Fri, 17 May 2019 01:50:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwx/nwpYaNtwMxTkhxOcE+HT+sBFU0oYlQXgeW/5qQbCqg0mNXYRAOxKJaQwSRSYdqHReUs X-Received: by 2002:a63:c14:: with SMTP id b20mr54931853pgl.163.1558083049974; Fri, 17 May 2019 01:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558083049; cv=none; d=google.com; s=arc-20160816; b=JMrwnIPyuiSqTE9Hc9gCJtow7rRh1AJMuCrxMEgePsAQ70KM36slS7XID1lxfghmQ5 5kZDfQlzczSvsgRE6pfPm8yGPjBW5/Ud4msRWa9JWcm8VHkxy+3UtWq0lF481oOgXipf rNyVrvZ1LGEKU248RU+Qn0TvGzLYbSFh9CIqOlonQK/pVloKQOjosgTMJVeudkkRNktM jXkjZSLqUoM5x8CUTSUKJU6QChTWIkkjpomuIqbc9zSsgfNxl2JjjG9HKszaXurTSgCx 8GOlv2xSTrqVbDXStHPIAaQU39XpwZjzbZ4AxwOyZqWggD4N1F/qpjYTANMizTZn/Fss QhKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=zANvFWcmKo8EuxHsHKy0+A0TL7ZrRo4zFgliyPjUUj4=; b=hfiu2i3wZq5o8nlh8EqL186phUAriW3SbFDzYNwVc2f5cF2UTdYG8kzD419p5YNsXu dPPy3clQnvdsgKcvKASVVcpXErgBwS7R7+WmVfVsuctapwgmZFz8pXbLWT7hDiuN8zt+ LcU5j9J+Yi03xxpdfjOf8o2IbeBDqyDs2XXHSCZRyGkHjGiVWCh98VEjDGaHCCbRFW98 Z04QJUH9M3VfqOwzwc2FzKa/tJEIFAZeB3bqrk2x97gMn7Oeiotzvo8p0/brNVgSexsn ysmek/WYoDI2vY6hO0XjE0jmXLp3fyxhrnxfd0169EiXWInOVtOZhD2Q4LYfIXJHLV7E RwuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=G89E42Pa; 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 n21si7372300pgv.105.2019.05.17.01.50.35; Fri, 17 May 2019 01:50:49 -0700 (PDT) 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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=G89E42Pa; 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 S1728589AbfEQIp6 (ORCPT + 99 others); Fri, 17 May 2019 04:45:58 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38778 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727361AbfEQIp6 (ORCPT ); Fri, 17 May 2019 04:45:58 -0400 Received: by mail-wr1-f66.google.com with SMTP id d18so6208914wrs.5 for ; Fri, 17 May 2019 01:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=zANvFWcmKo8EuxHsHKy0+A0TL7ZrRo4zFgliyPjUUj4=; b=G89E42Pa8/i0yLqFzDrR7voEnExiA0bj6nxX/4R5r20F5lboYP6d80VB+yt+uns+cU CLh2KVwNUMjJb6+O8Y93sHBY/NUt++OAt1tQ/3SDeNABXCdBOafrfibAkCOB3L+feT2m s8KKjZzoi+CZ3QwFklDFwfqL5xNo4+o+laL2vGQMvFhfjpOpDpH/nYqr7zoFiWsDa+wF eDvewynCTMPVD2dTSK+2OE91AyC87rburN6cEoGRymtk4UVzaG5SUtZU/qTII1JxVCcO KybayTKa8Vw6kkWVbJAPaHWf/bzv2rVzxFntNfCUMdPh8jfM3u2rwPh3bOb1tqB2Uf0v rEWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=zANvFWcmKo8EuxHsHKy0+A0TL7ZrRo4zFgliyPjUUj4=; b=V6Hl7kgk1x/gAQzN6mfK+AwZmuNcn/yLxUxXmfAr7gLEompRXO1kJd0dwdzTR3J506 Hk8ATw6Rx2XIcXwYiBQcyIqEo+NesWLuC3z4GNIICsivdchL2GsdWFTN1ItWKsvCx5ZG JEVllh4U5FZD7iwylA1cckbaVLFv5dcy+UGbO0OXw0hLB/5wooTOKEbggdTO08TbiNIa AWA2sEC3LmqDkZ0+JCYmJu8pJuFSEkxe+INaWQ+0SbQigbLrdBVLbbyc3OKciySB4Xrv mDdG5gDoDIeI+XpJiqMG8TzknGYLYRJtRQh6+vCLhzZYMwW7E099q8NRdchAKdjzPEsR oZZg== X-Gm-Message-State: APjAAAXVZ2AATGsi68UokfWbMxqaBEaKVyqoTplaceIozlY1b7CRG25p 5vRSeT7b7cYzabaLCwfKJSAkZg== X-Received: by 2002:adf:ec42:: with SMTP id w2mr32445004wrn.77.1558082756357; Fri, 17 May 2019 01:45:56 -0700 (PDT) Received: from localhost ([2620:10d:c092:180::1:fcd4]) by smtp.gmail.com with ESMTPSA id v17sm5528287wmc.30.2019.05.17.01.45.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 May 2019 01:45:55 -0700 (PDT) From: Loys Ollivier To: Robin Murphy , Johan Hovold , Matthias Brugger Cc: baylibre-upstreaming@groups.io, linux-kernel@vger.kernel.org, Corentin Labbe , linux-mediatek@lists.infradead.org, Colin Ian King , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2] gnss: get serial speed from subdrivers In-Reply-To: <69b5e90c-c1c3-9f2e-57a8-64741182a96e@arm.com> References: <1558024626-19395-1-git-send-email-lollivier@baylibre.com> <69b5e90c-c1c3-9f2e-57a8-64741182a96e@arm.com> Date: Fri, 17 May 2019 10:45:53 +0200 Message-ID: <86y33579ku.fsf@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 16 May 2019 at 19:02, Robin Murphy wrote: >> -/* >> - * FIXME: need to provide subdriver defaults or separate dt parsing from >> - * allocation. >> - */ >> static int gnss_serial_parse_dt(struct serdev_device *serdev) >> { >> struct gnss_serial *gserial = serdev_device_get_drvdata(serdev); >> struct device_node *node = serdev->dev.of_node; >> - u32 speed = 4800; >> + u32 speed; >> >> - of_property_read_u32(node, "current-speed", &speed); >> + of_property_read_u32(node, "default-speed", &speed); >> >> gserial->speed = speed; > > Hmm, maybe it's a bit too convoluted for the compiler to warn about, but > if a "default-speed" property is not present, gserial->speed will now be > assigned an uninitialised value. I don't know what the intent is neither > the driver nor the DT provides a value, but you'll either need to bring > back the fallback initialisation above or propagate errors from > of_property_read_u32(). > > Robin. > Robin, Good point, thank you for your review. I'll think about it and see about a fallback scenario. I would be in favour of propagating the error because default values are very dependent on the hardware in use. Best, Loys