Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp886370pxa; Sat, 22 Aug 2020 03:43:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymqEj1dErBSJMgnTO3KeZiiR78PC9GhJ7Kh9JiKscZoFQkFHcNRfH7SD6mvHuSEih5jlcy X-Received: by 2002:a17:906:2cc2:: with SMTP id r2mr6744141ejr.482.1598093033154; Sat, 22 Aug 2020 03:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598093033; cv=none; d=google.com; s=arc-20160816; b=0EMEGnGBPetOjx4ZN7upg02mc3j0IJmtvjm0sCJHZV+/cdPCxutJn/lHv0NR41INEe mcoAH+Zq5HrtPpVnzgXR7VShj1NtbDUkQBf88rQD8IIjk3NFrCVJTgaPuxBMgE/JOAlw nfJ2e12WJvz4B3eCJYNZJdq1I1u/PCKkB30cDQ826CfLYhOkS7/mgJVLk/BONfyn52rZ aAGIShNMAqCyM6pR3A4qRto79TPbUpjBTT2pf46WYxsEInSF+tqDueg08QjhZmcqesKt SewySAG1mz5O+/v8+2DNP+4ZjcgNNZ9EhXcaH2Y0b6/+G/CNdKa/NbOyFulfDWY/iWwo o6+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=/Izht/6u9cMMa47F9CSltBJy5bcIPTlRqOROu6gmjMg=; b=RY/DFMrGKDEEz892ZQexonSNsmrn/WqGdv7gW+Avq/J4cEB2QgPh4JBjEJgVkL8Do6 9xJbJ8Q6gWiCNx5nHr36Pwc60HvLKGoaaPlaCHKk9Bww/bpp5twpyqV2Wn5JIih17Cd6 /Gfxs1NsDEosP1Thn3dmMU+/mSt310gudGIDm6z3LlmjlyJzmus/36N4juquMlKmLJ/r EyQuj2PMWeXa42GgtU2gnToCoNaT1UAEDWSQfoSEOd+KqCToGXr1FHZuESbJQ8S99oxz ocSrqKjVT3V+hZ2iLGScfjndHIPsJTyrcsQ/P1VUdXPNadovLXdZ99/i451nqGgY1HeM PEGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=epuCfRXI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si2777473eji.313.2020.08.22.03.43.29; Sat, 22 Aug 2020 03:43:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=epuCfRXI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727802AbgHVKks (ORCPT + 99 others); Sat, 22 Aug 2020 06:40:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:48302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbgHVKkr (ORCPT ); Sat, 22 Aug 2020 06:40:47 -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 E2408206BE; Sat, 22 Aug 2020 10:40:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598092846; bh=cEGdT8XAvc9Giu0jlhAu2qtpm1zG83Ohouivsv6T9bs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=epuCfRXIEATNcPOoOjtwWgFLWUB00N88Km1/PhnQpIKAjAsVqGOjb8SZXn6KvNsMb kLfxL5VxQYDwJRoeOVz1/g9vUzxC2k9IDgJHfNJ1ltZHzjBtkwFE5v4xxCY3nDhXRl rMjSqXVIF/FTAWHZBFwftKoYhOXfHJMEuoMDHIkc= Date: Sat, 22 Aug 2020 11:40:36 +0100 From: Jonathan Cameron To: Martin Blumenstingl Cc: lars@metafoo.de, linux-iio@vger.kernel.org, linux-amlogic@lists.infradead.org, knaack.h@gmx.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH for-5.9] iio: adc: meson-saradc: Use the parent device to look up the calib data Message-ID: <20200822114036.49199bff@archlinux> In-Reply-To: <20200815181355.407034-1-martin.blumenstingl@googlemail.com> References: <20200815181355.407034-1-martin.blumenstingl@googlemail.com> X-Mailer: Claws Mail 3.17.6 (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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 15 Aug 2020 20:13:55 +0200 Martin Blumenstingl wrote: > On the older-gen 32-bit SoCs the meson-saradc driver is used to read the > SoC temperature. This requires reading calibration data from the eFuse. > > Looking up the calibration data nvmem-cell requires the OF device_node > pointer to be available in the struct device which is passed to > devm_nvmem_cell_get(). This however got lost with commit 8cb631ccbb1952 > ("iio: Remove superfluous of_node assignments") from indio_dev->dev. As > devm_nvmem_cell_get() is called in the initialization phase the > device_node is not yet available because the NVMEM cell is looked up > before iio_device_register() is called (which would then set the > device_node automatically). > Use the parent device to look up the NVMEM cell instead to fix this > issue. > > Fixes: 8cb631ccbb1952 ("iio: Remove superfluous of_node assignments") > Signed-off-by: Martin Blumenstingl Gah. I hope we don't have too many more non obvious cases like this hiding. Applied to the fixes-togreg branch of iio.git Thanks, Jonathan > --- > drivers/iio/adc/meson_saradc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c > index 93c2252c0b89..1a9189ba69ae 100644 > --- a/drivers/iio/adc/meson_saradc.c > +++ b/drivers/iio/adc/meson_saradc.c > @@ -707,7 +707,7 @@ static int meson_sar_adc_temp_sensor_init(struct iio_dev *indio_dev) > size_t read_len; > int ret; > > - temperature_calib = devm_nvmem_cell_get(&indio_dev->dev, > + temperature_calib = devm_nvmem_cell_get(indio_dev->dev.parent, > "temperature_calib"); > if (IS_ERR(temperature_calib)) { > ret = PTR_ERR(temperature_calib);